summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-20 20:56:14 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-20 20:56:14 +0100
commit01fd55ccaecc52ab4f5946287d3f7a992d81a053 (patch)
tree7af0595a233a35e279d1627ffeaea1c378d3c502 /mysql-test
parente73f13a707a2bc8e19c7c1424342eec7545797ae (diff)
downloadmariadb-git-01fd55ccaecc52ab4f5946287d3f7a992d81a053.tar.gz
MDEV-249 QUERY CACHE INFORMATION
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/plugins/r/qc_info.result15
-rw-r--r--mysql-test/suite/plugins/r/qc_info_priv.result23
-rw-r--r--mysql-test/suite/plugins/t/qc_info.test8
-rw-r--r--mysql-test/suite/plugins/t/qc_info_init.inc12
-rw-r--r--mysql-test/suite/plugins/t/qc_info_init.opt2
-rw-r--r--mysql-test/suite/plugins/t/qc_info_priv.test15
-rw-r--r--mysql-test/t/mysqld--help.test7
7 files changed, 80 insertions, 2 deletions
diff --git a/mysql-test/suite/plugins/r/qc_info.result b/mysql-test/suite/plugins/r/qc_info.result
new file mode 100644
index 00000000000..3e967d55f43
--- /dev/null
+++ b/mysql-test/suite/plugins/r/qc_info.result
@@ -0,0 +1,15 @@
+set global query_cache_size=1355776;
+create table t1 (a int not null);
+insert into t1 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
+statement_schema statement_text result_blocks_count result_blocks_size
+test select * from t1 1 512
+drop table t1;
+select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
+statement_schema statement_text result_blocks_count result_blocks_size
+set global query_cache_size= default;
diff --git a/mysql-test/suite/plugins/r/qc_info_priv.result b/mysql-test/suite/plugins/r/qc_info_priv.result
new file mode 100644
index 00000000000..c723eca1ec0
--- /dev/null
+++ b/mysql-test/suite/plugins/r/qc_info_priv.result
@@ -0,0 +1,23 @@
+set global query_cache_size=1355776;
+create table t1 (a int not null);
+insert into t1 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
+statement_schema statement_text result_blocks_count result_blocks_size
+test select * from t1 1 512
+create user mysqltest;
+select a from t1;
+a
+1
+2
+3
+select count(*) from information_schema.query_cache_info;
+count(*)
+0
+drop user mysqltest;
+drop table t1;
+set global query_cache_size= default;
diff --git a/mysql-test/suite/plugins/t/qc_info.test b/mysql-test/suite/plugins/t/qc_info.test
new file mode 100644
index 00000000000..fc6c9d5af3a
--- /dev/null
+++ b/mysql-test/suite/plugins/t/qc_info.test
@@ -0,0 +1,8 @@
+--source qc_info_init.inc
+
+drop table t1;
+# the query was invalidated
+select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
+
+set global query_cache_size= default;
+
diff --git a/mysql-test/suite/plugins/t/qc_info_init.inc b/mysql-test/suite/plugins/t/qc_info_init.inc
new file mode 100644
index 00000000000..9422bd7f141
--- /dev/null
+++ b/mysql-test/suite/plugins/t/qc_info_init.inc
@@ -0,0 +1,12 @@
+if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'query_cache_info' and plugin_status='active'`)
+{
+ --skip QUERY_CACHE_INFO plugin is not active
+}
+
+set global query_cache_size=1355776;
+
+create table t1 (a int not null);
+insert into t1 values (1),(2),(3);
+select * from t1;
+select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
+
diff --git a/mysql-test/suite/plugins/t/qc_info_init.opt b/mysql-test/suite/plugins/t/qc_info_init.opt
new file mode 100644
index 00000000000..663de4da7d7
--- /dev/null
+++ b/mysql-test/suite/plugins/t/qc_info_init.opt
@@ -0,0 +1,2 @@
+--loose-query_cache_info
+--plugin-load=$QUERY_CACHE_INFO_SO
diff --git a/mysql-test/suite/plugins/t/qc_info_priv.test b/mysql-test/suite/plugins/t/qc_info_priv.test
new file mode 100644
index 00000000000..31c394107c1
--- /dev/null
+++ b/mysql-test/suite/plugins/t/qc_info_priv.test
@@ -0,0 +1,15 @@
+--source include/not_embedded.inc
+--source qc_info_init.inc
+
+# try an unprivileged user
+create user mysqltest;
+connect (conn1,localhost,mysqltest,,);
+connection conn1;
+select a from t1;
+select count(*) from information_schema.query_cache_info;
+connection default;
+drop user mysqltest;
+drop table t1;
+
+set global query_cache_size= default;
+
diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test
index 806e6f7f8d1..4b5572c2bbe 100644
--- a/mysql-test/t/mysqld--help.test
+++ b/mysql-test/t/mysqld--help.test
@@ -23,8 +23,11 @@ perl;
datadir slave-load-tmpdir tmpdir socket/;
# Plugins which may or may not be there:
- @plugins=qw/innodb ndb archive blackhole federated partition ndbcluster feedback debug temp-pool ssl des-key-file
- xtradb thread-concurrency super-large-pages mutex-deadlock-detector null-audit maria aria pbxt oqgraph sphinx thread-handling thread-pool/;
+ @plugins=qw/innodb ndb archive blackhole federated partition ndbcluster
+ feedback debug temp-pool ssl des-key-file
+ xtradb thread-concurrency super-large-pages
+ mutex-deadlock-detector null-audit maria aria pbxt oqgraph
+ sphinx thread-handling thread-pool query-cache-info/;
# And substitute the content some environment variables with their
# names: