Bug #30958 | not null text fields containing empty strings return 0 records in queries | ||
---|---|---|---|
Submitted: | 11 Sep 2007 18:11 | Modified: | 13 Nov 2007 11:54 |
Reporter: | Stephen Wuebker | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / ODBC | Severity: | S2 (Serious) |
Version: | 3.51.20, 5.1 | OS: | Windows |
Assigned to: | Jim Winstead | CPU Architecture: | Any |
Tags: | null, ODBC, text |
[11 Sep 2007 18:11]
Stephen Wuebker
[13 Sep 2007 6:50]
Jess Balint
Bug verified exactly as described. ODBC test case added in source repo in test/my_result.c (t_bug30958). The problem is we don't handle SQLGetData() correctly when the "out buffer space" parameter is 0. The varchar field works because it uses a bound parameter instead of SQLGetData(). The NULL case is odd because we treat it exactly the same way, but ADO decides it's ok. See test case for more details.
[23 Oct 2007 17:04]
Bogdan Degtyariov
The bug never occurs if remove this string: cn.CursorLocation = adUseClient
[2 Nov 2007 21:56]
Jim Winstead
Fix handling of SQLGetData when given 0-sized buffer and result is empty string
Attachment: bug30958.patch (text/plain), 2.72 KiB.
[12 Nov 2007 21:16]
Jim Winstead
The fix for this bug has been committed, and will be included in the next release (3.51.22). Thanks for the bug report.
[13 Nov 2007 11:54]
MC Brown
A note has been added to the 3.51.22 changelog: The wrong result was returned by SQLGetData() when the data was an empty string and a zero-sized buffer was specified.