[CONJ-535] BIT(1) data type value is different when using ResultSet.getShort() and PreparedStatement/Statement Created: 2017-10-04 Updated: 2017-10-26 Resolved: 2017-10-26 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.4.5, 1.5.9, 1.6.0, 1.6.4, 1.6.5 |
| Fix Version/s: | 2.2.0, 1.7.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Juha Räsänen | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
A while ago we did JDBC driver upgrade from 1.4.5 to 1.6.4 and noticed an issue when using getShort-method for BIT(1) data type. After closer inspection we wrote a test which returns the value using different methods and using PreparedStatement/Statement. Other ResultSet methods (getString, getObject, getByte, getBoolean) return the correct result (0/1), but getShort()-method produces strange results. I am not familiar with MariaDB JDBC driver internal logic, but it seems this has to do something with text/binary protocol detection. Driver version 1.4.5/1.5.9, using PreparedStatement: Driver version 1.4.5/1.5.9, using Statement: Driver version 1.6.0/1.6.4/1.6.5, using PreparedStatement: Driver version 1.6.0/1.6.4/1.6.5, using Statement: MariaDB server information: |
| Comments |
| Comment by Diego Dupin [ 2017-10-26 ] | |||||||||||||||
|
corrected in 2.2.0 and 1.7.0. available through snapshot :
|