turbodbc icon indicating copy to clipboard operation
turbodbc copied to clipboard

Error inserting boolean values into MySQL 5.7's BIT fields

Open MathMagique opened this issue 8 years ago • 2 comments

When using a MySQL 5.7 database and a table with a column of type BIT, the following error message occurs when inserting a boolean value:

DatabaseError: ODBC error
state: HY000
native error code: 1406
message: [MySQL][ODBC 5.3(a) Driver][mysqld-5.7.17-0ubuntu0.16.04.1]Data too long for column 'a' at row 1

MathMagique avatar Mar 31 '17 13:03 MathMagique

This is one of the problems currently seen in the windows_ci branch, since AppVeyor already ships a MySQL 5.7 database.

The issue does not appear with MySQL 5.6 (as on Travis and most current Linux systems).

MathMagique avatar Mar 31 '17 13:03 MathMagique

Update: According to MySQL bug #67702, you can work around by setting the connection option no_ssps = "1". This will disable server-side prepared statements in favor of emulating prepared statements on the client side. This sounds like a very bad idea performance-wise.

I'll try to get a minimal reproducing example for the MySQL guys to chew on.

MathMagique avatar Mar 31 '17 14:03 MathMagique