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

Results of queries depending on user variables are written into and hit the query cache

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.0, 10.5, 10.6, 10.11, 11.2(EOL), 11.4, 11.6(EOL)
    • 10.5, 10.6, 10.11, 11.4
    • Query Cache
    • None

    Description

      In the following test case, the result of the first SELECT is written into the query cache, and the second one uses the query cache, which makes it return a result set, while it shouldn't, because the variable value has changed.

      It started happening after this commit in 10.4.0:

      commit de745ecf29721795710910a19bd0ea3389da804c
      Author: Oleksandr Byelkin
      Date:   Tue May 22 19:08:39 2018 +0200
       
          MDEV-11953: support of brackets in UNION/EXCEPT/INTERSECT operations
      

      According to a preliminary discussion on slack, the change wasn't intentional.

      set @qc.save= @@global.query_cache_type;
      set global query_cache_type=1;
      set query_cache_type=1;
       
      create table t (a int);
      insert into t values (1);
      set @x=1;
      select sql_cache * from t where a=@x;
      set @x=2;
      select sql_cache * from t where a=@x;
       
      # Cleanup
      drop table t;
      set global query_cache_type= @qc.save;
      

      10.5 4955f6018a1af8cbaf491c22f8da7cde56321ba0

      create table t (a int);
      insert into t values (1);
      set @x=1;
      select sql_cache * from t where a=@x;
      a
      1
      set @x=2;
      select sql_cache * from t where a=@x;
      a
      1
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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