[Commits] e722b16: last changes after first review

Oleksandr Byelkin sanja at mariadb.com
Mon Oct 24 23:01:13 EEST 2016


revision-id: e722b1662d3b29ffb015502723ea948cf5c2450a (mariadb-10.2.2-53-ge722b16)
parent(s): 42dee2037709eae5bff43af727c6fff9e4438f08
committer: Oleksandr Byelkin
timestamp: 2016-10-24 22:01:13 +0200
message:

last changes after first review

---
 sql/item.cc       |  1 -
 sql/item.h        |  7 +++----
 sql/sql_insert.cc | 10 +++++-----
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/sql/item.cc b/sql/item.cc
index 217f1cc..56d0b04 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -4159,7 +4159,6 @@ bool Item_param::append_for_log(THD *thd, String *str)
   return str->append(*val);
 }
 
-
 /****************************************************************************
   Item_copy
 ****************************************************************************/
diff --git a/sql/item.h b/sql/item.h
index c932d7d..f3736a4 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -5091,19 +5091,18 @@ class Item_default_value : public Item_field
   void calculate();
 public:
   Item *arg;
-  Field *arg_fld;
   Item_default_value(THD *thd, Name_resolution_context *context_arg)
     :Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL,
                (const char *)NULL),
-     arg(NULL), arg_fld(NULL) {}
+     arg(NULL) {}
   Item_default_value(THD *thd, Name_resolution_context *context_arg, Item *a)
     :Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL,
                 (const char *)NULL),
-     arg(a), arg_fld(NULL) {}
+     arg(a) {}
   Item_default_value(THD *thd, Name_resolution_context *context_arg, Field *a)
     :Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL,
                 (const char *)NULL),
-     arg(NULL), arg_fld(a) {}
+     arg(NULL) {}
   enum Type type() const { return DEFAULT_VALUE_ITEM; }
   bool eq(const Item *item, bool binary_cmp) const;
   bool fix_fields(THD *, Item **);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 2fff06e..432f8b6 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -662,6 +662,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
   bool using_bulk_insert= 0;
   uint value_count;
   ulong counter = 1;
+  ulong iteration= 0;
   ulonglong id;
   ulong bulk_iterations= bulk_parameters_iterations(thd);
   COPY_INFO info;
@@ -890,9 +891,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
       goto values_loop_end;
     }
   }
-  for (ulong iteration= 0; iteration < bulk_iterations; iteration++)
+  do
   {
-
     if (iteration && bulk_parameters_set(thd))
       goto abort;
 
@@ -951,7 +951,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
           /* Fix undefined null_bits. */
           if (share->null_bytes > 1 && share->last_null_bit_pos)
           {
-            table->record[0][share->null_bytes - 1]= 
+            table->record[0][share->null_bytes - 1]=
               share->default_values[share->null_bytes - 1];
           }
         }
@@ -997,7 +997,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
       thd->get_stmt_da()->inc_current_row_for_warning();
     }
     its.rewind();
-  }
+    iteration++;
+  } while (iteration < bulk_iterations);
 
 values_loop_end:
   free_underlaid_joins(thd, &thd->lex->select_lex);
@@ -1458,7 +1459,6 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
   /* Prepare the fields in the statement. */
   if (values)
   {
-
     /* if we have INSERT ... VALUES () we cannot have a GROUP BY clause */
     DBUG_ASSERT (!select_lex->group_list.elements);
 


More information about the commits mailing list