Commit 3e7561cf authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-29357 Assertion (fixed) in Item_func_dayname on INSERT

Restrict vcol_cleanup_expr() in close_thread_tables() to only simple
locked tables mode. Prelocked is cleaned up like normal statement: in
close_thread_table().
parent 14cc7e7d
......@@ -216,3 +216,21 @@ Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
Warning 1292 Truncated incorrect DOUBLE value: 'bar'
drop table t, tmp;
#
# MDEV-29357 Assertion (fixed) in Item_func_dayname on INSERT
#
set sql_mode='';
create table t (c1 blob ,c2 int,c3 char(10) as (dayname (c2)));
create trigger tr before insert on t for each row set new.c2=0;
insert into t values (0, 0, 0);
Warnings:
Warning 1906 The value specified for generated column 'c3' in table 't' has been ignored
Warning 1292 Incorrect datetime value: '0' for column `test`.`t`.`c2` at row 1
Warning 1292 Incorrect datetime value: '0' for column `test`.`t`.`c2` at row 1
insert into t values (1, 1, 1);
Warnings:
Warning 1906 The value specified for generated column 'c3' in table 't' has been ignored
Warning 1292 Incorrect datetime value: '1' for column `test`.`t`.`c2` at row 1
Warning 1292 Incorrect datetime value: '0' for column `test`.`t`.`c2` at row 1
drop trigger tr;
drop table t;
......@@ -173,3 +173,15 @@ select * from t;
# cleanup
drop table t, tmp;
--echo #
--echo # MDEV-29357 Assertion (fixed) in Item_func_dayname on INSERT
--echo #
set sql_mode='';
create table t (c1 blob ,c2 int,c3 char(10) as (dayname (c2)));
create trigger tr before insert on t for each row set new.c2=0;
insert into t values (0, 0, 0);
insert into t values (1, 1, 1);
drop trigger tr;
drop table t;
......@@ -913,7 +913,12 @@ void close_thread_tables(THD *thd)
!thd->stmt_arena->is_stmt_prepare())
table->part_info->vers_check_limit(thd);
#endif
table->vcol_cleanup_expr(thd);
/*
For simple locking we cleanup it here because we don't close thread
tables. For prelocking we close it when we do close thread tables.
*/
if (thd->locked_tables_mode != LTM_PRELOCKED)
table->vcol_cleanup_expr(thd);
}
/* Detach MERGE children after every statement. Even under LOCK TABLES. */
......
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