[MDEV-8679] Equal field propagation is not used for VARCHAR when it safely could Created: 2015-08-26 Updated: 2015-09-12 Resolved: 2015-08-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 5.5, 10.0, 10.1 |
| Fix Version/s: | 10.1.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | propagation, upstream | ||
| Issue Links: |
|
||||||||
| Description |
|
This script:
returns
I.e. the field equal value of 10 was propagated into IF, then the condition part with IF was evaluated as a constant and removed from the condition. If I use VARCHAR in the same scenario:
it returns:
Propagation did not work. Tracing in gdb shows the following:
I.e. Item_field::subst_argument_checker() is called with a wrong Subst_constaint value. |
| Comments |
| Comment by Alexander Barkov [ 2015-08-26 ] | ||||||||||||||||
|
Another example:
returns:
Equal fields propagation did not work.
| ||||||||||||||||
| Comment by Alexander Barkov [ 2015-09-12 ] | ||||||||||||||||
|
After the fix this script in MariaDB:
returns
MySQL-5.7.8 does not support propagation in the same scenario:
|