You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue with the DuckDB JDBC driver when retrieving BLOB data. After calling the ResultSet.next() method, the value of the BLOB unexpectedly changes. This issue was reproduced using the following Java code.
Steps to Reproduce:
Create a DuckDB database.
Run the following Java code:
importjava.io.IOException;
importjava.sql.*;
publicclassTestDuckDBJDBC {
publicstaticfinalStringJDBC_URL = "jdbc:duckdb:/path/to/database";
publicstaticvoidmain(String[] args) throwsSQLException, IOException {
Connectionconn = DriverManager.getConnection(JDBC_URL);
Statementstmt = conn.createStatement();
ResultSetrs = stmt.executeQuery("SELECT '\\xAA'::BLOB;");
// Correct value byte= [-86]Blobblob = null;
while (rs.next()) {
blob = rs.getBlob(1);
}
// But after calling rs.next(), the blob value changesSystem.out.println(newString(blob.getBinaryStream().readAllBytes()));
}
}
Expected Behavior:
The value of the BLOB should remain the same even after calling ResultSet.next().
Actual Behavior:
The value of the BLOB changes after calling ResultSet.next(). Specifically, the BLOB returns a different value when retrieved through blob.getBinaryStream() after ResultSet.next().
You can adjust the details like versions and paths specific to your case. Let me know if you need any further modifications!
The text was updated successfully, but these errors were encountered:
Environment:
JDBC Driver version: 1.0.0
DuckDB version: v1.0.0 1f98600c2c
OS: macOS 14.6.1
Description:
I encountered an issue with the DuckDB JDBC driver when retrieving BLOB data. After calling the ResultSet.next() method, the value of the BLOB unexpectedly changes. This issue was reproduced using the following Java code.
Steps to Reproduce:
Expected Behavior:
The value of the BLOB should remain the same even after calling ResultSet.next().
Actual Behavior:
The value of the BLOB changes after calling ResultSet.next(). Specifically, the BLOB returns a different value when retrieved through blob.getBinaryStream() after ResultSet.next().
You can adjust the details like versions and paths specific to your case. Let me know if you need any further modifications!
The text was updated successfully, but these errors were encountered: