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

Fix for bug #16593 "Deadlock or crash in stress test for case where

trigger starts trigger".

In short, the deadlock/crash happened when execution of statement, which used
stored functions or activated triggers, coincided with alteration of the
tables used by these functions or triggers (in highly concurrent environment).

Bug was caused by the incorrect handling of tables from prelocked set in
open_tables() functions in situations when refresh happened. This fix replaces
old smart but not very robust way of handling tables after refresh (which was
closing only old tables), with new one which simply closes all tables opened so
far and restarts open_tables().
Also fixed handling of temporary tables in close_tables_for_reopen().

No test case present since bug manifests itself only in concurrent environment.
This commit is contained in:
dlenev@mysql.com
2006-02-16 16:19:24 +03:00
parent bba8155516
commit 4a41a00d4b
4 changed files with 31 additions and 61 deletions

View File

@ -158,7 +158,7 @@ int mysql_update(THD *thd,
break;
if (!need_reopen)
DBUG_RETURN(1);
close_tables_for_reopen(thd, table_list);
close_tables_for_reopen(thd, &table_list);
}
if (mysql_handle_derived(thd->lex, &mysql_derived_prepare) ||
@ -813,7 +813,7 @@ reopen_tables:
for (TABLE_LIST *tbl= table_list; tbl; tbl= tbl->next_global)
tbl->cleanup_items();
close_tables_for_reopen(thd, table_list);
close_tables_for_reopen(thd, &table_list);
goto reopen_tables;
}