diff options
author | unknown <anozdrin/alik@quad.> | 2008-03-12 23:07:10 +0300 |
---|---|---|
committer | unknown <anozdrin/alik@quad.> | 2008-03-12 23:07:10 +0300 |
commit | 054341a6d07110dac1d05f023abd98bf7eaad39e (patch) | |
tree | bb5616c40ceba36a1679965461d05565da72fc44 /sql/sql_delete.cc | |
parent | b279be388e1d8208396ada701d3015b9d7cbbc4c (diff) | |
download | mariadb-git-054341a6d07110dac1d05f023abd98bf7eaad39e.tar.gz |
Fix manual merge.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 7c3a046cb20..b9a7cd12662 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -103,10 +103,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, /* Error evaluating val_int(). */ DBUG_RETURN(TRUE); } - /* NOTE: TRUNCATE must not invoke triggers. */ - - triggers_applicable= table->triggers && - thd->lex->sql_command != SQLCOM_TRUNCATE; /* Test if the user wants to delete all rows and deletion doesn't have @@ -129,9 +125,9 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, */ if (!using_limit && const_cond_result && !(specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) && - !(triggers_applicable && - thd->current_stmt_binlog_row_based && - table->triggers->has_delete_triggers())) + (thd->lex->sql_command == SQLCOM_TRUNCATE || + (!thd->current_stmt_binlog_row_based && + !(table->triggers && table->triggers->has_delete_triggers())))) { /* Update the table->file->stats.records number */ table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); @@ -255,6 +251,12 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, init_ftfuncs(thd, select_lex, 1); thd_proc_info(thd, "updating"); + + /* NOTE: TRUNCATE must not invoke triggers. */ + + triggers_applicable= table->triggers && + thd->lex->sql_command != SQLCOM_TRUNCATE; + if (triggers_applicable && table->triggers->has_triggers(TRG_EVENT_DELETE, TRG_ACTION_AFTER)) |