summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 1ca9db44cc7..f17825e6d2c 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1299,7 +1299,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);
}
}