[ psqlodbc-Bugs-1000605 ] Escaped single-quotes mistreated by PGAPI_NumParams

From: <noreply(at)pgfoundry(dot)org>
To: noreply(at)pgfoundry(dot)org
Subject: [ psqlodbc-Bugs-1000605 ] Escaped single-quotes mistreated by PGAPI_NumParams
Date: 2006-04-04 10:52:28
Message-ID: 20060404105228.B2A62103383D@pgfoundry.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Bugs item #1000605, was opened at 2006-04-04 13:52
You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000605&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Lasse Haataja (lhaataja)
Assigned to: Nobody (None)
Summary: Escaped single-quotes mistreated by PGAPI_NumParams

Initial Comment:
Note: The error seems to only occur with 8.01.0200, although the actual code in PGAPI_NumParams is identical in earlier versions; probably called with different args in .0200.

The body of PGAPI_NumParams seems to fail to take into account
single quotes escaped by backslashes, instead treating them in the same manner
as literal single quotes, causing queries containing escaped single quotes
and question marks in correct sequence (such as SELECT '\'?') to fail with
the error "The # of binded parameters < the # of parameter markers".

This can luckily be worked around (in a standard-compliant manner, no less) by
escaping single quotes with a single quote instead of a backslash, but a fix,
at least in the documentation, would be welcome.

To reproduce, do a SELECT '\'?' via psqlodbc 8.01.0200.

----------------------------------------------------------------------

You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000605&group_id=1000125

Browse pgsql-odbc by date

  From Date Subject
Next Message Hiroshi Inoue 2006-04-04 14:54:03 Re: Unicode is not UTF-8. was :psqlODBC-Driver Test / text
Previous Message noreply 2006-04-04 10:45:12 [ psqlodbc-Bugs-1000604 ] 8.01.0200 slow with long queries