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

@ -1249,9 +1249,29 @@ bool Table_triggers_list::prepare_record_accessors(TABLE *table)
*trg_fld= 0;
DBUG_ASSERT(null_ptr <= extra_null_bitmap + null_bytes);
bzero(extra_null_bitmap, null_bytes);
if (table->versioned())
{
vers_user_field= (Field **)alloc_root(&table->mem_root,
(table->s->fields - VERSIONING_FIELDS + 1) *
sizeof(Field*));
if (!vers_user_field)
return 1;
Field **dst= vers_user_field;
for (Field **src= record0_field; *src; src++)
{
if ((*src)->vers_sys_field())
continue;
*dst++= *src;
}
*dst= NULL;
}
}
else
{
record0_field= table->field;
vers_user_field= table->vers_user_field;
}
if (has_triggers(TRG_EVENT_UPDATE,TRG_ACTION_BEFORE) ||
has_triggers(TRG_EVENT_UPDATE,TRG_ACTION_AFTER) ||