summaryrefslogtreecommitdiff
path: root/mysql-test/r/query_cache.result
diff options
context:
space:
mode:
authorunknown <thek@adventure.(none)>2007-08-21 13:43:09 +0200
committerunknown <thek@adventure.(none)>2007-08-21 13:43:09 +0200
commita5423e18dcb571635ff5f3108cbd0e529bd2d981 (patch)
tree2705f9014c7fbbaf9825368184180cb21c12d8e5 /mysql-test/r/query_cache.result
parent28233c1f27c01116b38ff670c0227b631c57253d (diff)
downloadmariadb-git-a5423e18dcb571635ff5f3108cbd0e529bd2d981.tar.gz
Bug#30269 Query cache eats memory
Although the query cache doesn't support retrieval of statements containing column level access control, it was still possible to cache such statements thus wasting memory. This patch extends the access control check on the target tables to avoid caching a statement with column level restrictions. Views are excepted and can be cached but only retrieved by super user account. mysql-test/t/query_cache_with_views.test: Rename: mysql-test/t/view_query_cache.test -> mysql-test/t/query_cache_with_views.test mysql-test/r/query_cache_with_views.result: Rename: mysql-test/r/view_query_cache.result -> mysql-test/r/query_cache_with_views.result mysql-test/r/query_cache.result: Modified test case to allow caching of views mysql-test/t/query_cache.test: Modified test case to allow caching of views sql/sql_cache.cc: Allow caching of views
Diffstat (limited to 'mysql-test/r/query_cache.result')
-rw-r--r--mysql-test/r/query_cache.result9
1 files changed, 7 insertions, 2 deletions
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index ecf7df2d2ae..4bae61ea494 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1503,10 +1503,11 @@ a (select count(*) from t2)
4 0
drop table t1,t2;
DROP DATABASE IF EXISTS bug30269;
+FLUSH STATUS;
CREATE DATABASE bug30269;
USE bug30269;
CREATE TABLE test1 (id int, name varchar(23));
-CREATE VIEW view1 AS SELECT id FROM test1;
+CREATE VIEW view1 AS SELECT * FROM test1;
INSERT INTO test1 VALUES (5, 'testit');
GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost';
GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost';
@@ -1515,15 +1516,19 @@ USE bug30269;
show status like 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 0
+# Select statement not stored in query cache because of column privileges.
SELECT id FROM test1 WHERE id>2;
id
5
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
SELECT id FROM view1 WHERE id>2;
id
5
show status like 'Qcache_queries_in_cache';
Variable_name Value
-Qcache_queries_in_cache 0
+Qcache_queries_in_cache 1
DROP DATABASE bug30269;
DROP USER 'bug30269'@'localhost';
set GLOBAL query_cache_type=default;