Bug #110864 A not exists subquery example has incorrect table reference

Submitted: 28 Apr 2023 10:08 Modified: 11 May 2023 13:33
Reporter: Fei Yang Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0, 5.7 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any

[28 Apr 2023 10:08] Fei Yang
Description:
https://dev.mysql.com/doc/refman/8.0/en/exists-and-not-exists-subqueries.html has a NOT EXISTS subquery example as follows

```
SELECT DISTINCT store_type FROM stores s1
  WHERE NOT EXISTS (
    SELECT * FROM cities WHERE NOT EXISTS (
      SELECT * FROM cities_stores
       WHERE cities_stores.city = cities.city
       AND cities_stores.store_type = stores.store_type));
```

where `stores.store_type` is a wrong table reference in the innermost subquery.

How to repeat:
As in description.

Suggested fix:
```diff
@@ -1,4 +1,4 @@
-SELECT DISTINCT store_type FROM stores s1
+SELECT DISTINCT store_type FROM stores
```

Remove the table alias `stores s1`
[11 May 2023 13:33] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.
[11 May 2023 13:33] Jon Stephens
Fixed in all version of the Manual, in mysqldoc rev 75610.

Thanks!

Closed.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 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.