diff options
author | evgen@moonbone.local <> | 2005-09-26 19:08:26 +0400 |
---|---|---|
committer | evgen@moonbone.local <> | 2005-09-26 19:08:26 +0400 |
commit | 0032165acf66475e6598eb2cb87baa5f79d57893 (patch) | |
tree | 8b9b4ca03467197762b598fbc406ee1cd5c0eb07 /sql/sql_cache.cc | |
parent | 099c25e146e637bb9698f2a22d4400f43711fdc9 (diff) | |
download | mariadb-git-0032165acf66475e6598eb2cb87baa5f79d57893.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.
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r-- | sql/sql_cache.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 04663c5b096..13aedf6eeb0 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -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); } } |