[MDEV-31800] Problem with open ranges on prefix blobs keys Created: 2023-07-31 Updated: 2023-08-01 Resolved: 2023-07-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.4, 10.5.19, 10.5, 10.6, 10.9, 10.10, 10.11 |
| Fix Version/s: | 10.4.31, 10.5.22, 10.6.15, 10.9.8, 10.10.6, 10.11.5, 11.0.3, 11.1.2, 11.2.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marcin Boniakowski | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | wrong_result | ||
| Environment: |
Debian 11.6, 2GB RAM, Proxmox VM |
||
| Description |
|
I've noticed an unexpected behavior while applying filters on a TEXT column which contains datetime values. I have a table for auditing changes on some of the other tables which contains following columns: ID (int), timestamp(TEXT), table(TEXT), field(TEXT) When I select on the above table with statement I receive a set of records
However when I add second filtering on `ftimestamp
When I change `less` to `less or equal` it works properly
When I use only less comparision (with some limits) it also works
Using `BETWEEN` works as expected. Additional info: there is an index on described table
Above behavior is not seems to be happening on MariaDB 10.3.34 |
| Comments |
| Comment by Alice Sherepa [ 2023-07-31 ] | |||||||||||||||||||||
|
Thank you for the report! I repeated on 10.4-11.0:
| |||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-07-31 ] | |||||||||||||||||||||
|
To highlight the issue:
with the key(d(6)) only the string "prefix" is indexed, the difference between rows is beyond the indexed part. Apparently the server fails to detect that. With VARCHAR the result is correct though. |