| 1 |
# |
| 2 |
# MDEV-9690 concurrent queries with virtual columns crash in temporal code |
| 3 |
# |
| 4 |
create table t1 (a datetime, |
| 5 |
# get_datetime_value |
| 6 |
b int as (a > 1), # Arg_comparator |
| 7 |
c int as (a in (1,2,3)), # in_datetime |
| 8 |
d int as ((a,a) in ((1,1),(2,1),(NULL,1))), # cmp_item_datetime |
| 9 |
# other issues |
| 10 |
e int as ((a,1) in ((1,1),(2,1),(NULL,1))) # cmp_item_row::alloc_comparators() |
| 11 |
); |
| 12 |
Warnings: |
| 13 |
Warning 1292 Truncated incorrect datetime value: '1' |
| 14 |
Warning 1292 Truncated incorrect datetime value: '2' |
| 15 |
Warning 1292 Truncated incorrect datetime value: '3' |
| 16 |
show create table t1; |
| 17 |
Table Create Table |
| 18 |
t1 CREATE TABLE `t1` ( |
| 19 |
`a` datetime DEFAULT NULL, |
| 20 |
`b` int(11) GENERATED ALWAYS AS (`a` > 1) VIRTUAL, |
| 21 |
`c` int(11) GENERATED ALWAYS AS (`a` in (1,2,3)) VIRTUAL, |
| 22 |
`d` int(11) GENERATED ALWAYS AS ((`a`,`a`) in ((1,1),(2,1),(NULL,1))) VIRTUAL, |
| 23 |
`e` int(11) GENERATED ALWAYS AS ((`a`,1) in ((1,1),(2,1),(NULL,1))) VIRTUAL |
| 24 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 25 |
Warnings: |
| 26 |
Warning 1292 Truncated incorrect datetime value: '1' |
| 27 |
Warning 1292 Truncated incorrect datetime value: '2' |
| 28 |
Warning 1292 Truncated incorrect datetime value: '3' |
| 29 |
connect con1, localhost, root; |
| 30 |
insert t1 (a) values ('2010-10-10 10:10:10'); |
| 31 |
select * from t1; |
| 32 |
a b c d e |
| 33 |
2010-10-10 10:10:10 1 0 0 NULL |
| 34 |
Warnings: |
| 35 |
Warning 1292 Truncated incorrect datetime value: '1' |
| 36 |
Warning 1292 Truncated incorrect datetime value: '1' |
| 37 |
Warning 1292 Truncated incorrect datetime value: '2' |
| 38 |
Warning 1292 Truncated incorrect datetime value: '1' |
| 39 |
Warning 1292 Truncated incorrect datetime value: '1' |
| 40 |
Warning 1292 Truncated incorrect datetime value: '2' |
| 41 |
disconnect con1; |
| 42 |
connection default; |
| 43 |
select * from t1; |
| 44 |
a b c d e |
| 45 |
2010-10-10 10:10:10 1 0 0 NULL |
| 46 |
drop table t1; |
| 47 |
connect con1, localhost, root; |
| 48 |
create table t1 (a datetime, |
| 49 |
b datetime as (least(a,1)) # Item_func_min_max::get_date |
| 50 |
); |
| 51 |
insert t1 (a) values ('2010-10-10 10:10:10'); |
| 52 |
select * from t1; |
| 53 |
a b |
| 54 |
2010-10-10 10:10:10 0000-00-00 00:00:00 |
| 55 |
Warnings: |
| 56 |
Warning 1292 Truncated incorrect datetime value: '1' |
| 57 |
disconnect con1; |
| 58 |
connection default; |
| 59 |
select * from t1; |
| 60 |
a b |
| 61 |
2010-10-10 10:10:10 0000-00-00 00:00:00 |
| 62 |
Warnings: |
| 63 |
Warning 1292 Truncated incorrect datetime value: '1' |
| 64 |
drop table t1; |
| 65 |
# |
| 66 |
# MDEV-13435 Crash when selecting virtual columns generated using JSON functions |
| 67 |
# |
| 68 |
create table t1 ( |
| 69 |
id int not null , |
| 70 |
js varchar(1000) not null, |
| 71 |
t time AS (cast(json_value(json_extract(js,concat('$.singleDay."', dayname(curdate()),'"')),'$.start') as time)) virtual); |
| 72 |
insert into t1(id,js) values (0, '{"default" : {"start": "00:00:00", "end":"23:59:50"}}'); |
| 73 |
select * from t1; |
| 74 |
id js t |
| 75 |
0 {"default" : {"start": "00:00:00", "end":"23:59:50"}} NULL |
| 76 |
drop table t1; |
| 77 |
# |
| 78 |
# MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob |
| 79 |
# |
| 80 |
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) ))); |
| 81 |
insert ignore into t1 values ('x','x',v2) ; |
| 82 |
Warnings: |
| 83 |
Warning 1906 The value specified for generated column 'v2' in table 't1' has been ignored |
| 84 |
Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`a1` at row 1 |
| 85 |
Warning 1906 The value specified for generated column 'a' in table 't1' has been ignored |
| 86 |
drop table t1; |
| 87 |
# |
| 88 |
# End of 10.2 tests |
| 89 |
# |