Loading mysql-test/r/view_query_cache.result +9 −0 Original line number Diff line number Diff line Loading @@ -123,4 +123,13 @@ select * from v3; a b drop view v3; drop table t1, t2; 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; mysql-test/t/view_query_cache.test +12 −0 Original line number Diff line number Diff line Loading @@ -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; sql/sql_cache.cc +2 −1 Original line number Diff line number Diff line Loading @@ -1295,7 +1295,8 @@ void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used) DUMP(this); for (; tables_used; tables_used= tables_used->next_local) { if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE)) if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) && tables_used->table) invalidate_table(tables_used->table); } } Loading Loading
mysql-test/r/view_query_cache.result +9 −0 Original line number Diff line number Diff line Loading @@ -123,4 +123,13 @@ select * from v3; a b drop view v3; drop table t1, t2; 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;
mysql-test/t/view_query_cache.test +12 −0 Original line number Diff line number Diff line Loading @@ -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;
sql/sql_cache.cc +2 −1 Original line number Diff line number Diff line Loading @@ -1295,7 +1295,8 @@ void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used) DUMP(this); for (; tables_used; tables_used= tables_used->next_local) { if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE)) if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) && tables_used->table) invalidate_table(tables_used->table); } } Loading