mariadb/storage
Yuchen Pei e021770667
MDEV-34911 Sargable substr(col, 1, n) = str
Make Item_func_eq of the following forms sargable by updating the relevant range
analysis methods:

1. substr(col, 1, n) = str
2. str = substr(col, 1, n)
3. left(col, n) = str
4. str = left(col, n)

where col is a indexed column and str is a const and inexpensive item
of length n.

We do this by factoring out Item_func_like::get_mm_leaf() and apply it
to a string obtained from escaping str and then appending a wildcard
"%" to it.

The addition of the two Functype enums, LEFT_FUNC and SUBSTR_FUNC,
requires changes in the spider group by handler to continue handling
LEFT and SUBSTR correctly.

Co-authored-by: Yuchen Pei <ycp@mariadb.com>
Co-authored-by: Sergei Petrunia <sergey@mariadb.com>
2024-12-20 13:25:28 +11:00
..
archive cleanup: remove unconditional #ifdef's 2024-11-05 14:00:47 -08:00
blackhole Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
columnstore cleanup: extract transaction-related part of handlerton 2024-11-05 14:00:50 -08:00
connect Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
csv Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
example cleanup: key algorithm vs key flags 2024-11-05 14:00:47 -08:00
federated Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
federatedx Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
heap Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
innobase Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
maria Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
mroonga Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
myisam Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
myisammrg Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
oqgraph Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
perfschema Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
rocksdb Merge 11.7 into main 2024-12-02 17:55:44 +02:00
sequence cleanup: extract transaction-related part of handlerton 2024-11-05 14:00:50 -08:00
sphinx Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
spider MDEV-34911 Sargable substr(col, 1, n) = str 2024-12-20 13:25:28 +11:00
test_sql_discovery MDEV-19123 Change default charset from latin1 to utf8mb4 2024-07-11 10:21:07 +04:00