Commit eedab70c authored by Eugene Kosov's avatar Eugene Kosov Committed by Aleksey Midenkov

MDEV-14871 Server crashes in fill_record /...

MDEV-14871 Server crashes in fill_record / fill_record_n_invoke_before_triggers upon inserting into versioned table with trigger

parent c59c1a07
......@@ -358,4 +358,10 @@ a
select * from t1 for system_time as of sysdate(6);
a
1
#
# MDEV-14871 Server crashes in fill_record / fill_record_n_invoke_before_triggers upon inserting into versioned table with trigger
#
create or replace table t1 (pk int primary key) with system versioning;
create trigger tr before insert on t1 for each row select 1 into @a;
insert into t1 values (1),(2);
drop table t1;
......@@ -251,4 +251,12 @@ create table t1 (a int) with system versioning;
insert t1 values (1);
select * from t1 for system_time as of now(6);
select * from t1 for system_time as of sysdate(6);
--echo #
--echo # MDEV-14871 Server crashes in fill_record / fill_record_n_invoke_before_triggers upon inserting into versioned table with trigger
--echo #
create or replace table t1 (pk int primary key) with system versioning;
create trigger tr before insert on t1 for each row select 1 into @a;
insert into t1 values (1),(2);
drop table t1;
......@@ -1228,7 +1228,7 @@ bool Table_triggers_list::prepare_record_accessors(TABLE *table)
uchar null_bit= 1;
for (fld= table->field, trg_fld= record0_field; *fld; fld++, trg_fld++)
{
if (!(*fld)->null_ptr && !(*fld)->vcol_info)
if (!(*fld)->null_ptr && !(*fld)->vcol_info && !(*fld)->vers_sys_field())
{
Field *f;
if (!(f= *trg_fld= (*fld)->make_new_field(&table->mem_root, table,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment