Bug #48105 | Cannot insert records with LONGTEXT columns | ||
---|---|---|---|
Submitted: | 16 Oct 2009 7:38 | Modified: | 7 Oct 2010 8:39 |
Reporter: | Miroslav Ambros | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / ODBC | Severity: | S3 (Non-critical) |
Version: | 5.1 | OS: | Windows (XP) |
Assigned to: | Bogdan Degtyariov | CPU Architecture: | Any |
Tags: | Duplicate entry, insert, last column, longtext, not stored |
[16 Oct 2009 7:38]
Miroslav Ambros
[16 Oct 2009 7:41]
Miroslav Ambros
Test case
Attachment: bug48105.vbs (application/octet-stream, text), 1.96 KiB.
[16 Oct 2009 7:46]
Tonci Grgin
Miroslav, LONGTEXT is far bigger than anything MS SW recognizes. What happens when you use option "Limit column size to signed 32-bit range"?
[16 Oct 2009 7:49]
Miroslav Ambros
Forgot versions used: mysql-5.4.2-beta-win32.msi mysql-connector-odbc-5.1.5-win32.msi
[16 Oct 2009 7:52]
Tonci Grgin
Miroslav, see my last comment.
[16 Oct 2009 7:58]
Miroslav Ambros
I have changed my connection string now: Const DSN = "Driver={MySQL ODBC 5.1 Driver};Uid=***;Pwd=***;Server=***;Database=***;OPTION=134217728" But with no luck - the same error occurs. I hope the number in "option" is correct... ;-) http://dev.mysql.com/doc/refman/5.0/en/connector-odbc-configuration-connection-parameters....
[16 Oct 2009 8:42]
Miroslav Ambros
New findings about LONGTEXT data type used in my test case when replaced: * with TEXT - the same error * with VARCHAR(4096) - the same error * with VARCHAR(4095) - no error, all values stored in database So the value of 2^12 is the magical border... :-)
[24 Feb 2010 14:13]
Tonci Grgin
See Bug#26165.
[7 Oct 2010 7:16]
Bogdan Degtyariov
Verified with Connector/ODBC 5.1.7 rev 932
[7 Oct 2010 8:09]
Bogdan Degtyariov
Looks like rs("Id") = 700001 is completely ignored by the driver: INSERT INTO `test`.`bug48105`(`Id`,`SomeText`) VALUES (DEFAULT,'blah_blah_1') INSERT INTO `test`.`bug48105`(`Id`,`SomeText`) VALUES (DEFAULT,'blah_blah_2')
[7 Oct 2010 8:39]
Bogdan Degtyariov
Interesting that ADODB.Recordset uses SQLPutData() for text column #2, but never for column #1: ------------------------------------------------------ bug48105 170c-49c ENTER SQLSetPos HSTMT 0x001BE4C8 SQLSETPOSIROW 1 UWORD 4 <SQL_ADD> BOOL 0 <SQL_LOCK_NO_CHANGE> bug48105 170c-49c EXIT SQLSetPos with return code 99 (SQL_NEED_DATA) HSTMT 0x001BE4C8 SQLSETPOSIROW 1 UWORD 4 <SQL_ADD> BOOL 0 <SQL_LOCK_NO_CHANGE> bug48105 170c-49c ENTER SQLParamData HSTMT 0x001BE4C8 PTR * 0x0050DFA8 bug48105 170c-49c EXIT SQLParamData with return code 99 (SQL_NEED_DATA) HSTMT 0x001BE4C8 PTR * 0x0050DFA8 bug48105 170c-49c ENTER SQLPutData HSTMT 0x001BE4C8 PTR 0x06220584 SQLLEN 22 bug48105 170c-49c EXIT SQLPutData with return code 0 (SQL_SUCCESS) HSTMT 0x001BE4C8 PTR 0x06220584 SQLLEN 22 bug48105 170c-49c ENTER SQLParamData HSTMT 0x001BE4C8 PTR * 0x0050DFA8 bug48105 170c-49c EXIT SQLParamData with return code -1 (SQL_ERROR) HSTMT 0x001BE4C8 PTR * 0x0050DFA8 DIAG [S1000] [MySQL][ODBC 5.1 Driver][mysqld-5.1.45-community-log]Duplicate entry '0' for key 'PRIMARY' (1062) ------------------------------------------------------ That is the reason why the driver has no data for column #1 and therefore uses DEFAULT value for it. I am setting the status as "not a bug" because it looks as a bug in ADODB. Information that directly proves the opposite is always welcome.