List:Commits« Previous MessageNext Message »
From:mhansson Date:June 27 2007 12:02pm
Subject:bk commit into 5.0 tree (mhansson:1.2506)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of mhansson. When mhansson 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, 2007-06-27 14:02:32+02:00, mhansson@stripped +3 -0
  Merge mhansson@stripped:/home/bk/mysql-5.0-opt
  into  dl145s.mysql.com:/dev/shm/mhansson/my50-bug28677
  MERGE: 1.2469.53.1

  sql/sql_class.h@stripped, 2007-06-27 14:02:27+02:00, mhansson@stripped +0 -0
    Auto merged
    MERGE: 1.331.2.1

  sql/sql_insert.cc@stripped, 2007-06-27 14:02:28+02:00, mhansson@stripped +0 -0
    Auto merged
    MERGE: 1.237.1.1

  sql/sql_select.cc@stripped, 2007-06-27 14:02:28+02:00, mhansson@stripped +0 -0
    Auto merged
    MERGE: 1.521.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:	mhansson
# Host:	dl145s.mysql.com
# Root:	/dev/shm/mhansson/my50-bug28677/RESYNC

--- 1.335/sql/sql_class.h	2007-06-09 14:46:08 +02:00
+++ 1.336/sql/sql_class.h	2007-06-27 14:02:27 +02:00
@@ -1959,6 +1959,7 @@ class select_insert :public select_resul
   virtual void store_values(List<Item> &values);
   void send_error(uint errcode,const char *err);
   bool send_eof();
+  void abort();
   /* not implemented: select_insert is never re-used in prepared statements */
   void cleanup();
 };

--- 1.241/sql/sql_insert.cc	2007-06-11 23:41:09 +02:00
+++ 1.242/sql/sql_insert.cc	2007-06-27 14:02:28 +02:00
@@ -2892,41 +2892,6 @@ void select_insert::send_error(uint errc
 
   my_message(errcode, err, MYF(0));
 
-  if (!table)
-  {
-    /*
-      This can only happen when using CREATE ... SELECT and the table was not
-      created becasue of an syntax error
-    */
-    DBUG_VOID_RETURN;
-  }
-  if (!thd->prelocked_mode)
-    table->file->end_bulk_insert();
-  /*
-    If at least one row has been inserted/modified and will stay in the table
-    (the table doesn't have transactions) (example: we got a duplicate key
-    error while inserting into a MyISAM table) we must write to the binlog (and
-    the error code will make the slave stop).
-  */
-  if ((info.copied || info.deleted || info.updated) &&
-      !table->file->has_transactions())
-  {
-    if (last_insert_id)
-      thd->insert_id(last_insert_id);		// For binary log
-    if (mysql_bin_log.is_open())
-    {
-      Query_log_event qinfo(thd, thd->query, thd->query_length,
-                            table->file->has_transactions(), FALSE);
-      mysql_bin_log.write(&qinfo);
-    }
-    if (!table->s->tmp_table)
-      thd->no_trans_update.all= TRUE;
-  }
-  if (info.copied || info.deleted || info.updated)
-  {
-    query_cache_invalidate3(thd, table, 1);
-  }
-  ha_rollback_stmt(thd);
   DBUG_VOID_RETURN;
 }
 
@@ -2984,6 +2949,49 @@ bool select_insert::send_eof()
   DBUG_RETURN(0);
 }
 
+void select_insert::abort()
+{
+  DBUG_ENTER("select_insert::abort");
+
+  if (!table)
+  {
+    /*
+      This can only happen when using CREATE ... SELECT and the table was not
+      created becasue of an syntax error
+    */
+    DBUG_VOID_RETURN;
+  }
+  if (!thd->prelocked_mode)
+    table->file->end_bulk_insert();
+  /*
+    If at least one row has been inserted/modified and will stay in the table
+    (the table doesn't have transactions) (example: we got a duplicate key
+    error while inserting into a MyISAM table) we must write to the binlog (and
+    the error code will make the slave stop).
+  */
+  if ((info.copied || info.deleted || info.updated) &&
+      !table->file->has_transactions())
+  {
+    if (last_insert_id)
+      thd->insert_id(last_insert_id);		// For binary log
+    if (mysql_bin_log.is_open())
+    {
+      Query_log_event qinfo(thd, thd->query, thd->query_length,
+                            table->file->has_transactions(), FALSE);
+      mysql_bin_log.write(&qinfo);
+    }
+    if (!table->s->tmp_table)
+      thd->no_trans_update.all= TRUE;
+  }
+  if (info.copied || info.deleted || info.updated)
+  {
+    query_cache_invalidate3(thd, table, 1);
+  }
+  ha_rollback_stmt(thd);
+
+  DBUG_VOID_RETURN;
+
+}
 
 /***************************************************************************
   CREATE TABLE (SELECT) ...
@@ -3241,13 +3249,7 @@ void select_create::store_values(List<It
 
 void select_create::send_error(uint errcode,const char *err)
 {
-  /*
-   Disable binlog, because we "roll back" partial inserts in ::abort
-   by removing the table, even for non-transactional tables.
-  */
-  tmp_disable_binlog(thd);
   select_insert::send_error(errcode, err);
-  reenable_binlog(thd);
 }
 
 
@@ -3272,6 +3274,14 @@ bool select_create::send_eof()
 
 void select_create::abort()
 {
+  /*
+   Disable binlog, because we "roll back" partial inserts in ::abort
+   by removing the table, even for non-transactional tables.
+  */
+  tmp_disable_binlog(thd);
+  select_insert::abort();
+  reenable_binlog(thd);
+
   if (lock)
   {
     mysql_unlock_tables(thd, lock);

--- 1.535/sql/sql_select.cc	2007-06-24 19:50:20 +02:00
+++ 1.536/sql/sql_select.cc	2007-06-27 14:02:28 +02:00
@@ -258,11 +258,8 @@ bool handle_select(THD *thd, LEX *lex, s
 		     thd->net.report_error));
   res|= thd->net.report_error;
   if (unlikely(res))
-  {
-    /* If we had a another error reported earlier then this will be ignored */
-    result->send_error(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR));
     result->abort();
-  }
+
   DBUG_RETURN(res);
 }
 
Thread
bk commit into 5.0 tree (mhansson:1.2506)mhansson27 Jun