[MDEV-30570] performance_schema.session_connect_attrs not showing attributes Created: 2023-02-05  Updated: 2023-02-28  Resolved: 2023-02-28

Status: Closed
Project: MariaDB Server
Component/s: Performance Schema
Affects Version/s: 10.6.11, 11.0.0
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Daniël van Eeden Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

When connecting with a MariaDB and/or MySQL Client I can see connection attributes being sent in the network packets, but I don't see them in P_S.

mysql [localhost:11000] {msandbox} ((none)) > SELECT * FROM performance_schema.session_connect_attrs;
Empty set (0.002 sec)

I tried multiple versions of MariaDB with dbdeployer on Fedora 37

Looking at the docs ( https://mariadb.com/kb/en/performance-schema-session_connect_attrs-table/ ) it seems that this should work.



 Comments   
Comment by Daniël van Eeden [ 2023-02-05 ]

I found this when reviewing https://github.com/go-sql-driver/mysql/pull/1389

Comment by Sergei Golubchik [ 2023-02-27 ]

there must be more to it. connect attributes are covered in the mysql-test (test name pefschema.connect_attrs), so they must work, at least in some cases. I've tried both 10.6 and 11.0 latest.

Do you have performance_schema enabled?

Comment by Daniël van Eeden [ 2023-02-27 ]

mysql [localhost:11000] {msandbox} ((none)) > SELECT * FROM performance_schema.session_connect_attrs;
Empty set (0.001 sec)
 
mysql [localhost:11000] {msandbox} ((none)) > SELECT @@global.performance_schema;
+-----------------------------+
| @@global.performance_schema |
+-----------------------------+
|                           0 |
+-----------------------------+
1 row in set (0.000 sec)

After adding performance_schema to my.sandbox.cnf and restaring:

mysql [localhost:11000] {msandbox} ((none)) > SELECT * FROM performance_schema.session_connect_attrs;
+----------------+-----------------+------------+------------------+
| PROCESSLIST_ID | ATTR_NAME       | ATTR_VALUE | ORDINAL_POSITION |
+----------------+-----------------+------------+------------------+
|              3 | _os             | Linux      |                0 |
|              3 | _client_name    | libmariadb |                1 |
|              3 | _pid            | 806209     |                2 |
|              3 | _client_version | 3.3.3      |                3 |
|              3 | _platform       | x86_64     |                4 |
|              3 | program_name    | mysql      |                5 |
+----------------+-----------------+------------+------------------+
6 rows in set (0.002 sec)

I don't know why I overlooked this.

Feel free to close this ticket. Might be good to make a note about this on https://mariadb.com/kb/en/performance-schema-session_connect_attrs-table/ as MySQL has performance_schema enabled by default so other people might also be surprised by this.

Comment by Sergei Golubchik [ 2023-02-28 ]

Thanks! Good that it's solved and the test is fixed.

greenman, please see the last comment and consider adding a warning, if you think it's needed

Generated at Thu Feb 08 10:17:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.