mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Manual merge of patch fixing several trigger related bugs with main tree.
sql/item.cc: Auto merged sql/item.h: Auto merged sql/mysql_priv.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Manual merge sql/sql_update.cc: Manual merge
This commit is contained in:
@ -3813,7 +3813,7 @@ err_no_arena:
|
||||
TRUE error occured
|
||||
*/
|
||||
|
||||
bool
|
||||
static bool
|
||||
fill_record(THD * thd, List<Item> &fields, List<Item> &values,
|
||||
bool ignore_errors)
|
||||
{
|
||||
@ -3839,6 +3839,41 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Fill fields in list with values from the list of items and invoke
|
||||
before triggers.
|
||||
|
||||
SYNOPSIS
|
||||
fill_record_n_invoke_before_triggers()
|
||||
thd thread context
|
||||
fields Item_fields list to be filled
|
||||
values values to fill with
|
||||
ignore_errors TRUE if we should ignore errors
|
||||
triggers object holding list of triggers to be invoked
|
||||
event event type for triggers to be invoked
|
||||
|
||||
NOTE
|
||||
This function assumes that fields which values will be set and triggers
|
||||
to be invoked belong to the same table, and that TABLE::record[0] and
|
||||
record[1] buffers correspond to new and old versions of row respectively.
|
||||
|
||||
RETURN
|
||||
FALSE OK
|
||||
TRUE error occured
|
||||
*/
|
||||
|
||||
bool
|
||||
fill_record_n_invoke_before_triggers(THD *thd, List<Item> &fields,
|
||||
List<Item> &values, bool ignore_errors,
|
||||
Table_triggers_list *triggers,
|
||||
enum trg_event_type event)
|
||||
{
|
||||
return (fill_record(thd, fields, values, ignore_errors) ||
|
||||
triggers && triggers->process_triggers(thd, event,
|
||||
TRG_ACTION_BEFORE, TRUE));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Fill field buffer with values from Field list
|
||||
|
||||
@ -3875,6 +3910,41 @@ fill_record(THD *thd, Field **ptr, List<Item> &values, bool ignore_errors)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Fill fields in array with values from the list of items and invoke
|
||||
before triggers.
|
||||
|
||||
SYNOPSIS
|
||||
fill_record_n_invoke_before_triggers()
|
||||
thd thread context
|
||||
ptr NULL-ended array of fields to be filled
|
||||
values values to fill with
|
||||
ignore_errors TRUE if we should ignore errors
|
||||
triggers object holding list of triggers to be invoked
|
||||
event event type for triggers to be invoked
|
||||
|
||||
NOTE
|
||||
This function assumes that fields which values will be set and triggers
|
||||
to be invoked belong to the same table, and that TABLE::record[0] and
|
||||
record[1] buffers correspond to new and old versions of row respectively.
|
||||
|
||||
RETURN
|
||||
FALSE OK
|
||||
TRUE error occured
|
||||
*/
|
||||
|
||||
bool
|
||||
fill_record_n_invoke_before_triggers(THD *thd, Field **ptr,
|
||||
List<Item> &values, bool ignore_errors,
|
||||
Table_triggers_list *triggers,
|
||||
enum trg_event_type event)
|
||||
{
|
||||
return (fill_record(thd, ptr, values, ignore_errors) ||
|
||||
triggers && triggers->process_triggers(thd, event,
|
||||
TRG_ACTION_BEFORE, TRUE));
|
||||
}
|
||||
|
||||
|
||||
static void mysql_rm_tmp_tables(void)
|
||||
{
|
||||
uint i, idx;
|
||||
|
Reference in New Issue
Block a user