summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2008-09-30 10:47:01 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2008-09-30 10:47:01 -0300
commit6816cf6a6518bb5108fe7907f71e58be994db6e5 (patch)
tree3f2fc0ec73f1ca1d8a6037a6cf1280bd56e3ccad /sql/sql_cache.cc
parent2714b57bd3ecebecbdd51bf42a4c0c41972d3a04 (diff)
downloadmariadb-git-6816cf6a6518bb5108fe7907f71e58be994db6e5.tar.gz
Bug#34306: Can't make copy of log tables when server binary log is enabled
Post-merge bug fix: lock_type is a enumeration type and not a bit mask. sql/sql_cache.cc: Check for lock type explicitly. Also err on the safe side and invalidate the query cache for any write lock.
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index f5566acbc6f..81d0d447ac1 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1542,10 +1542,9 @@ void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used)
for (; tables_used; tables_used= tables_used->next_local)
{
thd_proc_info(thd, "invalidating query cache entries (table)");
- if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) &&
+ if (tables_used->lock_type >= TL_WRITE_ALLOW_WRITE &&
tables_used->table)
{
- THD *thd= current_thd;
invalidate_table(thd, tables_used->table);
}
}