Bug #88935 incorrect document on server status `Queries`
Submitted: 15 Dec 2017 5:23 Modified: 29 Apr 2019 5:40
Reporter: 黄 炎-爱可生 (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Connection Handling Severity:S3 (Non-critical)
Version:5.7.19, 5.7.20 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[15 Dec 2017 5:23] 黄 炎-爱可生
Description:
In https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html#statvar_Queries, document says: "The number of statements executed by the server. This variable includes statements executed within stored programs, unlike the Questions variable. It does not count COM_PING or COM_STATISTICS commands.", which is incorrect

Server status `Queries` does count `COM_PING` and `COM_STATISTICS`.

How to repeat:
0. show global status like 'queries'
1. send a `COM_PING` to mysqld
2. show global status like 'queries', it increased by 1

In code: 
status `queries` is equals to `thd->query_id`, which will be increased by `dispatch_command` for COM_*, including `COM_PING` and `COM_STATISTICS`.

Suggested fix:
Update documents.
[15 Dec 2017 8:52] MySQL Verification Team
Hello Yan Huang,

Thank you for the report and feedback.

Thanks,
Umesh
[15 Dec 2017 15:19] Paul DuBois
Posted by developer:
 
Per discussion above, this is a server bug. Recategorizing.
[5 Jan 2018 16:05] 黄 炎-爱可生
patch on #88935

Attachment: 88935.diff (application/octet-stream, text), 4.16 KiB.

[5 Jan 2018 16:07] 黄 炎-爱可生
Above patch makes 'queries' work as 'questions'. Hope it help if this bug is a server bug.

Thanks.
[29 Apr 2019 4:31] MySQL Verification Team
Hello Yan Huang,

Thank you for your contribution.
Please ensure to re-send the patch via  "Contributions" tab. Otherwise we would not be able to accept it.

regards,
Umesh
[29 Apr 2019 5:39] 黄 炎-爱可生
patch

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

Contribution: 88935.diff (application/octet-stream, text), 4.16 KiB.

[29 Apr 2019 5:39] 黄 炎-爱可生
patch

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

Contribution: 88935.diff (application/octet-stream, text), 4.16 KiB.

[29 Apr 2019 5:40] 黄 炎-爱可生
Hello Umesh,
The patch is resent via "Contributions" tab.

Thank you very much.