summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 43368fe5433..32b60a801ad 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2245,7 +2245,11 @@ fill_record(List<Item> &fields,List<Item> &values, bool ignore_errors)
while ((field=(Item_field*) f++))
{
value=v++;
- if (value->save_in_field(field->field, 0) > 0 && !ignore_errors)
+ Field *rfield= field->field;
+ TABLE *table= rfield->table;
+ if (rfield==table->next_number_field)
+ table->auto_increment_field_is_null= false;
+ if (value->save_in_field(rfield, 0) > 0 && !ignore_errors)
DBUG_RETURN(1);
}
DBUG_RETURN(0);
@@ -2263,6 +2267,9 @@ fill_record(Field **ptr,List<Item> &values, bool ignore_errors)
while ((field = *ptr++))
{
value=v++;
+ TABLE *table= field->table;
+ if (field==table->next_number_field)
+ table->auto_increment_field_is_null= false;
if (value->save_in_field(field, 0) == 1 && !ignore_errors)
DBUG_RETURN(1);
}