[MDEV-22264] MariaDB 10.3+ LEFT JOIN and user defined variable returns extra rows Created: 2020-04-16 Updated: 2023-04-27 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Subquery, Storage Engine - InnoDB |
| Affects Version/s: | 10.3.18, 10.4.11, 10.3, 10.4 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Evgeny Alperovich | Assignee: | Igor Babaev |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Fedora Core 29 |
||
| Description |
|
Using MariaDB 10.0 the following SQL code returns just one row:
However, the same code in MariaDB 10.3 and 10.4 (unfortunately I don't have access to MariaDB 10.1 or 10.2) returns two rows!
Note that this only happens when using a user defined variable. For instance, the following code only produces a single row, as expected:
We have a lot of code that depends on this behavior and my goal is to make MariaDB 10.3+ behave 'the old way' and return only one row in this case. NB: You can easily try this out yourself with https://dbfiddle.uk/ |
| Comments |
| Comment by Alice Sherepa [ 2020-04-17 ] | ||||||||||||||||||||
|
Thanks for the report! I repeated on 10.3-10.5, on 5.5-10.2 rows are not doubled, with InnoDB, not with MyIsam
|