[MDEV-9681] select with inner join against empty table brings unexpected values Created: 2016-03-03 Updated: 2023-11-28 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Storage Engine - InnoDB |
| Affects Version/s: | 10.0.21, 5.5, 10.0, 10.1, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Luciano Barcaro | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | upstream | ||
| Environment: |
Gentoo linux |
||
| Description |
|
MariaDB brings values passed on where clause as result field values in queries multi table with INNER join against empty table (innodb engine). also tested against aria and myisam (both works as expected) At the moment, I can't check against newer MariaDB versions. How to reproduce:
|
| Comments |
| Comment by Elena Stepanova [ 2016-03-03 ] |
|
Technically, the result is indeed incorrect, because the join itself produces an empty result. However, please note that for all practical purposes you should avoid mixing aggregate and non-aggregate columns in queries without GROUP BY, because result in general case is non-deterministic. If JOIN produced more than one row, idTmp1 and idTmp2 would be officially allowed to have any value from the ones produced by join, so it would really be useless. Also reproducible on MySQL 5.5, 5.6, 5.7 (for 5.7 sql_mode needs to be modified because by default it now requires the full group-by). |
| Comment by Luciano Barcaro [ 2016-03-03 ] |
|
Hi Elena, |