1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

invalidation of locking for write tables (BUG#2693)

fixed linking query_prealloc_size to query cache presence
This commit is contained in:
bell@sanja.is.com.ua
2004-03-04 18:32:55 +02:00
parent f8345cc617
commit d03034d306
8 changed files with 82 additions and 4 deletions

View File

@ -1090,6 +1090,37 @@ void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used)
DBUG_VOID_RETURN;
}
/*
Invalidate locked for write
SYNOPSIS
Query_cache::invalidate_locked_for_write()
tables_used - table list
NOTE
can be used only for opened tables
*/
void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used)
{
DBUG_ENTER("Query_cache::invalidate (changed table list)");
if (query_cache_size > 0 && tables_used)
{
STRUCT_LOCK(&structure_guard_mutex);
if (query_cache_size > 0)
{
DUMP(this);
for (; tables_used; tables_used= tables_used->next)
{
if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE))
invalidate_table(tables_used->table);
}
}
STRUCT_UNLOCK(&structure_guard_mutex);
}
DBUG_VOID_RETURN;
}
/*
Remove all cached queries that uses the given table
*/