Bug #112600 The inconsistencies between the expr in the SELECT clause and WHERE clause
| Submitted: | 3 Oct 2023 13:56 | Modified: | 5 Oct 2023 12:34 |
|---|---|---|---|
| Reporter: | Jin Wei | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
| Version: | 8.0 | OS: | Any |
| Assigned to: | CPU Architecture: | Any |
[3 Oct 2023 13:56]
Jin Wei
[4 Oct 2023 10:54]
MySQL Verification Team
HI Mr. Wei, Thank you for your bug report. We have got the same results as you have. We also think that this is a bug. Verified as reported.
[5 Oct 2023 12:34]
MySQL Verification Team
Hi Mr. Wei, Sorry, but it turns out not to be a bug. There are valid reasons for this decision and they are the following ones .... For the last SELECT statement, the WHERE clause evaluates to FALSE for all 3 rows (as verified by the first statement), thus the MAX part of the selected expression is NULL, and COUNT(*) is equal to 0, which in our evaluation is the same as FALSE, so we get SELECT NULL OR 0 = 0 which is true. Not a bug.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.