[MDEV-31359] No warning is produced on second SELECT for virtual column with arg_comparator Created: 2023-05-29  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Virtual Columns
Affects Version/s: 10.4, 10.5, 10.6, 10.9, 10.10, 11.0, 11.1
Fix Version/s: 10.4, 10.5, 10.6, 11.0, 11.1

Type: Bug Priority: Major
Reporter: Lena Startseva Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-31003 Second execution for ps-protocol Stalled

 Description   

Expected the same behavior for both SELECT in test below, but for virtual column with arg_comparator there is no warning for second SELECT, but for all other there are. (Or perhaps there should be no warnings in the second select at all for all columns)

Testcase:

create table t1 (a datetime,
  # get_datetime_value
  b int as (a > 1),                             # Arg_comparator
  c int as (a in (1,2,3)),                      # in_datetime
  d int as ((a,a) in ((1,1),(2,1),(NULL,1))),   # cmp_item_datetime
  # other issues
  e int as ((a,1) in ((1,1),(2,1),(NULL,1)))    # cmp_item_row::alloc_comparators()
);
 
 
insert t1 (a) values ('2010-10-10 10:10:10');
 
select * from t1;
select * from t1;
 
drop table t1;

Actual result:

select * from t1;
a	b	c	d	e
2010-10-10 10:10:10	1	0	0	NULL
Warnings:
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '2'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '2'
select * from t1;
a	b	c	d	e
2010-10-10 10:10:10	1	0	0	NULL
Warnings:
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '2'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '2'

Expected result:

select * from t1;
a	b	c	d	e
2010-10-10 10:10:10	1	0	0	NULL
Warnings:
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '2'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '2'
select * from t1;
a	b	c	d	e
2010-10-10 10:10:10	1	0	0	NULL
Warnings:
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '2'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '1'
Warning	1292	Truncated incorrect datetime value: '2'


Generated at Thu Feb 08 10:23:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.