List:Commits« Previous MessageNext Message »
From:Mats Kindahl Date:July 12 2006 8:06am
Subject:bk commit into 5.0 tree (mkindahl:1.2232)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of mkindahl. When mkindahl 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, 2006-07-12 10:05:55+02:00, mkindahl@stripped +9 -0
  Merge dl145k.mysql.com:/data0/mkindahl/bkroot/mysql-5.0
  into  dl145k.mysql.com:/data0/mkindahl/bk/mysql-5.0-rpl
  MERGE: 1.2183.28.6

  ndb/include/kernel/GlobalSignalNumbers.h@stripped, 2006-07-12 10:05:50+02:00, mkindahl@stripped +0 -0
    Auto merged
    MERGE: 1.11.1.2

  ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2006-07-12 10:05:50+02:00, mkindahl@stripped +0 -0
    Auto merged
    MERGE: 1.63.1.1

  ndb/src/kernel/blocks/dbdict/Dbdict.hpp@stripped, 2006-07-12 10:05:50+02:00, mkindahl@stripped +0 -0
    Auto merged
    MERGE: 1.18.1.1

  ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2006-07-12 10:05:50+02:00, mkindahl@stripped +0 -0
    Auto merged
    MERGE: 1.51.1.2

  ndb/src/ndbapi/ndberror.c@stripped, 2006-07-12 10:05:50+02:00, mkindahl@stripped +0 -0
    Auto merged
    MERGE: 1.44.1.1

  sql/ha_ndbcluster.cc@stripped, 2006-07-12 10:05:50+02:00, mkindahl@stripped +0 -0
    Auto merged
    MERGE: 1.261.1.3

  sql/handler.h@stripped, 2006-07-12 10:05:50+02:00, mkindahl@stripped +0 -0
    Auto merged
    MERGE: 1.171.2.1

  sql/sql_base.cc@stripped, 2006-07-12 10:05:50+02:00, mkindahl@stripped +0 -0
    Auto merged
    MERGE: 1.341.2.1

  sql/sql_insert.cc@stripped, 2006-07-12 10:05:51+02:00, mkindahl@stripped +0 -0
    Auto merged
    MERGE: 1.192.3.1

# 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:	mkindahl
# Host:	dl145k.mysql.com
# Root:	/data0/mkindahl/bk/mysql-5.0-rpl/RESYNC

--- 1.175/sql/handler.h	2006-07-12 10:06:02 +02:00
+++ 1.176/sql/handler.h	2006-07-12 10:06:02 +02:00
@@ -564,6 +564,7 @@
     {}
   virtual ~handler(void) { /* TODO: DBUG_ASSERT(inited == NONE); */ }
   int ha_open(const char *name, int mode, int test_if_locked);
+  void adjust_next_insert_id_after_explicit_value(ulonglong nr);
   bool update_auto_increment();
   virtual void print_error(int error, myf errflag);
   virtual bool get_error_message(int error, String *buf);

--- 1.343/sql/sql_base.cc	2006-07-12 10:06:02 +02:00
+++ 1.344/sql/sql_base.cc	2006-07-12 10:06:02 +02:00
@@ -624,8 +624,10 @@
 
   if (!mysql_bin_log.is_open())
   {
-    for (table= thd->temporary_tables; table; table= table->next)
+    TABLE *next;
+    for (table= thd->temporary_tables; table; table= next)
     {
+      next= table->next;
       close_temporary(table, 1);
     }
     thd->temporary_tables= 0;
@@ -648,7 +650,6 @@
      insertion sort of temp tables by pseudo_thread_id to build ordered list
      of sublists of equal pseudo_thread_id
   */
-
   for (prev_table= thd->temporary_tables, table= prev_table->next;
        table;
        prev_table= table, table= table->next)

--- 1.196/sql/sql_insert.cc	2006-07-12 10:06:02 +02:00
+++ 1.197/sql/sql_insert.cc	2006-07-12 10:06:02 +02:00
@@ -1035,7 +1035,6 @@
       uint key_nr;
       if (error != HA_WRITE_SKIP)
 	goto err;
-      table->file->restore_auto_increment();
       if ((int) (key_nr = table->file->get_dup_key(error)) < 0)
       {
 	error=HA_WRITE_SKIP;			/* Database can't find key */
@@ -1108,20 +1107,20 @@
         if (res == VIEW_CHECK_ERROR)
           goto before_trg_err;
 
-        if (thd->clear_next_insert_id)
-        {
-          /* Reset auto-increment cacheing if we do an update */
-          thd->clear_next_insert_id= 0;
-          thd->next_insert_id= 0;
-        }
         if ((error=table->file->update_row(table->record[1],table->record[0])))
 	{
 	  if ((error == HA_ERR_FOUND_DUPP_KEY) && info->ignore)
+          {
+            table->file->restore_auto_increment();
             goto ok_or_after_trg_err;
+          }
           goto err;
 	}
         info->updated++;
 
+        if (table->next_number_field)
+          table->file->adjust_next_insert_id_after_explicit_value(table->next_number_field->val_int());
+
         trg_error= (table->triggers &&
                     table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
                                                       TRG_ACTION_AFTER, TRUE));
@@ -1150,12 +1149,6 @@
              table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH) &&
             (!table->triggers || !table->triggers->has_delete_triggers()))
         {
-          if (thd->clear_next_insert_id)
-          {
-            /* Reset auto-increment cacheing if we do an update */
-            thd->clear_next_insert_id= 0;
-            thd->next_insert_id= 0;
-          }
           if ((error=table->file->update_row(table->record[1],
 					     table->record[0])))
             goto err;
@@ -1219,6 +1212,7 @@
   table->file->print_error(error,MYF(0));
 
 before_trg_err:
+  table->file->restore_auto_increment();
   if (key)
     my_safe_afree(key, table->s->max_unique_length, MAX_KEY_LENGTH);
   DBUG_RETURN(1);
Thread
bk commit into 5.0 tree (mkindahl:1.2232)Mats Kindahl12 Jul