diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-01-13 20:07:06 -0200 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-01-13 20:07:06 -0200 |
commit | 3d6cea324a8ab76e6ff0b1b948beee261278ed40 (patch) | |
tree | 2f261ec103a47068356203847dff31d674e53503 /mysql-test/r/query_cache.result | |
parent | 386ec13b590a29608bf8ddea39e1acc875c702a7 (diff) | |
download | mariadb-git-3d6cea324a8ab76e6ff0b1b948beee261278ed40.tar.gz |
Bug#36326: nested transaction and select
The problem is that the query cache stores packets containing
the server status of the time when the cached statement was run.
This might lead to a wrong transaction status in the client side
if a statement is cached during a transaction and is later served
outside a transaction context (and vice-versa).
The solution is to take into account the transaction status when
storing in and serving from the query cache.
mysql-test/r/innodb_cache.result:
Update test case result.
mysql-test/r/query_cache.result:
Add test case result for Bug#36326
mysql-test/t/query_cache.test:
Add test case for Bug#36326
sql/mysql_priv.h:
Add new flags.
sql/sql_cache.cc:
Remember the transaction and autocommit status stored in the packet.
tests/mysql_client_test.c:
Add test case for Bug#36326
Diffstat (limited to 'mysql-test/r/query_cache.result')
-rw-r--r-- | mysql-test/r/query_cache.result | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index fa80a44c177..a2b73db77a9 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1681,3 +1681,54 @@ Qcache_hits 1 DROP TABLE t1; SET GLOBAL concurrent_insert= @save_concurrent_insert; SET GLOBAL query_cache_size= default; +DROP TABLE IF EXISTS t1; +FLUSH STATUS; +SET GLOBAL query_cache_size=1048576; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SHOW STATUS LIKE 'Qcache_queries_in_cache'; +Variable_name Value +Qcache_queries_in_cache 0 +SELECT * FROM t1; +a +1 +2 +3 +4 +5 +BEGIN; +SELECT * FROM t1; +a +1 +2 +3 +4 +5 +COMMIT; +SHOW STATUS LIKE 'Qcache_queries_in_cache'; +Variable_name Value +Qcache_queries_in_cache 2 +SHOW STATUS LIKE "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +SELECT * FROM t1; +a +1 +2 +3 +4 +5 +BEGIN; +SELECT * FROM t1; +a +1 +2 +3 +4 +5 +COMMIT; +SHOW STATUS LIKE "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +DROP TABLE t1; +SET GLOBAL query_cache_size= default; |