Bug #106431 Contribution by Tentent: inaccurate description of derived_merge in diff version
Submitted: 10 Feb 2022 9:17 Modified: 6 Apr 2022 23:36
Reporter: Steven Duan (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[10 Feb 2022 9:17] Steven Duan
Description:
Hi,

I see here: https://dev.mysql.com/doc/refman/5.7/en/upgrading-from-previous-series.html a description about upgrading MySQL.

In the second point of the ’SQL Changes‘ chapter.

In version 5.7, the 'derived_merg' is added to optimizer_switch. The docs given an example to descirbe the ER_UPDATE_TABLE_USED error:

mysql> DELETE FROM t1
    -> WHERE id IN (SELECT id
    ->              FROM (SELECT t1.id
    ->                    FROM t1 INNER JOIN t2 USING (id)
    ->                    WHERE t2.status = 0) AS t);
ERROR 1093 (HY000): You can't specify target table 't1'
for update in FROM clause

The error only occurs before 5.7.11 when merging a derived table into the outer query block results in a statement that both selects from and modifies a table (Bug #79333, Bug #22239474 fixed in 5.7.11).
Not all subsequent versions have this problem. To avoid user confusion, we recommended adding the version number in the document.

How to repeat:
read the URL of https://dev.mysql.com/doc/refman/5.7/en/upgrading-from-previous-series.html

Suggested fix:
Add bugfix information to the docs. (Bug #79333, Bug #22239474 fixed in 5.7.11)
[10 Feb 2022 9:30] MySQL Verification Team
Hello duan hc,

Thank you for the report and feedback.

regards,
Umesh
[6 Apr 2022 23:36] Philip Olson
Posted by developer:
 
Thank you for the detailed bug report, this was fixed on 2022-02-15 but this bug report was not updated accordingly; sorry for the delayed update!