Bug #30983 SQL Statements limited to 64k
Submitted: 12 Sep 2007 17:52 Modified: 12 Oct 2007 15:09
Reporter: vha
Status: Closed
Category:Connector/ODBC Severity:S3 (Non-critical)
Version:5.1.0 alpha OS:Microsoft Windows
Assigned to: Bugs System Target Version:

[12 Sep 2007 17:52] vha
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 9:38] Jess Balint
fix + test

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

[13 Sep 2007 9:39] Jess Balint
Thanks for your bug report
[13 Sep 2007 9:40] Jess Balint
Bug#30984 was marked as a duplicate of this.
[13 Sep 2007 17: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 17:08] Jim Winstead
The fix for this bug was committed, and will be included in the 5.1.1 release.
[12 Oct 2007 15:09] MC Brown
A note has been added to the 5.1.1 changelog: 

SQL statements are limited to 64KB.