Bug #101848 | Potentially wrong results | ||
---|---|---|---|
Submitted: | 3 Dec 2020 7:41 | Modified: | 11 Apr 2022 9:08 |
Reporter: | xiaoyang chen | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[3 Dec 2020 7:41]
xiaoyang chen
[3 Dec 2020 13:29]
MySQL Verification Team
Hi Mr. chen, Thank you for your bug report. However, this is not a bug. One query just processes select list, while the other has filtering conditions. Hence, results can not be the same. Not a bug.
[1 Jun 2021 6:48]
Erik Frøseth
Hello, This is indeed a bug. Here is a simpler test case: CREATE TABLE a (col1 DECIMAL(10, 0), UNIQUE INDEX i (col1)); INSERT INTO a VALUES (0); SELECT * FROM a WHERE NOT CONCAT("a") != col1; SELECT * FROM a IGNORE INDEX (i) WHERE NOT CONCAT("a") != col1; Notice that you get different result from the last two queries. For some reason, the EXPLAIN from the first query will say "Zero rows": mysql> EXPLAIN FORMAT=tree SELECT * FROM a WHERE NOT CONCAT("a") != col1; +--------------------------------------------------------------------------+ | EXPLAIN | +--------------------------------------------------------------------------+ | -> Zero rows (no matching row in const table) (cost=0.00..0.00 rows=0) | +--------------------------------------------------------------------------+ 1 row in set, 1 warning (0,00 sec) Tested on 8.0.25
[1 Jun 2021 13:10]
MySQL Verification Team
Hi Mr. Froseth, Thank you for your test case. We repeated the exact behaviour that you reported , with your test case. Thanks a lot. Verified as reported.
[11 Apr 2022 9:08]
Erlend Dahl
Duplicate of Bug#102151 select result is mismatch when use COALESCE and not. fixed in 8.0.27.
[11 Apr 2022 13:15]
MySQL Verification Team
Hi Erlend, Thank you very much for your information. Technically speaking, this report should have been the original one, since it preceded #102151. That is however, irrelevant. What is relevant is that bug is fixed.