Bug #113313 | Unexpected Result for ENGINE HEAP | ||
---|---|---|---|
Submitted: | 3 Dec 2023 0:44 | Modified: | 4 Dec 2023 11:36 |
Reporter: | JINSHENG BA | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 8.2.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[3 Dec 2023 0:44]
JINSHENG BA
[4 Dec 2023 10:41]
MySQL Verification Team
Hi Mr. BA, Thank you for your bug report. However, this is not a bug. Your first query only has a select list which returns rows from the Cartesian product. Your second query used a condition in the WHERE clause, which is not satisfied for a single row. Hence, no results. Not a bug.
[4 Dec 2023 11:22]
JINSHENG BA
Thanks for your reply! For the first query, if we cast the expression to a boolean result, the result includes a true and false. Therefore, the second query should return one row, instead of empty. Like this query, it returns one true. There is an inconsistency between this query and the second query. SELECT (t1.c0 IN (-t0.c1)) IS TRUE FROM t0, t1; -- {true},{false}
[4 Dec 2023 11:24]
MySQL Verification Team
Hi, Your first query has no filtering and hence you get a result. Your second query has filtering, which is not met, hence no results. Not a bug.
[4 Dec 2023 11:27]
JINSHENG BA
The bug does not mean both queries return the same result, instead, the same expression is evaluated to different results for two queries. For the first query, the expression is evaluated to {true} and {false} for two rows. For the second query, the expression is evaluated to {false} and {false} for two rows.
[4 Dec 2023 11:36]
JINSHENG BA
if we remove ENGINE = HEAP, the second query returns one row, instead of an empty result.
[4 Dec 2023 12:48]
MySQL Verification Team
Hi, Yes, your last observation is correct. That is due to the default hash indices that are used by that storage engine. Expected behaviour.