[MDEV-18383] Change of behaviour of OR in IF-conditions 10.2 -> 10.3 Created: 2019-01-25 Updated: 2019-03-15 Resolved: 2019-03-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.3.11, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.2.23 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Friedemann Schmidt | Assignee: | Galina Shalygina (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression | ||
| Environment: |
Windows 10, Windows Server 2008 |
||
| Issue Links: |
|
||||||||
| Description |
|
The behavior of the OR operator in the IF condition has changed from MariaDB 10.2 to 10.3.
Now I'd have to write:
Is it a bug or a deliberate change? Is there a setting with which I can reactivate the previous behavior? |
| Comments |
| Comment by Friedemann Schmidt [ 2019-01-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Addendum: I have further investigated the problem. It only appears when using views in which a session variable @var is queried in the WHERE condition. I'll upload an example later. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Friedemann Schmidt [ 2019-02-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
here is an example that shows the difference between 10.2 and 10.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Friedemann Schmidt [ 2019-02-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
the problem occurs only if the view has a group by statement. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2019-02-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for the report and the test case!
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Friedemann Schmidt [ 2019-02-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Is there a relation to https://jira.mariadb.org/browse/MDEV-18605 too ? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2019-02-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
FriedemannS No, I guess not. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Galina Shalygina (Inactive) [ 2019-02-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This bug occurs because the condition that shouldn't be pushed is pushed into the derived table. In this special case OR-condition inside the IF-function is defined as dependent only on fields When going through the IF-function virtual function excl_dep_on_table() reaches OR condition To fix it Item_cond::excl_dep_on_table() needs to be added. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2019-03-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Ok to push after a minor correction in the patch comment. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Galina Shalygina (Inactive) [ 2019-03-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Pushed in 10.2 |