Bug #30983 SQL Statements limited to 64k
Submitted: 12 Sep 2007 15:52 Modified: 12 Oct 2007 13:09
Reporter: vha x Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1.0 alpha OS:Microsoft Windows
Assigned to: Jess Balint

[12 Sep 2007 15:52] vha x
Description:
Using the following sql statement:
 
INSERT INTO T (Col_1) VALUES (0xAABBCC...)
 
where Col_1 is of type LONGBLOB.
 
When using an SQL Statements longer than 64k, the statement fails with
the error message telling that I have a syntax error at <xxx>
where xxx is at offset 64k in the SQL statement. With ODBC 3.51.19 and
ODBC 5.0.11, this is working.

How to repeat:
Using the following sql statement:
 
INSERT INTO T (Col_1) VALUES (0xAABBCC...)
 
where Col_1 is of type LONGBLOB.
[13 Sep 2007 7:38] Jess Balint
fix + test

Attachment: bug_30983.diff (application/octet-stream, text), 1.12 KiB.

[13 Sep 2007 7:39] Jess Balint
Thanks for your bug report
[13 Sep 2007 7:40] Jess Balint
Bug#30984 was marked as a duplicate of this.
[13 Sep 2007 15:58] Jim Winstead
patch looks good, but the test may not be portable because sprintf() doesn't return the length of the resulting string everywhere.

you might also want to test the length of the column returned by the query, just to make sure the full length of data is being sent.
[22 Sep 2007 15:08] Jim Winstead
The fix for this bug was committed, and will be included in the 5.1.1 release.
[12 Oct 2007 13:09] MC Brown
A note has been added to the 5.1.1 changelog: 

SQL statements are limited to 64KB.