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.