Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-13300

Query cache doesn't take in account CLIENT_DEPRECATE_EOF capability

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.2
    • Fix Version/s: 10.2.8
    • Component/s: Query Cache
    • Labels:
      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

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              diego dupin Diego Dupin
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: