Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.2.15, 10.3.6, 10.2(EOL), 10.3(EOL)
-
Ubuntu 16.04
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
- relates to
-
MDEV-16251 Query caching should not be enabled by default in apt packages
-
- Closed
-
- links to
Activity
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. |
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. |
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. |
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= {noformat} It fails with: {noformat} --- +++ @@ -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= {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} |
Attachment | MDEV-16087.mysqltest [ 45637 ] |
Attachment | MDEV-16087.record [ 45638 ] |
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= {noformat} It fails with: {noformat} --- +++ @@ -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= {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= {noformat} It fails with: {noformat} --- +++ @@ -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= {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} |
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= {noformat} It fails with: {noformat} --- +++ @@ -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= {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= {noformat} It fails with: {noformat} --- +++ @@ -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= {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} |
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= {noformat} It fails with: {noformat} --- +++ @@ -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= {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 -h 127.0.0.1 --port=3500 --user=test --password=test --result-file= {noformat} It fails with: {noformat} --- +++ @@ -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= {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} |
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 -h 127.0.0.1 --port=3500 --user=test --password=test --result-file= {noformat} It fails with: {noformat} --- +++ @@ -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= {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 [^ {noformat} mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file= {noformat} It fails with: {noformat} --- +++ @@ -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= {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} |
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 [^ {noformat} mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file= {noformat} It fails with: {noformat} --- +++ @@ -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= {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 [^ {noformat} shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file= {noformat} It fails with: {noformat} --- +++ @@ -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= {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} |
Priority | Major [ 3 ] | Critical [ 2 ] |
Attachment | MDEV-16087.mysqltest [ 45639 ] |
Attachment |
|
Attachment |
|
Attachment | MDEV-16087.record [ 45640 ] |
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 [^ {noformat} shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file= {noformat} It fails with: {noformat} --- +++ @@ -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= {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 [^ {noformat} shell> mysqltest -h 127.0.0.1 --port=3500 --user=test --password=test --result-file= {noformat} It fails with: {noformat} --- +++ @@ -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= {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} |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Affects Version/s | 10.3.6 [ 23003 ] | |
Labels | querycache | querycache regression |
Assignee | Oleksandr Byelkin [ sanja ] |
Affects Version/s | 10.2.15 [ 23006 ] |
Labels | querycache regression | querycache regression regression-10.2 |
Remote Link | This issue links to "MariaDB docker image issue: "Query caching should not be enabled by default" (Web Link)" [ 28501 ] |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] |
Link |
This issue relates to |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Thirunarayanan B [ thiru ] |
Assignee | Thirunarayanan B [ thiru ] | Marko Mäkelä [ marko ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Marko Mäkelä [ marko ] | Thirunarayanan B [ thiru ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
issue.field.resolutiondate | 2018-06-18 08:58:58.0 | 2018-06-18 08:58:58.313 |
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 ] |
Workflow | MariaDB v3 [ 86926 ] | MariaDB v4 [ 154303 ] |
Zendesk Related Tickets | 177512 |
Easy to reproduce with 10.3.6, for example:
openxs@ao756:~/dbs/maria10.3$ bin/mysql --host=127.0.0.1 --port=3308 -uroot -e"select @@query_cache_type, version()"
+--------------------+----------------+
| @@query_cache_type | version() |
+--------------------+----------------+
| OFF | 10.3.6-MariaDB |
+--------------------+----------------+
openxs@ao756:~/dbs/maria10.3$ bin/mysqltest --host=127.0.0.1 --port=3308 -uroot test < /tmp/MDEV-16087.mysqltest
connect conn1, 127.0.0.1, root, , test, 3308;
connect conn2, 127.0.0.1, root, , test, 3308;
connect conn3, 127.0.0.1, root, , test, 3308;
connection conn1;
create table table1 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
create table table2 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
create table table3 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
connection conn2;
set autocommit=0;
select * from table2;
id
connection conn1;
insert into table3 () values ();
connection conn2;
insert into table1 () values ();
select count(*) from table3;
count(*)
0
connection conn3;
set autocommit=0;
select count(*) from table3;
count(*)
1
select count(*) from table3;
count(*)
1
select sql_no_cache count(*) from table3;
count(*)
1
rollback;
connection conn2;
rollback;
connection conn1;
drop table table1;
drop table table2;
drop table table3;
ok
openxs@ao756:~/dbs/maria10.3$ bin/mysql --host=127.0.0.1 --port=3308 -uroot -e"set global query_cache_type=on;"
openxs@ao756:~/dbs/maria10.3$ bin/mysql --host=127.0.0.1 --port=3308 -uroot -e"select @@query_cache_type, version()"
+--------------------+----------------+
| @@query_cache_type | version() |
+--------------------+----------------+
| ON | 10.3.6-MariaDB |
+--------------------+----------------+
openxs@ao756:~/dbs/maria10.3$ bin/mysqltest --host=127.0.0.1 --port=3308 -uroot test < /tmp/MDEV-16087.mysqltest
connect conn1, 127.0.0.1, root, , test, 3308;
connect conn2, 127.0.0.1, root, , test, 3308;
connect conn3, 127.0.0.1, root, , test, 3308;
connection conn1;
create table table1 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
create table table2 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
create table table3 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
connection conn2;
set autocommit=0;
select * from table2;
id
connection conn1;
insert into table3 () values ();
connection conn2;
insert into table1 () values ();
select count(*) from table3;
count(*)
0
connection conn3;
set autocommit=0;
select count(*) from table3;
count(*)
1
select count(*) from table3;
count(*)
0
select sql_no_cache count(*) from table3;
count(*)
1
rollback;
connection conn2;
rollback;
connection conn1;
drop table table1;
drop table table2;
drop table table3;
ok
openxs@ao756:~/dbs/maria10.3$
I can not reproduce with 10.2.12, fore example. so looks like a recent enough regression.