1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

SQL: fill_record() field-value inconsistency fix [#365 bug 2]

Affected tests (forced mode): binlog_encryption.encrypted_slave
This commit is contained in:
Aleksey Midenkov
2017-11-28 22:56:01 +03:00
parent 47ea526efa
commit 8d548f8e86
6 changed files with 66 additions and 31 deletions

View File

@ -8088,7 +8088,7 @@ void switch_to_nullable_trigger_fields(List<Item> &items, TABLE *table)
Field** field= table->field_to_fill();
/* True if we have NOT NULL fields and BEFORE triggers */
if (field != table->field && field != table->non_generated_field)
if (field != table->field)
{
List_iterator_fast<Item> it(items);
Item *item;
@ -8278,6 +8278,12 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List<Item> &values,
/* Ensure that all fields are from the same table */
DBUG_ASSERT(field->table == table);
if (table->versioned() && field->vers_sys_field() && !ignore_errors)
{
my_error(ER_VERS_READONLY_FIELD, MYF(0), field->field_name.str);
goto err;
}
value=v++;
if (field->field_index == autoinc_index)
table->auto_increment_field_not_null= TRUE;
@ -8295,13 +8301,6 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List<Item> &values,
}
}
if (table->versioned() && field->vers_sys_field() &&
!ignore_errors)
{
my_error(ER_VERS_READONLY_FIELD, MYF(0), field->field_name.str);
goto err;
}
if (use_value)
value->save_val(field);
else