diff options
author | unknown <dlenev@mysql.com> | 2006-02-16 16:19:24 +0300 |
---|---|---|
committer | unknown <dlenev@mysql.com> | 2006-02-16 16:19:24 +0300 |
commit | e1c8d9c9b4f4d7592f088e38a8374ab844cd51ee (patch) | |
tree | c72397457373b7612a240def6032659f180d64df /sql/sql_prepare.cc | |
parent | 86733db80b223c39b0860397425b0751b258205f (diff) | |
download | mariadb-git-e1c8d9c9b4f4d7592f088e38a8374ab844cd51ee.tar.gz |
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.
sql/mysql_priv.h:
In order to handle correctly case when table list completely consists from tables
from prelocked set close_tables_for_reopen() have to accept table list as in/out
parameter.
sql/sql_base.cc:
open_tables():
Removed part of comment which was out of date.
Changed handling of case when refresh happens during opening of tables, now
instead of having code which decides for each table if it should be closed
we simply close all tables. Old code also incorrectly handled tables from
prelocked set in this situation which resulted in bug #16593 "Deadlock or
crash in stress test for case where triggers starting trigger".
close_tables_for_reopen():
Now we correctly handle the case when table list completely consists from
tables from prelocked set. Also now we simply close all tables instead
leaving temporary tables non-closed (such approach allows easily handle
correctly tables from prelocked set).
sql/sql_prepare.cc:
In order to handle correctly case when table list completely consists from tables
from prelocked set close_tables_for_reopen() have to accept table list as in/out
parameter.
sql/sql_update.cc:
In order to handle correctly case when table list completely consists from tables
from prelocked set close_tables_for_reopen() have to accept table list as in/out
parameter.
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 68f033f78fe..b0c4cef6e87 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1135,7 +1135,7 @@ static int mysql_test_update(Prepared_statement *stmt, break; if (!need_reopen) goto error; - close_tables_for_reopen(thd, table_list); + close_tables_for_reopen(thd, &table_list); } /* |