List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:March 12 2008 8:07pm
Subject:bk commit into 5.1 tree (anozdrin:1.2562)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of anozdrin.  When anozdrin does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-03-12 23:07:10+03:00, anozdrin@quad. +1 -0
  Fix manual merge.

  sql/sql_delete.cc@stripped, 2008-03-12 23:07:09+03:00, anozdrin@quad. +9 -7
    Fix manual merge.

diff -Nrup a/sql/sql_delete.cc b/sql/sql_delete.cc
--- a/sql/sql_delete.cc	2008-03-12 16:50:23 +03:00
+++ b/sql/sql_delete.cc	2008-03-12 23:07:09 +03:00
@@ -103,10 +103,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *
     /* 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 *
   */
   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 *
 
   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))
Thread
bk commit into 5.1 tree (anozdrin:1.2562)Alexander Nozdrin12 Mar