List:Commits« Previous MessageNext Message »
From:kroki Date:October 2 2006 1:00pm
Subject:bk commit into 5.0 tree (kroki:1.2289)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tomash. When tomash 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-10-02 17:00:39+04:00, kroki@stripped +2 -0
  Merge bk-internal.mysql.com:/home/bk/mysql-5.0
  into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-real-bug21726
  MERGE: 1.2276.1.17

  sql/sql_insert.cc@stripped, 2006-10-02 17:00:35+04:00, kroki@stripped +0 -0
    Auto merged
    MERGE: 1.202.1.1

  sql/sql_select.cc@stripped, 2006-10-02 17:00:35+04:00, kroki@stripped +0 -0
    Auto merged
    MERGE: 1.458.1.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:	kroki
# Host:	moonlight.intranet
# Root:	/home/tomash/src/mysql_ab/mysql-5.0-real-bug21726/RESYNC

--- 1.203/sql/sql_insert.cc	2006-10-02 17:00:46 +04:00
+++ 1.204/sql/sql_insert.cc	2006-10-02 17:00:46 +04:00
@@ -590,10 +590,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *t
 #endif
       error=write_record(thd, table ,&info);
     /*
-      If auto_increment values are used, save the first one
-       for LAST_INSERT_ID() and for the update log.
-       We can't use insert_id() as we don't want to touch the
-       last_insert_id_used flag.
+      If auto_increment values are used, save the first one for
+      LAST_INSERT_ID() and for the update log.
     */
     if (! id && thd->insert_id_used)
     {						// Get auto increment value
@@ -2493,7 +2491,7 @@ bool select_insert::send_data(List<Item>
       */
       table->next_number_field->reset();
       if (!last_insert_id && thd->insert_id_used)
-        last_insert_id= thd->insert_id();
+        last_insert_id= thd->last_insert_id;
     }
   }
   DBUG_RETURN(error);

--- 1.459/sql/sql_select.cc	2006-10-02 17:00:46 +04:00
+++ 1.460/sql/sql_select.cc	2006-10-02 17:00:46 +04:00
@@ -8142,7 +8142,7 @@ remove_eq_conds(THD *thd, COND *cond, It
       Field *field=((Item_field*) args[0])->field;
       if (field->flags & AUTO_INCREMENT_FLAG && !field->table->maybe_null &&
 	  (thd->options & OPTION_AUTO_IS_NULL) &&
-	  thd->insert_id() && thd->substitute_null_with_insert_id)
+          thd->current_insert_id && thd->substitute_null_with_insert_id)
       {
 #ifdef HAVE_QUERY_CACHE
 	query_cache_abort(&thd->net);
@@ -8150,9 +8150,16 @@ remove_eq_conds(THD *thd, COND *cond, It
 	COND *new_cond;
 	if ((new_cond= new Item_func_eq(args[0],
 					new Item_int("last_insert_id()",
-						     thd->insert_id(),
+						     thd->current_insert_id,
 						     21))))
 	{
+          /*
+            Set THD::last_insert_id_used manually, as this statement
+            uses LAST_INSERT_ID() in a sense, and should issue
+            LAST_INSERT_ID_EVENT.
+          */
+          thd->last_insert_id_used= TRUE;
+
 	  cond=new_cond;
           /*
             Item_func_eq can't be fixed after creation so we do not check
Thread
bk commit into 5.0 tree (kroki:1.2289)kroki2 Oct