Bug #102365 Implement Performance Schema instrumentation for query attributes
Submitted: 25 Jan 2021 14:37 Modified: 26 Jan 2021 12:36
Reporter: Sveta Smirnova (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S4 (Feature request)
Version:8.0.23 OS:Any
Assigned to: CPU Architecture:Any

[25 Jan 2021 14:37] Sveta Smirnova
Description:
Original contribution for the query attributes contained code for Performance Schema: bug #92532 But the current implementation does not have it. See https://dev.mysql.com/worklog/task/?id=12542 and https://dev.mysql.com/doc/refman/8.0/en/query-attributes.html That makes this potentially very demanding feature unusable for everyone who cannot write their own plugins.

How to repeat:
In one connection:

mysql> query_attributes n1 v1 n2 v2;
mysql> select sleep(100);

In another connection:

try to figure out which query attributes query in the first connection has.
[25 Jan 2021 14:46] Sveta Smirnova
Ideally, I would like to see them either in tables events_statements_* or in a table, linked to them by EVENT_ID
[25 Jan 2021 17:03] MySQL Verification Team
Hi Mrs. Smirnova,

Thank you for your bug report.

However, what you are reporting looks much more like a feature request. Also, changing the location of that particular instrumentation would break many plugins.

Do you agree with these statements ?????
[25 Jan 2021 22:43] Sveta Smirnova
Hi MySQL Verification Team,

yes, this is a feature request.

> Also, changing the location of that particular instrumentation would
break many plugins.

It would not, because this particular instrumentation does not exist in Performance Schema. This is a new 8.0.23 feature that requires MySQL *users* to *write plugins in C++ code* to be able to get the value of this feature. That's too much I believe.

What I suggest: instead of providing access only via plugin API and C++ object THD provide also *read-only* access via Performance Schema. It could be done as a plugin for Performance Schema. This way it would not affect anything.
[26 Jan 2021 12:36] MySQL Verification Team
Hi Sveta,

Thank you very much for your report.

This is now a verified feature request.