Created attachment 112557 [details] test dump file See bug 88601, comment 2, and comment 3 1) Using mysql-connector-java-5.1.21 JDBC connector 2) Create a test table from mysql cli : CREATE TABLE `Table1` ( `Field1` tinyint(1) unsigned NOT NULL, `Field2` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`Field2`) ) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 3) Add the following data : +--------+--------+ | Field1 | Field2 | +--------+--------+ | 244 | 1 | | 255 | 2 | | 213 | 3 | | 128 | 4 | | 1 | 5 | | 2 | 6 | | 4 | 7 | | 5 | 8 | | 255 | 9 | Have enclosed dump file
Loos of data occurs when trying to manipulate the data in the tinyint fields from LO as the user can only tick or untick the boxes. If the box is unticked, the value of tinyint(1) gets set to zero >>> dataloss.
This bug also prevents data entry.
Also present in Version: 4.5.0.0.alpha0+ Build ID: 15db0307fe6429238be72612cccd4a1df5e1e97c Locale: fr_
https://dev.mysql.com/doc/connector-j/en/connector-j-reference-type-conversions.html#idm140272205367040 MySQL Type Name Returned as Java Class TINYINT java.lang.Boolean if the configuration property tinyInt1isBit is set to true (the default) and the storage size is 1, or java.lang.Integer if not.
Hmm, ok. If I set the connection string with that parameter set to false, reload the tables, I get the following error when trying to read a table with the value of 244 : SQL Status: 22003 '244' in column '1' is outside valid range for the datatype TINYINT.
(In reply to Alex Thurgood from comment #5) > Hmm, ok. > > If I set the connection string with that parameter set to false, reload the > tables, I get the following error when trying to read a table with the value > of 244 : > > SQL Status: 22003 > > '244' in column '1' is outside valid range for the datatype TINYINT. Forget that last comment, I was testing on LO 3.6.x. Testing on master 4500 with that switch displays the correct values.
(In reply to Alex Thurgood from comment #5) > If I set the connection string with that parameter set to false, reload the > tables, I get the following error when trying to read a table with the value > of 244 : > > SQL Status: 22003 > > '244' in column '1' is outside valid range for the datatype TINYINT. JDBC has no way to express an unsigned column (that concept does not exist in Java, and does not exist in the SQL standard), so it is presented by the JDBC driver as a *signed* tinyint column, whose valid values are -128 to +127. FYI, you can use TINYINT columns as integers without unsetting tinyInt1isBit by using TINYINT(4) instead of TINYINT(1).