Bug #117625 Error in code comment in P_S: s/start_file_open_wait/end_file_open_wait/.
Submitted: 5 Mar 21:35 Modified: 6 Mar 5:37
Reporter: Jean-François Gagné Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:9.2.0, 8.4.4, 8.0.41 OS:Any
Assigned to: CPU Architecture:Any

[5 Mar 21:35] Jean-François Gagné
Description:
Hi,

when reading Performance Schema code, I found what I think are two miss-leading comments.

In [1] and [2], it is written that "state->m_file is set by start_file_open_wait", which looks wrong to me.

[1]: https://github.com/mysql/mysql-server/blob/mysql-9.2.0/storage/perfschema/pfs.cc#L4384

[2]: https://github.com/mysql/mysql-server/blob/mysql-9.2.0/storage/perfschema/pfs.cc#L4456

From what I see, start_file_open_wait calls start_file_wait [3], in which I did not find any assignment for state->m_file [4].

[3]: https://github.com/mysql/mysql-server/blob/mysql-9.2.0/storage/perfschema/pfs.cc#L5546

[4]: https://github.com/mysql/mysql-server/blob/mysql-9.2.0/storage/perfschema/pfs.cc#L5644

I was able to track an assignment for state->m_file in end_file_open_wait [5], so it looks to me like the 2 comments above ([1] and [2]) should indicate that "state->m_file is set by end_file_open_wait".

[5]: https://github.com/mysql/mysql-server/blob/mysql-9.2.0/storage/perfschema/pfs.cc#L5555

I checked 8.4.4 and 8.0.41, and I found the same miss-leading comments.

I could submit a patch, but it looks to me like merging this patch is as much work as "just" fixing the comments, so I am just reporting the bug.

Many thanks for looking into this,

J-F Gagné

How to repeat:
Code inspection, see description.

Suggested fix:
Two comments update in the code, see description.
[6 Mar 5:37] MySQL Verification Team
Hello Jean-François,

Thank you for the report and feedback.

regards,
Umesh