From: Date: September 26 2005 5:08pm Subject: bk commit into 5.0 tree (evgen:1.1996) BUG#13424 List-Archive: http://lists.mysql.com/internals/30334 X-Bug: 13424 Message-Id: <20050926150830.E00F713EB8C@localhost.moonbone.local> Below is the list of changes that have just been committed into a local 5.0 repository of evgen. When evgen does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.1996 05/09/26 19:08:26 evgen@stripped +3 -0 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. mysql-test/r/view_query_cache.result 1.3 05/09/26 18:59:48 evgen@stripped +9 -0 Test case for bug#13424 locking view with query cache enabled crashes server mysql-test/t/view_query_cache.test 1.3 05/09/26 18:58:17 evgen@stripped +12 -0 Test case for bug#13424 locking view with query cache enabled crashes server sql/sql_cache.cc 1.85 05/09/26 18:56:00 evgen@stripped +2 -1 Fix bug #13424 locking view with query cache enabled crashes server Added check that table is completely opened. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: evgen # Host: moonbone.local # Root: /work/13424-bug-5.0-mysql --- 1.84/sql/sql_cache.cc 2005-09-06 21:51:08 +04:00 +++ 1.85/sql/sql_cache.cc 2005-09-26 18:56:00 +04:00 @@ -1295,7 +1295,8 @@ 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); } } --- 1.2/mysql-test/r/view_query_cache.result 2005-01-27 15:21:31 +03:00 +++ 1.3/mysql-test/r/view_query_cache.result 2005-09-26 18:59:48 +04:00 @@ -123,4 +123,13 @@ 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; --- 1.2/mysql-test/t/view_query_cache.test 2005-01-27 15:21:31 +03:00 +++ 1.3/mysql-test/t/view_query_cache.test 2005-09-26 18:58:17 +04:00 @@ -84,4 +84,16 @@ 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;