There seems to be an error in the logic of changeNamedToQmark which causes an index out of range error to be raised if the named parameter is the last word in the file (and hence there isn't non-alphanumeric character after it).
I've re-written the logic in mine to be...
if chunk: # there was a parameter - parse it out i = 0 while i < len(chunk) and (chunk[i].isalnum() or chunk[i] == '_'): c = chunk[i] i += 1 s = chunk[:i] chunk = chunk[i:]
Which seems to have resolved the problem.
Dear George:
I cannot figure out how to write a regression test for this fix.
Would you be so kind as to look in test/adodbapitest.py around line 648 to 681 and suggest an SQL statement that will cause the failure?
--
Vernon
If you change the test on line 674 so that the parameter and field are reversed as:
Then this exhibits the problem. The problem is it doesn't cope with the parameter name ending at the end of the string.
Doh! I must have been tired that day.
I fixed it using "easier to get forgiveness than permission" style:
fixed in 2.6.1.0