Bug #31246 | Opening rowset with extra fields leads to incorrect SQL INSERT | ||
---|---|---|---|
Submitted: | 27 Sep 2007 15:26 | Modified: | 12 Oct 2007 13:07 |
Reporter: | Craig Holmquist | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / ODBC | Severity: | S3 (Non-critical) |
Version: | 3.51.20 | OS: | Windows (XP SP2) |
Assigned to: | Bogdan Degtyariov | CPU Architecture: | Any |
[27 Sep 2007 15:26]
Craig Holmquist
[4 Oct 2007 10:32]
Tonci Grgin
Hi Craig and thanks for your report. Verified as described with test case attached on MySQL server 5.0.50 on WinXP Pro SP2 host using MyODBC 3.51.21 rev.803. 071004 12:26:33 2 Connect root@localhost on 2 Query SET SQL_AUTO_IS_NULL = 0 071004 12:26:35 2 Query DROP DATABASE IF EXISTS testadd 071004 12:26:36 2 Query CREATE DATABASE testadd 071004 12:26:37 2 Query USE testadd 071004 12:26:39 2 Query CREATE TABLE testadd (field1 VARCHAR(100) NOT NULL, field2 VARCHAR(100) NOT NULL, field3 int DEFAULT NULL, field4 VARCHAR(50) DEFAULT NULL, PRIMARY KEY(field1,field2)) 071004 12:26:42 2 Query SELECT field1, field2, field3, field4 FROM testadd WHERE field1 = '1' AND field2 = '2' 071004 12:26:46 2 Query INSERT INTO `testadd`(`field1`,`field2`,`field3`,`field4`) VALUES ('1','2',,'') 071004 12:26:56 2 Quit
[4 Oct 2007 10:32]
Tonci Grgin
DM trace file
Attachment: DMTrace.zip (application/zip, text), 2.39 KiB.
[5 Oct 2007 11:57]
Bogdan Degtyariov
Patch
Attachment: patch31246.diff (application/octet-stream, text), 2.21 KiB.
[5 Oct 2007 15:14]
Bogdan Degtyariov
Patch with the test case that checks the result
Attachment: patch31246v2.diff (application/octet-stream, text), 2.92 KiB.
[5 Oct 2007 22:04]
Bogdan Degtyariov
The fix for this bug was committed to the source repository, and will be in 3.51.21.
[12 Oct 2007 13:07]
MC Brown
A note has been added to the 3.51.21 changelog: When using a rowset/cursor and add a new row with a number of fields, subsequent rows with fewer fields will include the original fields from the previous row in the final INSERT statement.