[CONJ-720] CallableStatements with Boolean OUT parameter Created: 2019-07-22 Updated: 2021-05-17 Resolved: 2021-05-17 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | MySQL compatibility |
| Affects Version/s: | 2.2.5, 2.4.2 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Björn Raupach | Assignee: | Diego Dupin |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MySQL 5.6 database |
||
| Issue Links: |
|
||||||||
| Description |
|
We observed an inconsistent behaviour from MySQL Connector/J to MariaDB Connector/J. Steps to reproduce: 1) Create a SP that always returns 0 (false)
2) Create a Test case that calls the stored procedure
3) Calls the test case with the mariadb-java-client-2.2.5 and mysql-connector-java-5.1.47 4) The test case works with the MySQL JDBC Driver but fails with MariaDB JDBC Driver. It always returns true, even though it should return false. |
| Comments |
| Comment by Björn Raupach [ 2019-07-22 ] | ||||
|
If we change the OUT parameter to TINYINT(1) it works, it does not work with BIT(1). | ||||
| Comment by Björn Raupach [ 2019-07-22 ] | ||||
|
Not sure if it helps, but if I look into BinaryRowProtocol.java and the method getInternalBoolean it checks if parseBit() != 0. I can only see parseBit returning 48 false and 49 true. Not 0. However I have no knowledge of the MySQL wire protocol. Just guessing. | ||||
| Comment by Diego Dupin [ 2019-07-30 ] | ||||
|
I've created an issue server-side (MDEV-20212), A workaround is to use TINYINT(1) as you indicate. Just for information: MariaDB connector will execute
MySQL under the hood will do more queries :
| ||||
| Comment by Diego Dupin [ 2021-05-17 ] | ||||
|
won't fix in connector, waiting for MDEV-20212 |