| Bug #119132 | Unexpected query result when using complex boolean expressions with UNION ALL and LIKE in SELECT query | ||
|---|---|---|---|
| Submitted: | 11 Oct 2025 3:44 | Modified: | 18 Dec 2025 8:37 |
| Reporter: | Alice Alice | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
| Version: | 8.0.41 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[11 Oct 2025 3:44]
Alice Alice
[18 Dec 2025 8:37]
Øystein Grøvlen
Thank you, Alice, for your report. It seems the second query block returns the wrong result: mysql > SELECT t0.c0 AS ref0 FROM t0 WHERE (NOT ((((! (1593547797))) LIKE (IF(t0.c0, t0.c0, t0.c0))) || (t0.c0))); Empty set, 2 warnings (0.00 sec) Evaluating the where expression indicates that the above query should return one row: mysql > SELECT (NOT ((((! (1593547797))) LIKE (IF(t0.c0, t0.c0, t0.c0))) || (t0.c0))) FROM t0; +------------------------------------------------------------------------+ | (NOT ((((! (1593547797))) LIKE (IF(t0.c0, t0.c0, t0.c0))) || (t0.c0))) | +------------------------------------------------------------------------+ | 0 | | 0 | | 1 | | NULL | +------------------------------------------------------------------------+ 4 rows in set, 2 warnings (0.00 sec)
