Skip to content
Permalink
Browse files
MDEV-23467 SIGSEGV in fill_record/fill_record_n_invoke_before_trigger…
…s 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).
  • Loading branch information
midenok committed Aug 25, 2020
1 parent c277bcd commit 6586bb5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
@@ -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);

0 comments on commit 6586bb5

Please sign in to comment.