Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
3.3.1
-
None
Description
This bug was introduced in 3.3.1 (works fine in 3.3.0):
org.mariadb.jdbc.DatabaseMetaData.executeQuery.DatabaseMetaData.java()
|
private ResultSet executeQuery(String sql) throws SQLException {
|
Statement stmt =
|
connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
CompleteResult rs = (CompleteResult) stmt.executeQuery(sql);
|
rs.setStatement(null); // bypass Hibernate statement tracking (CONJ-49)
|
rs.useAliasAsName();
|
return rs;
|
}
|
Here the cast to CompleResult throws an exception since it gots a StreamingResult!
Exception thrown:
2023-12-11 09:05:59 - java.lang.ClassCastException: class org.mariadb.jdbc.client.result.StreamingResult cannot be cast to class org.mariadb.jdbc.client.result.CompleteResult (org.mariadb.jdbc.client.result.StreamingResult and org.mariadb.jdbc.client.result.CompleteResult are in unnamed module of loader 'app')
|
2023-12-11 09:06:00 - at org.mariadb.jdbc.DatabaseMetaData.executeQuery(DatabaseMetaData.java:557)
|
2023-12-11 09:06:00 - at org.mariadb.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:771)
|
We use parameters "useCursorFetch=true;defaultFetchSize=1000" in the JDBC connection string.
The code triggering this (running inside Wildfly 30):
try (ResultSet rs = connection.getMetaData().getTables(connection.getCatalog(), connection.getSchema(), "sn_dbversion", new String[] { "TABLE" }))
|
{
|
while (rs.next())
|
...
|