1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fix for bug #5888 "Triggers with nonexistent columns cause packets

out of order". (final version)

Now instead of binding Item_trigger_field to TABLE objects during
trigger definition parsing at table open, we perform pass through
special list of all such objects in trigger. This allows easily check
all references to fields in old/new version of row in trigger during
execution of CREATE TRIGGER statement (this is more courtesy for users
since we can't check everything anyway).
We also report that such reference is bad by returning error from
Item_trigger_field::fix_fields() method (instead of setup_field())
This means that if trigger is broken we will bark during trigger
execution instead of trigger definition parsing at table open.
(i.e. now we allow to open tables with broken triggers).
This commit is contained in:
dlenev@brandersnatch.localdomain
2004-11-24 12:24:02 +03:00
parent 8c401b5569
commit d201074611
13 changed files with 165 additions and 96 deletions

View File

@@ -3912,11 +3912,11 @@ create_error:
}
case SQLCOM_CREATE_TRIGGER:
{
/* We don't care much about trigger body at that point */
res= mysql_create_or_drop_trigger(thd, all_tables, 1);
/* We don't care about trigger body after this point */
delete lex->sphead;
lex->sphead= 0;
res= mysql_create_or_drop_trigger(thd, all_tables, 1);
break;
}
case SQLCOM_DROP_TRIGGER: