diff options
author | dlenev@mysql.com <> | 2005-09-15 03:56:09 +0400 |
---|---|---|
committer | dlenev@mysql.com <> | 2005-09-15 03:56:09 +0400 |
commit | e231ebe5fbfde7cd8cd4e3e2e21ebadb91fe965a (patch) | |
tree | 0f615e302d79fa87c5b5c4e98170b68ece5b0fa8 /sql/sql_lex.cc | |
parent | 9300833c91236da77b00d2c7871d11894b5803a7 (diff) | |
download | mariadb-git-e231ebe5fbfde7cd8cd4e3e2e21ebadb91fe965a.tar.gz |
Fix for bug #12704 "Server crashes during trigger execution".
This bug occurs when some trigger for table used by DML statement is created
or changed while statement was waiting in lock_tables(). In this situation
prelocking set which we have calculated becames invalid which can easily lead
to errors and even in some cases to crashes.
With proposed patch we no longer silently reopen tables in lock_tables(),
instead caller of lock_tables() becomes responsible for reopening tables and
recalculation of prelocking set.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index e579ee9f8bd..b7a2b6b0624 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -179,6 +179,8 @@ void lex_start(THD *thd, uchar *buf,uint length) if (lex->sroutines.records) my_hash_reset(&lex->sroutines); lex->sroutines_list.empty(); + lex->sroutines_list_own_last= lex->sroutines_list.next; + lex->sroutines_list_own_elements= 0; DBUG_VOID_RETURN; } @@ -1613,6 +1615,8 @@ st_lex::st_lex() { hash_init(&sroutines, system_charset_info, 0, 0, 0, sp_sroutine_key, 0, 0); sroutines_list.empty(); + sroutines_list_own_last= sroutines_list.next; + sroutines_list_own_elements= 0; } @@ -2025,6 +2029,8 @@ void st_lex::cleanup_after_one_table_open() if (sroutines.records) my_hash_reset(&sroutines); sroutines_list.empty(); + sroutines_list_own_last= sroutines_list.next; + sroutines_list_own_elements= 0; } |