[MDEV-24261] Inconsistent result with aggregate function over zerofill column in FROM subquery vs direct query Created: 2020-11-20  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: 11.0-sel, upstream


 Description   

create table t1 (a int unsigned zerofill);
insert into t1 values (1),(2);
select min(a) from t1;
select * from (select min(a) from t1) sq;
 
# Cleanup
drop table t1;

10.5 a16e3c32

select min(a) from t1;
min(a)
1
select * from (select min(a) from t1) sq;
min(a)
0000000001

Whichever result is correct, the other one must be wrong.

Reproducible on all MariaDB 10.x with at least InnoDB, MyISAM, Aria.
Also reproducible on MySQL 5.6, 8.0.


Generated at Thu Feb 08 09:28:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.