diff options
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index f4af7dae207..3481bf1a2d3 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7741,7 +7741,8 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values, value=v++; Field *rfield= field->field; TABLE* table= rfield->table; - if (rfield == table->next_number_field) + if (table->next_number_field && + rfield->field_index == table->next_number_field->field_index) table->auto_increment_field_not_null= TRUE; if (rfield->vcol_info && value->type() != Item::DEFAULT_VALUE_ITEM && |