mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user