[MDEV-23878] Invalid result when in_predicate_conversion_threshold is reached using IN clause Created: 2020-10-02 Updated: 2020-10-18 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.4.14, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | carlos tutte | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
When the number of conditions inside the "IN" clause matches the value of in_predicate_conversion_threshold , query behavior changes and returned result is incorrect for query. Attaching file for case reproduction: CREATE DATABASE subscriber_data; Execute:
Result is Otherwise setting set in_predicate_conversion_threshold = 1000; (value bigger than number of clauses inside "IN" ):
Returns The returned result when bug triggers (in_predicate_conversion_threshold = 51) is:
-------
------- But if I reorder the values inside the query IN clause and set "1" at the end instead of 51, result is:
-------
------- It can be seen that on the group by "ind" , the result "ind" value displayed is only the one last used in the "IN" conditions, and there seems to is a "UNION ALL" missing to merge all results when in_predicate_conversion_threshold kicks in. |
| Comments |
| Comment by Elena Stepanova [ 2020-10-18 ] | ||||||||
|
Thanks for the report and test case, reproducible as described.
The test case is for debugging purposes only, don't put it into the regression suite like this! With otherwise default optimizer settings, reproducible on 10.4 and 10.5. Possibly with non-default settings and/or adjustments to the data and queries it could be reproduced on earlier versions. |