[MDEV-25453] Wrong result upon JOIN with constant CSV table Created: 2021-04-19  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 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-fixed

Issue Links:
Relates
relates to MDEV-6768 Wrong result with aggregate with join... Closed

 Description   

create table t1 (a int not null) engine=CSV;
create table t2 (b int) engine=MyISAM;
insert into t2 values (1);
select count(*), b from t2 join t1; 
 
# Cleanup
drop table t1, t2;

10.5 0ba845a8

MariaDB [test]> select count(*), b from t2 join t1; 
+----------+------+
| count(*) | b    |
+----------+------+
|        0 |    1 |
+----------+------+
1 row in set (0.002 sec)
{code:sql}
 
The expected result is (0,NULL), as without the aggregate function the result set is naturally empty:
{code:sql}
MariaDB [test]> select * from t2 join t1; 
Empty set (0.001 sec)

Reproducible on 10.2-10.6 (possibly earlier versions too), and on MySQL 5.7.
Not reproducible on MySQL 8.0, even without ONLY_FULL_GROUP_BY which is default there.


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