| Bug #121019 | subquery_to_derived + semijoin=off produces wrong WHERE-clause EXISTS results with LIMIT (dual boundary interaction, sil | ||
|---|---|---|---|
| Submitted: | 28 Jul 6:04 | Modified: | 29 Jul 6:16 |
| Reporter: | Jacob Ding | 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: | MacOS |
| Assigned to: | CPU Architecture: | ARM | |
[28 Jul 6:04]
Jacob Ding
[28 Jul 6:16]
Jacob Ding
Correction to the expected row counts in the original report: With the exact INSERT data provided above, the correct row counts are: - Plan A (default): 5 rows (not 6) - Plan B (s2d=on alone): 5 rows (not 6) - Plan C (s2d=on + semijoin=off): 0 rows (correct — the bug) The LIMIT value sweep should be: | LIMIT | default | s2d=on | s2d=on + semijoin=off | Correct | |---|---|---|---|---| | No LIMIT | 5 | 5 | 5 | 5 | | LIMIT 1 | 5 | 5 | 0 | 5 | | LIMIT 2 | 5 | 5 | 3 | 5 | | LIMIT 3 | 5 | 5 | 4 | 5 | NOT EXISTS + LIMIT 1: default returns 3 rows, s2d=on+semijoin=off returns 8 (should be 3). The bug is fully reproducible with the provided test data — only the annotated row counts in the comments were slightly off. The core issue (0 rows instead of 5 when s2d=on + semijoin=off) is confirmed.
[29 Jul 6:16]
Chaithra Marsur Gopala Reddy
Hi Jacob Ding, Thank you for test case. Verified as described.
