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

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.
This commit is contained in:
dlenev@mysql.com
2005-09-15 03:56:09 +04:00
parent 9300833c91
commit e231ebe5fb
16 changed files with 414 additions and 97 deletions

View File

@ -843,8 +843,15 @@ typedef struct st_lex
/*
List linking elements of 'sroutines' set. Allows you to add new elements
to this set as you iterate through the list of existing elements.
'sroutines_list_own_last' is pointer to ::next member of last element of
this list which represents routine which is explicitly used by query.
'sroutines_list_own_elements' number of explicitly used routines.
We use these two members for restoring of 'sroutines_list' to the state
in which it was right after query parsing.
*/
SQL_LIST sroutines_list;
byte **sroutines_list_own_last;
uint sroutines_list_own_elements;
st_sp_chistics sp_chistics;
bool only_view; /* used for SHOW CREATE TABLE/VIEW */
@ -956,6 +963,15 @@ typedef struct st_lex
{
return ( query_tables_own_last ? *query_tables_own_last : 0);
}
void chop_off_not_own_tables()
{
if (query_tables_own_last)
{
*query_tables_own_last= 0;
query_tables_last= query_tables_own_last;
query_tables_own_last= 0;
}
}
void cleanup_after_one_table_open();
void push_context(Name_resolution_context *context)