Bug #19078 Bound string parameters not escaped correctly
Submitted: 13 Apr 2006 17:12 Modified: 1 Feb 2007 7:14
Reporter: Bogdan Degtyariov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.00.08,5.00.09 OS:
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: bound parameter, insert, SQL_WCHAR, SQLBindParameter, UPDATE

[13 Apr 2006 17:12] Bogdan Degtyariov
Description:
MyODBC generates wrong UPDATE query for SQL_WCHAR

How to repeat:
Run the test application uploaded below
[13 Apr 2006 17:13] Bogdan Degtyariov
test case

Attachment: TestBindWcharParam.cpp (text/plain), 4.36 KiB.

[18 Nov 2006 18:53] Jim Winstead
there's one (fatal) problem with the test case -- it is passing a buffer size of 20 to SQLBindParameter(), even though it is only passing a buffer with sizeof(5). Either size needs to be set to sizeof(buf), or the size of buf needs to be set to 20.

with this fixed (either way), the test case passes with the latest C/ODBC 5 sources. but if you add a character that needs quoting to the string, it fails, so i'm leaving the bug open. (and attaching the improved test case.)
[18 Nov 2006 19:06] Jim Winstead
updated test case -- shows problem with embedded ' in parameter

Attachment: TestBindWcharParam.cpp (application/octet-stream, text), 4.37 KiB.

[21 Nov 2006 0:33] Jess Balint
Fix committed as rev 686