| Bug #120997 | Incorrect index lookup range pushdown/coercion for IN (COALESCE(decimal, string)) on integer indexed column violates TLP | ||
|---|---|---|---|
| Submitted: | 23 Jul 15:31 | Modified: | 6 Aug 8:02 |
| Reporter: | Xiaoyuan Xie | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
| Version: | 8.0.46, 8.4.10, 9.7.1 | OS: | Ubuntu |
| Assigned to: | CPU Architecture: | Any | |
[23 Jul 15:31]
Xiaoyuan Xie
[3 Aug 8:46]
Chaithra Marsur Gopala Reddy
Hi Xiaoyuan Xie, Thank you for test case. Verified as described.
[6 Aug 8:02]
Xiaoyuan Xie
Hi Chaithra Marsur Gopala Reddy, Thank you for verifying this report. Could you please confirm whether Bug #120997 is related to, or possibly shares the same underlying root cause as, Bug #120854? Both reports involve a `COALESCE()` expression whose numeric behavior appears to change in a specific optimizer execution path: * Bug #120997 involves `COALESCE(0.1, '')` in an `IN` predicate on an indexed `MEDIUMINT` column. The positive predicate appears to use an incorrectly coerced value during index range lookup. * Bug #120854 involves `COALESCE(YEAR_column, 0)` followed by arithmetic through a VIEW or CTE, where the result is incorrectly limited to `999.9999`, while the explicitly materialized temporary-table form returns the correct result. The triggering conditions and symptoms are different: #120997 appears to involve index-range coercion, whereas #120854 appears to involve type or precision propagation for a derived expression. However, both may involve incorrect numeric type derivation or conversion of a `COALESCE()` result during optimization. Could you please check whether these reports share any common implementation issue or fix? If they are distinct bugs, a brief clarification about the difference in their root causes would also be very helpful. Thank you!
[25 Aug 7:29]
Chaithra Marsur Gopala Reddy
Hi Xiaoyuan Xie, Thank you for your suggestion. We do not think at this point that they are duplicates. So we would like to keep them as separated issues. We will know more once we start looking into fixing these issues. Thanks, Chaithra
