1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

block using QC in case of having tables locked by LOCK... (BUG#12385)

sql/sql_cache.cc:
  block QC using if tables are locked with LOCK
  unlock QC
mysql-test/r/query_cache_noembeded.result:
  New BitKeeper file ``mysql-test/r/query_cache_noembeded.result''
mysql-test/t/query_cache_noembeded.test:
  New BitKeeper file ``mysql-test/t/query_cache_noembeded.test''
This commit is contained in:
unknown
2005-08-10 18:58:55 +03:00
parent 04bf09424d
commit 307ed9b4da
3 changed files with 56 additions and 2 deletions

View File

@@ -739,7 +739,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
TABLE_COUNTER_TYPE local_tables;
ulong tot_length;
DBUG_ENTER("Query_cache::store_query");
if (query_cache_size == 0)
if (query_cache_size == 0 || thd->locked_tables)
DBUG_VOID_RETURN;
if ((local_tables= is_cacheable(thd, thd->query_length,
@@ -750,7 +750,10 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
STRUCT_LOCK(&structure_guard_mutex);
if (query_cache_size == 0)
{
STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_VOID_RETURN;
}
DUMP(this);
/* Key is query + database + flag */
@@ -874,7 +877,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
byte flags;
DBUG_ENTER("Query_cache::send_result_to_client");
if (query_cache_size == 0 ||
if (query_cache_size == 0 || thd->locked_tables ||
/*
it is not possible to check has_transactions() function of handler
because tables not opened yet