1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime

into  jabberwock.site:/home/dlenev/mysql-5.1-bg18437
This commit is contained in:
dlenev@jabberwock.site
2006-07-07 14:11:35 +04:00
19 changed files with 538 additions and 76 deletions

View File

@ -1009,8 +1009,15 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
}
/*
Let us bind Item_trigger_field objects representing access to fields
in old/new versions of row in trigger to Field objects in table being
Gather all Item_trigger_field objects representing access to fields
in old/new versions of row in trigger into lists containing all such
objects for the triggers with same action and timing.
*/
triggers->trigger_fields[lex.trg_chistics.event]
[lex.trg_chistics.action_time]=
(Item_trigger_field *)(lex.trg_table_fields.first);
/*
Also let us bind these objects to Field objects in table being
opened.
We ignore errors here, because if even something is wrong we still
@ -1523,6 +1530,44 @@ bool Table_triggers_list::process_triggers(THD *thd, trg_event_type event,
}
/*
Mark fields of subject table which we read/set in its triggers as such.
SYNOPSIS
mark_fields_used()
thd Current thread context
event Type of event triggers for which we are going to inspect
DESCRIPTION
This method marks fields of subject table which are read/set in its
triggers as such (by properly updating TABLE::read_set/write_set)
and thus informs handler that values for these fields should be
retrieved/stored during execution of statement.
*/
void Table_triggers_list::mark_fields_used(trg_event_type event)
{
int action_time;
Item_trigger_field *trg_field;
for (action_time= 0; action_time < (int)TRG_ACTION_MAX; action_time++)
{
for (trg_field= trigger_fields[event][action_time]; trg_field;
trg_field= trg_field->next_trg_field)
{
/* We cannot mark fields which does not present in table. */
if (trg_field->field_idx != (uint)-1)
{
bitmap_set_bit(table->read_set, trg_field->field_idx);
if (trg_field->get_settable_routine_parameter())
bitmap_set_bit(table->write_set, trg_field->field_idx);
}
}
}
table->file->column_bitmaps_signal();
}
/*
Trigger BUG#14090 compatibility hook