Bug #115397 statement_id variable has minimal documentation
Submitted: 20 Jun 18:29 Modified: 16 Jul 13:03
Reporter: Dov Endress Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0.33 and above OS:Any
Assigned to: CPU Architecture:Any

[20 Jun 18:29] Dov Endress
Description:
The variable statement_id is only found in the documentation as part of the description of session_track_system_variables. 

"To enable display of the Statement ID for each statement processed, use the statement_id variable. For example:

mysql>  SET @@SESSION.session_track_system_variables='statement_id'
mysql>  SELECT 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.0006 sec)
Statement ID: 603835
"

I don't know if this is an oversight or if the variable and its usage is considered self-explanatory and does not merit an individual listing within the other system variables. It is clearly a read only variable and perhaps it should be documented more fully.

How to repeat:
refer to https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_session_track_... for the only reference to statement_id as a variable and not as a field in the performance_schema.prepared_statements_instances table.

Suggested fix:
I cannot really say this variable demands its own listing with the rest of the sys vars. It caused me a bit of confusion at first looking for it, but I quickly realized its use. I leave it up to you to decide if it should be more fully documented as a variable. For what it is worth other read-only variables are documented: e.g. build_id, ngram_token_size, etc.

Cheers!

Dov Endress
[21 Jun 6:33] MySQL Verification Team
Hello Dov Endress,

Thank you for the document enhancement request and feedback.

regards,
Umesh
[16 Jul 13:03] Jon Stephens
Fixed in mysqldoc rev 79048.

Closed.