Debian Codegraph @

mysql-test/suite/vcol/t/wrong_arena.test

raw
1 #
2 # This tests various issues when vcol items allocate memory (e.g. more items)
3 # not in the TABLE::expr_arena.
4 #
5
6 --echo #
7 --echo # MDEV-9690 concurrent queries with virtual columns crash in temporal code
8 --echo #
9 create table t1 (a datetime,
10 # get_datetime_value
11 b int as (a > 1), # Arg_comparator
12 c int as (a in (1,2,3)), # in_datetime
13 d int as ((a,a) in ((1,1),(2,1),(NULL,1))), # cmp_item_datetime
14 # other issues
15 e int as ((a,1) in ((1,1),(2,1),(NULL,1))) # cmp_item_row::alloc_comparators()
16 );
17 enable_prepare_warnings;
18 show create table t1;
19 disable_prepare_warnings;
20 connect con1, localhost, root;
21 disable_warnings;
22 insert t1 (a) values ('2010-10-10 10:10:10');
23 enable_warnings;
24 #Enable after fix MDEV-31359
25 --disable_ps2_protocol
26 select * from t1;
27 --enable_ps2_protocol
28 disconnect con1;
29 connection default;
30 disable_warnings;
31 select * from t1;
32 enable_warnings;
33 drop table t1;
34
35 connect con1, localhost, root;
36 create table t1 (a datetime,
37 b datetime as (least(a,1)) # Item_func_min_max::get_date
38 );
39 insert t1 (a) values ('2010-10-10 10:10:10');
40 select * from t1;
41 disconnect con1;
42 connection default;
43 select * from t1;
44 drop table t1;
45
46 --echo #
47 --echo # MDEV-13435 Crash when selecting virtual columns generated using JSON functions
48 --echo #
49 create table t1 (
50 id int not null ,
51 js varchar(1000) not null,
52 t time AS (cast(json_value(json_extract(js,concat('$.singleDay."', dayname(curdate()),'"')),'$.start') as time)) virtual);
53 insert into t1(id,js) values (0, '{"default" : {"start": "00:00:00", "end":"23:59:50"}}');
54 select * from t1;
55 drop table t1;
56
57 --echo #
58 --echo # MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob
59 --echo #
60 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) )));
61 insert ignore into t1 values ('x','x',v2) ;
62 drop table t1;
63
64 --echo #
65 --echo # End of 10.2 tests
66 --echo #