From 4681b6f2d8c82b4ec5cf115e83698251963d80d5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 14 Apr 2022 21:45:20 +0200 Subject: MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob the bug was that in_vector array in Item_func_in was allocated in the statement arena, not in the table->expr_arena. revert part of the 5acd391e8b2d. Instead, change the arena correctly in fix_all_session_vcol_exprs(). Remove TABLE_ARENA, that was introduced in 5acd391e8b2d to force item tree changes to be rolled back (because they were allocated in the wrong arena and didn't persist. now they do) --- mysql-test/suite/vcol/t/wrong_arena.test | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'mysql-test/suite/vcol/t') diff --git a/mysql-test/suite/vcol/t/wrong_arena.test b/mysql-test/suite/vcol/t/wrong_arena.test index 8ac1af5c36b..296cb68f5c0 100644 --- a/mysql-test/suite/vcol/t/wrong_arena.test +++ b/mysql-test/suite/vcol/t/wrong_arena.test @@ -3,9 +3,9 @@ # not in the TABLE::expr_arena. # -# -# MDEV-9690 concurrent queries with virtual columns crash in temporal code -# +--echo # +--echo # MDEV-9690 concurrent queries with virtual columns crash in temporal code +--echo # create table t1 (a datetime, # get_datetime_value b int as (a > 1), # Arg_comparator @@ -40,9 +40,9 @@ connection default; select * from t1; drop table t1; -# -# MDEV-13435 Crash when selecting virtual columns generated using JSON functions -# +--echo # +--echo # MDEV-13435 Crash when selecting virtual columns generated using JSON functions +--echo # create table t1 ( id int not null , js varchar(1000) not null, @@ -50,3 +50,14 @@ create table t1 ( insert into t1(id,js) values (0, '{"default" : {"start": "00:00:00", "end":"23:59:50"}}'); select * from t1; drop table t1; + +--echo # +--echo # MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob +--echo # +create table t1 (v2 blob as ('a' is null), a1 int, a char(1) as (cast(a1 in (0,current_user() is null) as char(16777216) ))); +insert ignore into t1 values ('x','x',v2) ; +drop table t1; + +--echo # +--echo # End of 10.2 tests +--echo # -- cgit v1.2.1 From a59f483c06b12e606747da3f864ed94615f038c0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 Apr 2022 11:40:15 +0200 Subject: MDEV-28092 MariaDB SEGV issue add test --- mysql-test/suite/vcol/t/vcol_misc.test | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test/suite/vcol/t') diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index 07f96f4e0b8..821dd418e64 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -488,6 +488,14 @@ SELECT * FROM t1; DROP TABLE t1; SET sql_mode=DEFAULT; +# +# MDEV-28092 MariaDB SEGV issue +# +create table t1 (b timestamp, a int as (1 in (dayofmonth (b between 'x' and current_user) = b))); +insert into t1(b) values ('2022-03-17 14:55:37'); +select 1 from t1 x natural join t1; +drop table t1; + --echo # --echo # End of 10.2 tests --echo # -- cgit v1.2.1 From 9c5fd0f624df846686742182825d964c546fac58 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 Apr 2022 11:53:44 +0200 Subject: vcols: cannot use CONTEXT_ANALYSIS_ONLY_VCOL_EXPR on fix_fields because CONTEXT_ANALYSIS_ONLY_VCOL_EXPR can be used only for, exactly, context analysys. Items fixed that way cannot be evaluated. But vcols are going to be evaluated, so they have to be fixed properly, for evaluation. --- mysql-test/suite/vcol/t/vcol_misc.opt | 1 + mysql-test/suite/vcol/t/vcol_misc.test | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 mysql-test/suite/vcol/t/vcol_misc.opt (limited to 'mysql-test/suite/vcol/t') diff --git a/mysql-test/suite/vcol/t/vcol_misc.opt b/mysql-test/suite/vcol/t/vcol_misc.opt new file mode 100644 index 00000000000..fd1faea4f8e --- /dev/null +++ b/mysql-test/suite/vcol/t/vcol_misc.opt @@ -0,0 +1 @@ +--character-sets-dir=$MYSQL_TEST_DIR/std_data/ldml/ diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index 821dd418e64..b37b9e8f3d5 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -496,6 +496,21 @@ insert into t1(b) values ('2022-03-17 14:55:37'); select 1 from t1 x natural join t1; drop table t1; +--echo # +--echo # CONTEXT_ANALYSIS_ONLY_VCOL_EXPR +--echo # + +--source include/have_ucs2.inc +create table t1 (c1 char(1) character set ucs2 collate ucs2_test_ci, + v1 char(1) character set ucs2 collate ucs2_test_ci as (c1), + v2 int as (c1 = 'b'), + v3 int as (v1 = 'b')); +insert into t1 (c1) values ('a'); +select * from t1 where v1 = 'b'; +show create table t1; +drop table t1; + --echo # --echo # End of 10.2 tests --echo # + -- cgit v1.2.1