-
Notifications
You must be signed in to change notification settings - Fork 19
jdbc: BLOB type roundtrip fails #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Confirmed on Tarantool 2.1.1-164-gf6a31c034. Commented here: tarantool/tarantool#3650 (comment) |
The Java connector correclty sends bin8 type in the case, but tarantool stores fixstr and responds with fixint. So this is blocked on tarantool/tarantool#3650 |
Nothing has changed after applying the recent Tarantool changes made in scope of tarantool/tarantool#4019 . |
Now it is blocked by the problem described here. |
The tarantool side of the issue was resolved in 2.1.1-423-g4007436aa ( tarantool/tarantool@4007436 ). Not blocked now. |
Enable a broken test which was blocked by Tarantool serverissue related to SQL BLOB type support. Closes: #45 See also: tarantool/tarantool#3650, tarantool/tarantool#4019
Enable a broken test which was blocked by Tarantool server issue related to SQL BLOB type support. Closes: #45 See also: tarantool/tarantool#3650, tarantool/tarantool#4019
Values of BINARY/VARBINARY columns are selected back as strings when initially inserted as byte arrays in a prepared statement.
CREATE TABLE testbin(id INT PRIMARY KEY, b VARBINARY)
PreparedStatement prep = conn.prepareStatement("INSERT INTO testbin(id, b) VALUES (1, ?)");
prep.setBytes(1, new BigInteger("ABCD", 16).toByteArray());
prep.executeUpdate();
...
ResultSet rs = stmt.executeQuery("SELECT b FROM testbin");
rs.next();
rs.getBytes(1) - fails.
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to [B at org.tarantool.jdbc.SQLResultSet.getBytes(SQLResultSet.java:133) at TestJdbcBinary.main(TestJdbcBinary.java:32)
But when inserted as X’hexstring’ in a basic statement, the value that gets back is byte[].
INSERT INTO testbin(id, b) VALUES(1, X'ABCD') -- OK, select returns byte[]
The text was updated successfully, but these errors were encountered: