Bug #111475 | Faulty Subquery results in select all rows for IN clause | ||
---|---|---|---|
Submitted: | 18 Jun 2023 13:39 | Modified: | 23 Jun 2023 7:45 |
Reporter: | Pedro da Costa | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 8.033 | OS: | Windows (11) |
Assigned to: | CPU Architecture: | x86 (Ryzen 7) | |
Tags: | delete, IN, subquery |
[18 Jun 2023 13:39]
Pedro da Costa
[19 Jun 2023 11:53]
MySQL Verification Team
Hi Mr. Costa, Thank you for your bug report. However, your bug is a duplicate of this, already verified, bug: https://bugs.mysql.com/bug.php?id=111358 Duplicate.
[23 Jun 2023 7:45]
Roy Lyseng
This is not a bug. The column reference "id" in the subquery "SELECT id FROM (SELECT MAX ...)" is not found in the subquery (hence the error in the second query), thus it is resolved as an outer reference in the DELETE statement, which effectively becomes DELETE FROM cars WHERE id = id;
[23 Jun 2023 12:09]
MySQL Verification Team
Thank you, Roy.