Commit 054341a6 authored by unknown's avatar unknown

Fix manual merge.

parent b279be38
...@@ -103,10 +103,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ...@@ -103,10 +103,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
/* Error evaluating val_int(). */ /* Error evaluating val_int(). */
DBUG_RETURN(TRUE); 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 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, ...@@ -129,9 +125,9 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
*/ */
if (!using_limit && const_cond_result && if (!using_limit && const_cond_result &&
!(specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) && !(specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) &&
!(triggers_applicable && (thd->lex->sql_command == SQLCOM_TRUNCATE ||
thd->current_stmt_binlog_row_based && (!thd->current_stmt_binlog_row_based &&
table->triggers->has_delete_triggers())) !(table->triggers && table->triggers->has_delete_triggers()))))
{ {
/* Update the table->file->stats.records number */ /* Update the table->file->stats.records number */
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); 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, ...@@ -255,6 +251,12 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
init_ftfuncs(thd, select_lex, 1); init_ftfuncs(thd, select_lex, 1);
thd_proc_info(thd, "updating"); thd_proc_info(thd, "updating");
/* NOTE: TRUNCATE must not invoke triggers. */
triggers_applicable= table->triggers &&
thd->lex->sql_command != SQLCOM_TRUNCATE;
if (triggers_applicable && if (triggers_applicable &&
table->triggers->has_triggers(TRG_EVENT_DELETE, table->triggers->has_triggers(TRG_EVENT_DELETE,
TRG_ACTION_AFTER)) TRG_ACTION_AFTER))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment