| 2230 | */ |
| 2231 | |
| 2232 | void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used, |
| 2233 | my_bool using_transactions) |
| 2234 | { |
| 2235 | DBUG_ENTER("Query_cache::invalidate (table list)"); |
| 2236 | if (is_disabled()) |
| 2237 | DBUG_VOID_RETURN; |
| 2238 | |
| 2239 | using_transactions= using_transactions && thd->in_multi_stmt_transaction_mode(); |
| 2240 | for (; tables_used; tables_used= tables_used->next_local) |
| 2241 | { |
| 2242 | DBUG_ASSERT(!using_transactions || tables_used->table!=0); |
| 2243 | if (tables_used->derived) |
| 2244 | continue; |
| 2245 | if (using_transactions && |
| 2246 | (tables_used->table->file->table_cache_type() == |
| 2247 | HA_CACHE_TBL_TRANSACT)) |
| 2248 | /* |
| 2249 | tables_used->table can't be 0 in transaction. |
| 2250 | Only 'drop' invalidate not opened table, but 'drop' |
| 2251 | force transaction finish. |
| 2252 | */ |
| 2253 | thd->add_changed_table(tables_used->table); |
| 2254 | else |
| 2255 | invalidate_table(thd, tables_used); |
| 2256 | } |
| 2257 | |
| 2258 | DEBUG_SYNC(thd, "wait_after_query_cache_invalidate"); |
| 2259 | |
| 2260 | DBUG_VOID_RETURN; |
| 2261 | } |
| 2262 | |
| 2263 | void Query_cache::invalidate(THD *thd, CHANGED_TABLE_LIST *tables_used) |
| 2264 | { |
no test coverage detected