List:Commits« Previous MessageNext Message »
From:Lars Thalmann Date:June 21 2006 11:51am
Subject:bk commit into 5.1 tree (lars:1.2222)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of lthalmann. When lthalmann 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
  1.2222 06/06/21 13:51:28 lars@stripped +2 -0
  Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
  into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge

  sql/sql_insert.cc
    1.204 06/06/21 13:51:07 lars@stripped +0 -0
    Auto merged

  mysql-test/t/disabled.def
    1.168 06/06/21 13:51:07 lars@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	lars
# Host:	dl145j.mysql.com
# Root:	/users/lthalmann/bk/MERGE/mysql-5.1-merge/RESYNC

--- 1.203/sql/sql_insert.cc	2006-06-19 12:14:22 +02:00
+++ 1.204/sql/sql_insert.cc	2006-06-21 13:51:07 +02:00
@@ -1083,16 +1083,19 @@
 	  to convert the latter operation internally to an UPDATE.
           We also should not perform this conversion if we have 
           timestamp field with ON UPDATE which is different from DEFAULT.
+          Another case when conversion should not be performed is when
+          we have ON DELETE trigger on table so user may notice that
+          we cheat here. Note that it is ok to do such conversion for
+          tables which have ON UPDATE but have no ON DELETE triggers,
+          we just should not expose this fact to users by invoking
+          ON UPDATE triggers.
 	*/
 	if (last_uniq_key(table,key_nr) &&
 	    !table->file->referenced_by_foreign_key() &&
             (table->timestamp_field_type == TIMESTAMP_NO_AUTO_SET ||
-             table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH))
+             table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH) &&
+            (!table->triggers || !table->triggers->has_delete_triggers()))
         {
-          if (table->triggers &&
-              table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
-                                                TRG_ACTION_BEFORE, TRUE))
-            goto before_trg_err;
           if (thd->clear_next_insert_id)
           {
             /* Reset auto-increment cacheing if we do an update */
@@ -1103,13 +1106,11 @@
 					        table->record[0])))
             goto err;
           info->deleted++;
-          trg_error= (table->triggers &&
-                      table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
-                                                        TRG_ACTION_AFTER,
-                                                        TRUE));
-          /* Update logfile and count */
-          info->copied++;
-          goto ok_or_after_trg_err;
+          /*
+            Since we pretend that we have done insert we should call
+            its after triggers.
+          */
+          goto after_trg_n_copied_inc;
         }
         else
         {
@@ -1133,10 +1134,6 @@
         }
       }
     }
-    info->copied++;
-    trg_error= (table->triggers &&
-                table->triggers->process_triggers(thd, TRG_EVENT_INSERT,
-                                                  TRG_ACTION_AFTER, TRUE));
     /*
       Restore column maps if they where replaced during an duplicate key
       problem.
@@ -1151,14 +1148,14 @@
 	(error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE))
       goto err;
     table->file->restore_auto_increment();
+    goto ok_or_after_trg_err;
   }
-  else
-  {
-    info->copied++;
-    trg_error= (table->triggers &&
-                table->triggers->process_triggers(thd, TRG_EVENT_INSERT,
-                                                  TRG_ACTION_AFTER, TRUE));
-  }
+
+after_trg_n_copied_inc:
+  info->copied++;
+  trg_error= (table->triggers &&
+              table->triggers->process_triggers(thd, TRG_EVENT_INSERT,
+                                                TRG_ACTION_AFTER, TRUE));
 
 ok_or_after_trg_err:
   if (key)

--- 1.167/mysql-test/t/disabled.def	2006-06-16 02:44:08 +02:00
+++ 1.168/mysql-test/t/disabled.def	2006-06-21 13:51:07 +02:00
@@ -13,9 +13,9 @@
 #events_stress            : BUG#17619 2006-02-21 andrey  Race conditions
 #events                   : BUG#17619 2006-02-21 andrey  Race conditions
 #events_scheduling        : BUG#19170 2006-04-26 andrey  Test case of 19170 fails on some platforms. Has to be checked.
-im_instance_conf          : Bug#20294 2006-06-06 monty   Instance manager test im_instance_conf fails randomly
-im_options                : Bug#20294 2006-06-06 monty   Instance manager test im_instance_conf fails randomly
-im_life_cycle             : Bug#20368 2006-06-10 alik    im_life_cycle test fails
+im_instance_conf         : Bug#20294 2006-06-06 monty   Instance manager test im_instance_conf fails randomly
+im_options               : Bug#20294 2006-06-06 monty   Instance manager test im_instance_conf fails randomly
+im_life_cycle            : Bug#20368 2006-06-10 alik    im_life_cycle test fails
 ndb_autodiscover         : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
 ndb_autodiscover2        : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
 #ndb_binlog_discover      : BUG#19395 2006-04-28 tomas/knielsen mysqld does not always detect cluster shutdown
Thread
bk commit into 5.1 tree (lars:1.2222)Lars Thalmann21 Jun