Bug #28343 | MyODBC 3/ADO error after updating long text field (invalid string or buffer len) | ||
---|---|---|---|
Submitted: | 9 May 2007 22:59 | Modified: | 3 Dec 2010 4:45 |
Reporter: | Erica Moss | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / ODBC | Severity: | S2 (Serious) |
Version: | 3.51.14 | OS: | Windows (XP sp2) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[9 May 2007 22:59]
Erica Moss
[9 May 2007 23:00]
Erica Moss
ODBC trace file
Attachment: SQL.LOG (application/octet-stream, text), 62.85 KiB.
[24 Aug 2007 21:23]
Erica Moss
I've verified this against 3.51.19, and raised the priority a bit The added complexity of using the append method cited in the included test function isn't really necessary. The problem occurs by doing a simple update to any record set that contains a LongText field IE: For Each fld In recset1.Fields If fld.Name = "LngText" Then fld.Value = "test" End If Next recset1.Update It also doesn't matter whether the LongText field itself has actually been modified, only that it is present in the recordSet when the update is attempted.
[26 Aug 2007 1:29]
Kent Boortz
This "could" be a bug in the ADODB driver, not sure. The MySQL driver correctly returns the max size of the LONGTEXT object to be 4294967295 (0xffffffff) as an unsigned integer. In the log it looks like the ADODB driver have tried allocate memory to store the LONGTEXT result (how could it succeed in that?!) and calls SQLBindParameter() with both ColumnSize and BufferLength set tp the LONGTEXT size. Problem is, BufferLength is a signed integer, and the size then becomes -1 (as can be seen in the trace file). The error message "Invalid string or buffer length" is specified in the Microsoft documentation to be issued when BufferLength is less than zero. Don't know what to do about this. One solution might be to let SQLDescribeCol() return 0 as column size, that means "can't be determined". This might force the ADODB driver to revert to another method for accessing the data, doing it in chunks with SQLGetData() maybe. This has to be tried out.
[3 Dec 2010 4:42]
Bogdan Degtyariov
Connector/ODBC 3.51.27 and 5.1.8 passed the test without errors. Setting the status to "Duplicate". Erica, we probably need the test case for ADO test suite. Thanks.