summaryrefslogtreecommitdiff
path: root/mysql-test/t/view_query_cache.test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-09-26 19:08:26 +0400
committerunknown <evgen@moonbone.local>2005-09-26 19:08:26 +0400
commit05c17f2abcd5d617bdffc9636dfc34e3a0b93c5a (patch)
tree8b9b4ca03467197762b598fbc406ee1cd5c0eb07 /mysql-test/t/view_query_cache.test
parent6f126ba4d0964304937f5a26d7e33c56933fe42b (diff)
downloadmariadb-git-05c17f2abcd5d617bdffc9636dfc34e3a0b93c5a.tar.gz
Fix bug #13424 locking view with query cache enabled crashes server
For LOCK view is opened but not prepared thus leaving 'table' field set to NULL. invalidate_locked_for_write() wasn't checking that and call to invalidate_table(NULL) crashes server. To invalidate_locked_for_write() added check that ensures that table is completely opened. sql/sql_cache.cc: Fix bug #13424 locking view with query cache enabled crashes server Added check that table is completely opened. mysql-test/t/view_query_cache.test: Test case for bug#13424 locking view with query cache enabled crashes server mysql-test/r/view_query_cache.result: Test case for bug#13424 locking view with query cache enabled crashes server
Diffstat (limited to 'mysql-test/t/view_query_cache.test')
-rw-r--r--mysql-test/t/view_query_cache.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/view_query_cache.test b/mysql-test/t/view_query_cache.test
index bca111a5ed1..81994407641 100644
--- a/mysql-test/t/view_query_cache.test
+++ b/mysql-test/t/view_query_cache.test
@@ -84,4 +84,16 @@ select * from v3;
drop view v3;
drop table t1, t2;
+#
+# Bug #13424 locking view with query cache enabled crashes server
+#
+create table t1(f1 int);
+insert into t1 values(1),(2),(3);
+create view v1 as select * from t1;
+set query_cache_wlock_invalidate=1;
+lock tables v1 read /*!32311 local */;
+unlock tables;
+set query_cache_wlock_invalidate=default;
+drop view v1;
+drop table t1;
set GLOBAL query_cache_size=default;