Skip to content
/ server Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mysql-test/main/delayed.result
Original file line number Diff line number Diff line change
Expand Up @@ -420,3 +420,11 @@ CREATE TABLE t1 (c0 INT,UNIQUE (c0) USING HASH) ENGINE=MYISAM;
INSERT DELAYED INTO t1 VALUES (0);
INSERT DELAYED INTO t1 VALUES (0);
DROP TABLE t1;
#
# MDEV-38726: Assertion `table->default_field != dfield_ptr' failed in
# bool parse_vcol_defs(THD *, MEM_ROOT *, TABLE *, bool *,
# vcol_init_mode)
#
CREATE TABLE t_38726 (a TIMESTAMP ON UPDATE CURRENT_TIMESTAMP()) ENGINE=MYISAM;
INSERT DELAYED INTO t_38726 VALUES ();
DROP TABLE t_38726;
10 changes: 10 additions & 0 deletions mysql-test/main/delayed.test
Original file line number Diff line number Diff line change
Expand Up @@ -632,3 +632,13 @@ INSERT DELAYED INTO t1 VALUES (0);
DROP TABLE t1;

--enable_view_protocol

--echo #
--echo # MDEV-38726: Assertion `table->default_field != dfield_ptr' failed in
--echo # bool parse_vcol_defs(THD *, MEM_ROOT *, TABLE *, bool *,
--echo # vcol_init_mode)
--echo #

CREATE TABLE t_38726 (a TIMESTAMP ON UPDATE CURRENT_TIMESTAMP()) ENGINE=MYISAM;
INSERT DELAYED INTO t_38726 VALUES ();
DROP TABLE t_38726;
16 changes: 15 additions & 1 deletion sql/sql_insert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3132,7 +3132,21 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
(*field)->invisible= (*org_field)->invisible;
(*field)->orig_table= copy; // Remove connection
(*field)->move_field_offset(adjust_ptrs); // Point at copy->record[0]
(*field)->flags|= ((*org_field)->flags & LONG_UNIQUE_HASH_FIELD);

/*
Option 1: Copy all flags from the original field (though I assume there
is some reason we don't want to do this? As it wasn't done
before. I can't find why that is though.)
*/
(*field)->flags|= ((*org_field)->flags);

/*
Option 2: Only copy the missing flag identified by the assert

(*field)->flags|=
((*org_field)->flags & (LONG_UNIQUE_HASH_FIELD | ON_UPDATE_NOW_FLAG));
*/

(*field)->invisible= (*org_field)->invisible;
if (memdup_vcol(client_thd, (*field)->vcol_info))
goto error;
Expand Down