Commit 6586bb51 authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-23467 SIGSEGV in fill_record/fill_record_n_invoke_before_triggers on INSERT DELAYED

Field::make_new_field() resets invisible property (needed for "CREATE
.. SELECT" f.ex.).  Recover invisible property in
Delayed_insert::get_local_table() (unireg_check works by the same
principle).
parent c277bcd5
......@@ -617,3 +617,9 @@ a b
1 3
2 4
drop table t1;
#
# MDEV-23467 SIGSEGV in fill_record/fill_record_n_invoke_before_triggers on INSERT DELAYED
#
create table t1 (a int, b int invisible);
insert delayed into t1 values (1);
drop table t1;
......@@ -271,3 +271,11 @@ select a,b from t1;
#cleanup
drop table t1;
--echo #
--echo # MDEV-23467 SIGSEGV in fill_record/fill_record_n_invoke_before_triggers on INSERT DELAYED
--echo #
create table t1 (a int, b int invisible);
insert delayed into t1 values (1);
# cleanup
drop table t1;
......@@ -2614,6 +2614,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
if (!(*field= (*org_field)->make_new_field(client_thd->mem_root, copy, 1)))
goto error;
(*field)->unireg_check= (*org_field)->unireg_check;
(*field)->invisible= (*org_field)->invisible;
(*field)->orig_table= copy; // Remove connection
(*field)->move_field_offset(adjust_ptrs); // Point at copy->record[0]
memdup_vcol(client_thd, (*field)->vcol_info);
......
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