[CONJ-444] 'Incorrect string value' received when using setBytes on prepared statement Created: 2017-03-14 Updated: 2021-02-08 Resolved: 2021-02-08 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | JDBC 4.2 compatibility |
| Affects Version/s: | 1.5.8, 1.5.9 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Gabor Csertan | Assignee: | Diego Dupin |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Manjaro Linux |
||
| Description |
|
We recently replaced the MySQL JDBC connector with MariaDB connector in our project. A workaround for this is to use setBinaryStream instead of setBytes. The cause might lie in how ParameterWriter writes a byte[] vs an InputStream: when writing an array it prepends the data with _binary' while it only writes a single quote for streams. By looking at the network traffic I found that the MySQL connector sends the data converted to hexadecimal and prepended with an x when using setBytes and sends the raw bytes prepended with _binary for setBinaryStream, while the MariaDB connector does the same for setBytes and sends just the raw bytes for setBinaryStream. |
| Comments |
| Comment by Diego Dupin [ 2021-02-08 ] |
|
Close because not reproduced, and no activity since 5 years |