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:
@ -510,6 +510,25 @@ bool Table_triggers_list::prepare_record1_accessors(TABLE *table)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Adjust Table_triggers_list with new TABLE pointer.
|
||||
|
||||
SYNOPSIS
|
||||
set_table()
|
||||
new_table - new pointer to TABLE instance
|
||||
*/
|
||||
|
||||
void Table_triggers_list::set_table(TABLE *new_table)
|
||||
{
|
||||
table= new_table;
|
||||
for (Field **field= table->triggers->record1_field ; *field ; field++)
|
||||
{
|
||||
(*field)->table= (*field)->orig_table= new_table;
|
||||
(*field)->table_name= &new_table->alias;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Check whenever .TRG file for table exist and load all triggers it contains.
|
||||
|
||||
|
Reference in New Issue
Block a user