diff options
author | Konstantin Osipov <kostja@sun.com> | 2010-06-17 17:31:51 +0400 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2010-06-17 17:31:51 +0400 |
commit | 484351d108b923038421b003f39770d3c96aeae0 (patch) | |
tree | 9413ba739bc0dbf1e647293756a3503f17dcde07 /sql/sql_trigger.cc | |
parent | db0ee68b38a3506e6d6e74a976f2e2b9a6fb1772 (diff) | |
parent | 71377f189fd9d6ac59d66773168cfd2bd75a052a (diff) | |
download | mariadb-git-484351d108b923038421b003f39770d3c96aeae0.tar.gz |
Merge trunk-bugfixing -> trunk-runtime
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r-- | sql/sql_trigger.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index e9330574b34..2f084c369b6 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -681,7 +681,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables, */ old_field= new_field= table->field; - for (trg_field= (Item_trigger_field *)(lex->trg_table_fields.first); + for (trg_field= lex->trg_table_fields.first; trg_field; trg_field= trg_field->next_trg_field) { /* @@ -1326,9 +1326,9 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, thd->variables.sql_mode= (ulong)*trg_sql_mode; - Parser_state parser_state(thd, - trg_create_str->str, - trg_create_str->length); + Parser_state parser_state; + if (parser_state.init(thd, trg_create_str->str, trg_create_str->length)) + goto err_with_lex_cleanup; Trigger_creation_ctx *creation_ctx= Trigger_creation_ctx::create(thd, @@ -1442,7 +1442,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, */ triggers->trigger_fields[lex.trg_chistics.event] [lex.trg_chistics.action_time]= - (Item_trigger_field *)(lex.trg_table_fields.first); + lex.trg_table_fields.first; /* Also let us bind these objects to Field objects in table being opened. @@ -1452,8 +1452,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, SELECT)... Anyway some things can be checked only during trigger execution. */ - for (Item_trigger_field *trg_field= - (Item_trigger_field *)(lex.trg_table_fields.first); + for (Item_trigger_field *trg_field= lex.trg_table_fields.first; trg_field; trg_field= trg_field->next_trg_field) { |