diff options
author | monty@mysql.com <> | 2004-03-16 22:41:30 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2004-03-16 22:41:30 +0200 |
commit | 350b4335696fc88efa2bbf2139d2f8bf9aa5701c (patch) | |
tree | af285d8080c003d1ecb1479ec43c9b6996fd567f /sql/sql_cache.cc | |
parent | 861bf3c8c031ea80076acb7f7466bda73b23213c (diff) | |
parent | 325f6615254c871d71d9d71bb5910a61d9a61ea2 (diff) | |
download | mariadb-git-350b4335696fc88efa2bbf2139d2f8bf9aa5701c.tar.gz |
merge with 4.0
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r-- | sql/sql_cache.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 7c31281c926..cce6306d9fc 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1158,6 +1158,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 */ |