Bug #109873 no need to maintain err in buf_page_init_for_read
Submitted: 1 Feb 2023 12:01 Modified: 21 Apr 2023 9:10
Reporter: alex xing (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S5 (Performance)
Version:8.0.32 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[1 Feb 2023 12:01] alex xing
Description:
I found that err was maintained in buf_page_init_for_read, but I found that it was unnecessary because it was already maintained in buf_read_page_low before buf_page_init_for_read was called.

I think it was designed that way because of the loop call in old version such as MySLQ 8.0.19, but the new version doesn't have while loop in buf_read_page_low, So I think we can remove this invalid code and reduce the overhead of the program

How to repeat:
just read the code

Suggested fix:
remove this invalid code just as the below patch
[1 Feb 2023 12:02] alex xing
a simple patch to describe the optimization

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: optimize.patch (text/plain), 2.18 KiB.

[1 Feb 2023 12:34] MySQL Verification Team
Hello Alex Xing,

Thank you for the report and contribution.

regards,
umesh
[19 Apr 2023 12:16] David Hollis
Posted by developer:
 
8.0.33 release note:
Dead code removal. Thank you Alex Xing for reporting this bug.
[21 Apr 2023 9:08] Frederic Descamps
Than you for your contribution is now part of MySQL 8.0.33