Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.2(EOL)
-
None
Description
Query cache doesn't take in account capability CLIENT_DEPRECATE_EOF.
This flag change query result data : suppressing some EOF, or replacing some with OK_Packet for example.
Since query cache doesn't check this field in query cache data structure : https://mariadb.com/kb/en/mariadb/query-cache/#query-cache-internal-structure
corresponding source : https://github.com/MariaDB/server/blob/10.2/sql/sql_cache.cc#L1413
If a driver that doesn't set CLIENT_DEPRECATE_EOF capability execute a query that can be cached, another driver that support CLIENT_DEPRECATE_EOF will have a resultset in a format not expected if executing the same query. (the opposite is true too).
In term of error with java driver, resulting errors can be :
java.lang.ArrayIndexOutOfBoundsException: 5 |
at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.readNextValue(SelectResultSet.java:510) |
at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.fetchAllResults(SelectResultSet.java:368) |
or
java.sql.SQLException: (conn:28) Packets out of order when reading field packets, expected was EOF stream. Packet contents (hex) = XX |
workaround is to disable query cache (see documentation) or to not mix drivers that support CLIENT_DEPRECATE_EOF with other that don't support this capability
Attachments
Issue Links
- causes
-
CONJ-504 java.lang.ArrayIndexOutOfBoundsException when useServerPrepStmts=true
- Closed