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

Query cache doesn't take in account CLIENT_DEPRECATE_EOF capability

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.2(EOL)
    • 10.2.8
    • Query Cache
    • 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

            revision-id: ccca8487b708fae5320c295938e8266860d81281 (mariadb-10.2.7-20-gccca8487b70)
            parent(s): bcc10a5a447805ce64aa13ee6a037c1618219616
            committer: Oleksandr Byelkin
            timestamp: 2017-08-04 11:02:13 +0200
            message:

            MDEV-13300 Query cache doesn't take in account CLIENT_DEPRECATE_EOF capability

            take into account new capabilty flag which has influence on result format.

            sanja Oleksandr Byelkin added a comment - revision-id: ccca8487b708fae5320c295938e8266860d81281 (mariadb-10.2.7-20-gccca8487b70) parent(s): bcc10a5a447805ce64aa13ee6a037c1618219616 committer: Oleksandr Byelkin timestamp: 2017-08-04 11:02:13 +0200 message: MDEV-13300 Query cache doesn't take in account CLIENT_DEPRECATE_EOF capability take into account new capabilty flag which has influence on result format. —

            github tree is bb-10.2-MDEV-13300

            sanja Oleksandr Byelkin added a comment - github tree is bb-10.2- MDEV-13300

            responded till I have time to understand java technology

            sanja Oleksandr Byelkin added a comment - responded till I have time to understand java technology

            Fix for Connector-J is confirmed. Connector-C has no support of this feature.

            sanja Oleksandr Byelkin added a comment - Fix for Connector-J is confirmed. Connector-C has no support of this feature.

            ok to push

            serg Sergei Golubchik added a comment - ok to push

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.