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

Inconsistent SELECT results when query cache is enabled

Details

    Description

      MariaDB 10.2 and newer returns inconsistent results when query caching is enabled (query_cache_type=ON).

      Steps to reproduce

      1. Start a MariaDB 10.2+ database with default settings.

      For example by running a docker container on port 3500:

      shell> docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
      

      2. Run the attached mysqltest case MDEV-16087.mysqltest

      shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
      

      It fails with:

      --- MDEV-16087.record	2018-05-15 15:42:11.495372790 +0200
      +++ MDEV-16087.reject	2018-05-15 15:52:24.547984967 +0200
      @@ -18,7 +18,7 @@
       1
       select count(*) from table3;
       count(*)
      -1
      +0
       select sql_no_cache count(*) from table3;
       count(*)
       1
       
      mysqltest: Result content mismatch
      

      3. Disable query caching and re-run the mysqltest case:

      shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
      shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
      

      Mysqltest succeeds.

      Environment

      • Ubuntu
      • MariaDB 10.2.14
      • Query cache settings:

        MariaDB [(none)]> show variables like '%query_cache%';
        +------------------------------+----------+
        | Variable_name                | Value    |
        +------------------------------+----------+
        | have_query_cache             | YES      |
        | query_cache_limit            | 131072   |
        | query_cache_min_res_unit     | 4096     |
        | query_cache_size             | 67108864 |
        | query_cache_strip_comments   | OFF      |
        | query_cache_type             | ON       |
        | query_cache_wlock_invalidate | OFF      |
        +------------------------------+----------+
        

      Attachments

        Issue Links

          Activity

            bwaldvogel Benedikt Waldvogel created issue -
            bwaldvogel Benedikt Waldvogel made changes -
            Field Original Value New Value
            Description Since MariaDB 10.2 and later I’m observing inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            I can reliably reproduce the behaviour with a unit test. Unfortunately, the unit test is too complex to attach here since it contains several transactions with many statements.

            In a late phase of the test, a specific SELECT query is executed that returns zero rows while one row would have been expected.
            When query caching is disabled ({{query_cache_type=OFF}} or {{query_cache_size=0}}), the SELECT query returns one result as expected.

            I can reliably reproduce the unexpected behaviour with MariaDB 10.2.5, 10.2.11, 10.2.14 and 10.3.6 when query caching is enabled. The behaviour is expected with MariaDB 10.1.32 or when query caching is disabled.

            I’ve tried to reduce the complex test scenario to a minimal, reproducible test that I could attach to this issue. Unfortunately, I wasn’t successful yet. So any suggestion how to continue narrowing down this issue is highly welcomed.
            Since MariaDB 10.2 and later I’m observing inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            I can reliably reproduce the behaviour with a unit test. Unfortunately, the unit test is too complex to attach here since it contains several transactions with many statements.

            In a late phase of the test, a specific SELECT query is executed that returns zero rows while one row is expected.
            When query caching is disabled ({{query_cache_type=OFF}} or {{query_cache_size=0}}), the SELECT query returns one result as expected.

            I can reliably reproduce the unexpected behaviour with MariaDB 10.2.5, 10.2.11, 10.2.14 and 10.3.6 when query caching is enabled. The behaviour is expected with MariaDB 10.1.32 or when query caching is disabled.

            I’ve tried to reduce the complex test scenario to a minimal, reproducible test that I could attach to this issue. Unfortunately, I wasn’t successful yet. So any suggestion how to continue narrowing down this issue is highly welcomed.
            bwaldvogel Benedikt Waldvogel made changes -
            Description Since MariaDB 10.2 and later I’m observing inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            I can reliably reproduce the behaviour with a unit test. Unfortunately, the unit test is too complex to attach here since it contains several transactions with many statements.

            In a late phase of the test, a specific SELECT query is executed that returns zero rows while one row is expected.
            When query caching is disabled ({{query_cache_type=OFF}} or {{query_cache_size=0}}), the SELECT query returns one result as expected.

            I can reliably reproduce the unexpected behaviour with MariaDB 10.2.5, 10.2.11, 10.2.14 and 10.3.6 when query caching is enabled. The behaviour is expected with MariaDB 10.1.32 or when query caching is disabled.

            I’ve tried to reduce the complex test scenario to a minimal, reproducible test that I could attach to this issue. Unfortunately, I wasn’t successful yet. So any suggestion how to continue narrowing down this issue is highly welcomed.
            Since MariaDB 10.2 and later I’m observing inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            I can reliably reproduce the behaviour with a unit test. Unfortunately, the unit test is too complex to attach here since it contains several transactions with many statements.

            In a late phase of the test, a specific SELECT query is executed that returns zero rows while one row is expected.
            When query caching is disabled ({{query_cache_type=OFF}} or {{query_cache_size=0}}), the SELECT query returns one result as expected.

            I can reliably reproduce the unexpected behaviour with MariaDB 10.2.5, 10.2.11, 10.2.14 and 10.3.6 when query caching is enabled. The behaviour is expected with MariaDB 10.1.32 or when query caching is disabled.
            MariaDB server configuration is untouched except for the query cache configuration.
            I can even reproduce the behaviour with MariaDB running in a docker container: {{docker run mariadb:10.2.14}}

            I’ve tried to reduce the complex test scenario to a minimal, reproducible test that I could attach to this issue. Unfortunately, I wasn’t successful yet. So any suggestion how to continue narrowing down this issue is highly welcomed.
            bwaldvogel Benedikt Waldvogel made changes -
            Description Since MariaDB 10.2 and later I’m observing inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            I can reliably reproduce the behaviour with a unit test. Unfortunately, the unit test is too complex to attach here since it contains several transactions with many statements.

            In a late phase of the test, a specific SELECT query is executed that returns zero rows while one row is expected.
            When query caching is disabled ({{query_cache_type=OFF}} or {{query_cache_size=0}}), the SELECT query returns one result as expected.

            I can reliably reproduce the unexpected behaviour with MariaDB 10.2.5, 10.2.11, 10.2.14 and 10.3.6 when query caching is enabled. The behaviour is expected with MariaDB 10.1.32 or when query caching is disabled.
            MariaDB server configuration is untouched except for the query cache configuration.
            I can even reproduce the behaviour with MariaDB running in a docker container: {{docker run mariadb:10.2.14}}

            I’ve tried to reduce the complex test scenario to a minimal, reproducible test that I could attach to this issue. Unfortunately, I wasn’t successful yet. So any suggestion how to continue narrowing down this issue is highly welcomed.
            Since MariaDB 10.2 and later I’m observing inconsistent results when query caching is enabled ({{query_cache_type=ON}}).
            The default engine ({{ENGINE=InnoDB}}) is used for all tables.

            I can reliably reproduce the behaviour with a unit test. Unfortunately, the unit test is too complex to attach here since it contains several transactions with many statements.

            In a late phase of the test, a specific SELECT query is executed that returns zero rows while one row is expected.
            When query caching is disabled ({{query_cache_type=OFF}} or {{query_cache_size=0}}), the SELECT query returns one result as expected.

            I can reliably reproduce the unexpected behaviour with MariaDB 10.2.5, 10.2.11, 10.2.14 and 10.3.6 when query caching is enabled. The behaviour is expected with MariaDB 10.1.32 or when query caching is disabled.
            MariaDB server configuration is untouched except for the query cache configuration.
            I can even reproduce the behaviour with MariaDB running in a docker container: {{docker run mariadb:10.2.14}}

            I’ve tried to reduce the complex test scenario to a minimal, reproducible test that I could attach to this issue. Unfortunately, I wasn’t successful yet. So any suggestion how to continue narrowing down this issue is highly welcomed.
            bwaldvogel Benedikt Waldvogel made changes -
            Description Since MariaDB 10.2 and later I’m observing inconsistent results when query caching is enabled ({{query_cache_type=ON}}).
            The default engine ({{ENGINE=InnoDB}}) is used for all tables.

            I can reliably reproduce the behaviour with a unit test. Unfortunately, the unit test is too complex to attach here since it contains several transactions with many statements.

            In a late phase of the test, a specific SELECT query is executed that returns zero rows while one row is expected.
            When query caching is disabled ({{query_cache_type=OFF}} or {{query_cache_size=0}}), the SELECT query returns one result as expected.

            I can reliably reproduce the unexpected behaviour with MariaDB 10.2.5, 10.2.11, 10.2.14 and 10.3.6 when query caching is enabled. The behaviour is expected with MariaDB 10.1.32 or when query caching is disabled.
            MariaDB server configuration is untouched except for the query cache configuration.
            I can even reproduce the behaviour with MariaDB running in a docker container: {{docker run mariadb:10.2.14}}

            I’ve tried to reduce the complex test scenario to a minimal, reproducible test that I could attach to this issue. Unfortunately, I wasn’t successful yet. So any suggestion how to continue narrowing down this issue is highly welcomed.
            Since MariaDB 10.2 and later return inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case
            {noformat}
            mysqltest -v -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            bwaldvogel Benedikt Waldvogel made changes -
            Attachment MDEV-16087.mysqltest [ 45637 ]
            bwaldvogel Benedikt Waldvogel made changes -
            Attachment MDEV-16087.record [ 45638 ]
            bwaldvogel Benedikt Waldvogel made changes -
            Description Since MariaDB 10.2 and later return inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case
            {noformat}
            mysqltest -v -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            MariaDB 10.2 and newer return inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case
            {noformat}
            mysqltest -v -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            bwaldvogel Benedikt Waldvogel made changes -
            Description MariaDB 10.2 and newer return inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case
            {noformat}
            mysqltest -v -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            MariaDB 10.2 and newer return inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case [^MDEV-16087.mysqltest]
            {noformat}
            mysqltest -v -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            bwaldvogel Benedikt Waldvogel made changes -
            Description MariaDB 10.2 and newer return inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case [^MDEV-16087.mysqltest]
            {noformat}
            mysqltest -v -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            MariaDB 10.2 and newer return inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case [^MDEV-16087.mysqltest]
            {noformat}
            mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            bwaldvogel Benedikt Waldvogel made changes -
            Description MariaDB 10.2 and newer return inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case [^MDEV-16087.mysqltest]
            {noformat}
            mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            MariaDB 10.2 and newer returns inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case [^MDEV-16087.mysqltest]
            {noformat}
            mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            bwaldvogel Benedikt Waldvogel made changes -
            Description MariaDB 10.2 and newer returns inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case [^MDEV-16087.mysqltest]
            {noformat}
            mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            MariaDB 10.2 and newer returns inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            shell> docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case [^MDEV-16087.mysqltest]
            {noformat}
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            bwaldvogel Benedikt Waldvogel made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            bwaldvogel Benedikt Waldvogel made changes -
            Attachment MDEV-16087.mysqltest [ 45639 ]
            bwaldvogel Benedikt Waldvogel made changes -
            Attachment MDEV-16087.mysqltest [ 45637 ]
            bwaldvogel Benedikt Waldvogel made changes -
            Attachment MDEV-16087.record [ 45638 ]
            bwaldvogel Benedikt Waldvogel made changes -
            Attachment MDEV-16087.record [ 45640 ]
            bwaldvogel Benedikt Waldvogel made changes -
            Description MariaDB 10.2 and newer returns inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            shell> docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case [^MDEV-16087.mysqltest]
            {noformat}
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            MariaDB 10.2 and newer returns inconsistent results when query caching is enabled ({{query_cache_type=ON}}).

            h2. Steps to reproduce

            h3. 1. Start a MariaDB 10.2+ database with default settings.
            For example by running a docker container on port 3500:
            {noformat}
            shell> docker run --name mariadb-10.2.14 -p 3500:3306 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=test -d mariadb:10.2.14
            {noformat}

            h3. 2. Run the attached mysqltest case [^MDEV-16087.mysqltest]
            {noformat}
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}

            It fails with:
            {noformat}
            --- MDEV-16087.record 2018-05-15 15:42:11.495372790 +0200
            +++ MDEV-16087.reject 2018-05-15 15:52:24.547984967 +0200
            @@ -18,7 +18,7 @@
             1
             select count(*) from table3;
             count(*)
            -1
            +0
             select sql_no_cache count(*) from table3;
             count(*)
             1

            mysqltest: Result content mismatch
            {noformat}

            h3. 3. Disable query caching and re-run the mysqltest case:
            {noformat}
            shell> echo "set global query_cache_type = off;" | mysql -h 127.0.0.1 --port=3500 --user=root --password=test
            shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file=MDEV-16087.record test < MDEV-16087.mysqltest
            {noformat}
            Mysqltest succeeds.

            h2. Environment

            * Ubuntu
            * MariaDB 10.2.14
            * Query cache settings:
            {noformat}
            MariaDB [(none)]> show variables like '%query_cache%';
            +------------------------------+----------+
            | Variable_name | Value |
            +------------------------------+----------+
            | have_query_cache | YES |
            | query_cache_limit | 131072 |
            | query_cache_min_res_unit | 4096 |
            | query_cache_size | 67108864 |
            | query_cache_strip_comments | OFF |
            | query_cache_type | ON |
            | query_cache_wlock_invalidate | OFF |
            +------------------------------+----------+
            {noformat}
            valerii Valerii Kravchuk made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            valerii Valerii Kravchuk made changes -
            Affects Version/s 10.3.6 [ 23003 ]
            Labels querycache querycache regression
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ]
            valerii Valerii Kravchuk made changes -
            Affects Version/s 10.2.15 [ 23006 ]
            valerii Valerii Kravchuk made changes -
            Labels querycache regression querycache regression regression-10.2
            bwaldvogel Benedikt Waldvogel made changes -
            serg Sergei Golubchik made changes -
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            bwaldvogel Benedikt Waldvogel made changes -
            sanja Oleksandr Byelkin made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            marko Marko Mäkelä made changes -
            Assignee Oleksandr Byelkin [ sanja ] Thirunarayanan B [ thiru ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            Assignee Thirunarayanan B [ thiru ] Marko Mäkelä [ marko ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Thirunarayanan B [ thiru ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            issue.field.resolutiondate 2018-06-18 08:58:58.0 2018-06-18 08:58:58.313
            thiru Thirunarayanan Balathandayuthapani made changes -
            Component/s Storage Engine - InnoDB [ 10129 ]
            Fix Version/s 10.2.16 [ 23110 ]
            Fix Version/s 10.3.8 [ 23113 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 86926 ] MariaDB v4 [ 154303 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 177512

            People

              thiru Thirunarayanan Balathandayuthapani
              bwaldvogel Benedikt Waldvogel
              Votes:
              2 Vote for this issue
              Watchers:
              8 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.