darkrock / ferite-modules

Extra modules for the ferite programming language
http://www.ferite.org
12 stars 4 forks source link

bugger in parameterized queries #2

Open XULRunner42 opened 13 years ago

XULRunner42 commented 13 years ago

res = dbh.query("INSERT INTO testtable (testrecord1, testrecord2)" + " VALUES (?, ?)", "string %' ' ' ' '", 'zxcvqwer');

is expected to work, but the single quote causes an error. Still an error if you use dbh.quote("string ' % '") for the parameter, which you shouldn't have to do anyway.

Error returned from errstr() looked like 1: near "zxcvqwer": syntax error

XULRunner42 commented 13 years ago

https://github.com/XULRunner42/ferite-modules/commits/quoteparam

there are a couple of steps toward debugging here, sanity checking that ferite_quote_internal actually does what you think (strings come out with escape characters in them) and a single example to blow up the query engine