summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authordlenev@mysql.com <>2005-09-15 03:56:09 +0400
committerdlenev@mysql.com <>2005-09-15 03:56:09 +0400
commite231ebe5fbfde7cd8cd4e3e2e21ebadb91fe965a (patch)
tree0f615e302d79fa87c5b5c4e98170b68ece5b0fa8 /sql/sql_lex.h
parent9300833c91236da77b00d2c7871d11894b5803a7 (diff)
downloadmariadb-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.h')
-rw-r--r--sql/sql_lex.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 6c91045189c..cccc3465a21 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -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)