List:Commits« Previous MessageNext Message »
From:eugene Date:November 2 2007 6:48pm
Subject:bk commit into 5.0 tree (evgen:1.2549) BUG#30384
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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-11-02 17:48:14+00:00, evgen@stripped +2 -0
  Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
  led to creating corrupted index.
  
  Corrected fix. The new method called prepare2 is added to the select_create
  class. As all preparetions are done by the select_create::prepare function
  it doesn't do anything.
  The is_bulk_insert_mode flag is removed as it is not needed anymore.

  sql/sql_class.h@stripped, 2007-11-02 17:46:58+00:00, evgen@stripped +2 -2
    Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
    led to creating corrupted index.
    Corrected fix. The new method called prepare2 is added to the select_create
    class. As all preparetions are done by the select_create::prepare function
    it doesn't do anything.
    The is_bulk_insert_mode flag is removed as it is not needed anymore.

  sql/sql_insert.cc@stripped, 2007-11-02 17:46:18+00:00, evgen@stripped +2 -10
    Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
    led to creating corrupted index.
    Corrected fix. The is_bulk_insert_mode flag is removed as it is not needed
    anymore.

diff -Nrup a/sql/sql_class.h b/sql/sql_class.h
--- a/sql/sql_class.h	2007-09-21 08:06:30 +00:00
+++ b/sql/sql_class.h	2007-11-02 17:46:58 +00:00
@@ -2029,14 +2029,13 @@ class select_insert :public select_resul
   ulonglong last_insert_id;
   COPY_INFO info;
   bool insert_into_view;
-  bool is_bulk_insert_mode;
   select_insert(TABLE_LIST *table_list_par,
 		TABLE *table_par, List<Item> *fields_par,
 		List<Item> *update_fields, List<Item> *update_values,
 		enum_duplicates duplic, bool ignore);
   ~select_insert();
   int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
-  int prepare2(void);
+  virtual int prepare2(void);
   bool send_data(List<Item> &items);
   virtual void store_values(List<Item> &values);
   void send_error(uint errcode,const char *err);
@@ -2071,6 +2070,7 @@ public:
   void send_error(uint errcode,const char *err);
   bool send_eof();
   void abort();
+  int prepare2(void) { return 0; }
 };
 
 #include <myisam.h>
diff -Nrup a/sql/sql_insert.cc b/sql/sql_insert.cc
--- a/sql/sql_insert.cc	2007-09-27 09:17:13 +00:00
+++ b/sql/sql_insert.cc	2007-11-02 17:46:18 +00:00
@@ -2645,8 +2645,7 @@ select_insert::select_insert(TABLE_LIST 
                              bool ignore_check_option_errors)
   :table_list(table_list_par), table(table_par), fields(fields_par),
    last_insert_id(0),
-   insert_into_view(table_list_par && table_list_par->view != 0),
-   is_bulk_insert_mode(FALSE)
+   insert_into_view(table_list_par && table_list_par->view != 0)
 {
   bzero((char*) &info,sizeof(info));
   info.handle_duplicates= duplic;
@@ -2831,11 +2830,8 @@ int select_insert::prepare2(void)
 {
   DBUG_ENTER("select_insert::prepare2");
   if (thd->lex->current_select->options & OPTION_BUFFER_RESULT &&
-      !thd->prelocked_mode && !is_bulk_insert_mode)
-  {
+      !thd->prelocked_mode)
     table->file->start_bulk_insert((ha_rows) 0);
-    is_bulk_insert_mode= TRUE;
-  }
   DBUG_RETURN(0);
 }
 
@@ -2941,7 +2937,6 @@ bool select_insert::send_eof()
   DBUG_ENTER("select_insert::send_eof");
 
   error= (!thd->prelocked_mode) ? table->file->end_bulk_insert():0;
-  is_bulk_insert_mode= FALSE;
   table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
   table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
 
@@ -3277,10 +3272,7 @@ select_create::prepare(List<Item> &value
   if (info.handle_duplicates == DUP_UPDATE)
     table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
   if (!thd->prelocked_mode)
-  {
     table->file->start_bulk_insert((ha_rows) 0);
-    is_bulk_insert_mode= TRUE;
-  }
   thd->abort_on_warning= (!info.ignore &&
                           (thd->variables.sql_mode &
                            (MODE_STRICT_TRANS_TABLES |
Thread
bk commit into 5.0 tree (evgen:1.2549) BUG#30384eugene2 Nov
  • Re: bk commit into 5.0 tree (evgen:1.2549) BUG#30384Sergei Golubchik5 Nov