My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 73: a single-quote ' in a comment will hide following parameter markers
1 person starred this issue and may be notified of changes. Back to list
Status:  NoFix
Owner:  ----
Closed:  Dec 2009


 
Reported by terminatorul@gmail.com, Oct 26, 2009
What steps will reproduce the problem?
1. write a query with parameters (paramter markers) and with a comment
before the markers, that includes an unmatched single-quote 
2. connect to a database
3. execute query with cursor.execute, providing the query parameters

What is the expected output? What do you see instead?
I get:

ProgrammingError: ('The SQL contains 0 parameter markers, but 1 parameters
were supplied', 'HY000')


What version of the product are you using? On what operating system?
pyodbc-2.1.6 on Ubuntu Linux

Please provide any additional information below.
You have my query attached.
It is rather large, so you should write:
 cusor.execute(open('query.sql', 'r').read(), ('10',))
to execute it.

campaign_files_expiry.sql
7.2 KB   View   Download
Oct 26, 2009
Project Member #1 mkleehammer
This appears to be an issue with the driver.

pyodbc doesn't actually read the query - it is generally passed on to the driver with
no modifications.

I created a similar query and tested against SQL Server 2008 on Windows and it
correctly processes the comment containing a single quote.

What database and driver are you using?
Status: Investigating
Oct 27, 2009
#2 terminatorul@gmail.com
Ok, sorry for the misplaced post.

I use PosgreSql with pgODBC and unixODBC and I have also had other problems with this
driver.

Unlike other problems with the driver, this one raised ProgrammingError so I thought
pyodbc would be the cause ...

Can you please asses if the problem is in pgODBC or in unixODBC ? For me they are
both poor and not very reliable, so equally likely to introduce the bug ...

Dec 31, 2009
Project Member #3 mkleehammer
I can't really test the drivers for you since I don't have them setup right now -- I ditched my servers and need to 
rebuild my test environments using VMs.  I recommend asking in the pyodbc discussion group, though.

Am closing since we found this isn't pyodbc. 
Status: Invalid
Nov 21, 2010
Project Member #4 mkleehammer
(No comment was entered for this change.)
Status: NoFix

Powered by Google Project Hosting