[MDEV-3855] MIN/MAX optimization doesnt work for int_col > INET_ATON Created: 2012-11-13 Updated: 2013-11-13 Resolved: 2013-11-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | None | ||
| Description |
|
Fill it with data:
Check query execution plan: explain select MIN(b) from test where b >= inet_aton('192.168.119.32')\G Results from MySQL:
Results from MariaDB:
|
| Comments |
| Comment by Sergei Petrunia [ 2012-11-13 ] |
|
This was caused by this: https://bugs.launchpad.net/maria/+bug/884175 the problem is in simple_pred(), added lines: if (args[0] we have: (gdb) p args[0] |
| Comment by Sergei Petrunia [ 2012-11-13 ] |
|
The check may make sense for CHAR(N) column and constant longer than N. It may be relevant for integers of different sizes. However, here both values are BIGINT. Fix suggestion: do not do the max_length comparison if the type is to be compared as integer. |
| Comment by Sergei Petrunia [ 2013-11-13 ] |
|
Fixed by fix for |