W3cubDocs

/MariaDB

Performance Schema session_connect_attrs Table

MariaDB starting with 10.0.5

The session_connect_attrs table was added in MariaDB 10.0 (along with many other new Performance Schema tables).

Description

The session_connect_attrs table shows connection attributes for all sessions.

In MariaDB 10.0.5, applications can pass key/value connection attributes to the server when a connection is made. The session_connect_attrs and session_account_connect_attrs tables provide access to this information, for all sessions and the current session respectively.

The C API functions mysql_options() and mysql_optionsv() are used for passing connection attributes to the server.

session_connect_attrs contains the following columns:

Column Description
PROCESSLIST_ID Session connection identifier.
ATTR_NAME Attribute name.
ATTR_VALUE Attribute value.
ORDINAL_POSITION Order in which attribute was added to the connection attributes.

Example

Returning the current connection's attributes:

SELECT * FROM performance_schema.session_connect_attrs WHERE processlist_id=CONNECTION_ID();
+----------------+-----------------+------------------+------------------+
| PROCESSLIST_ID | ATTR_NAME       | ATTR_VALUE       | ORDINAL_POSITION |
+----------------+-----------------+------------------+------------------+
|             45 | _os             | debian-linux-gnu |                0 |
|             45 | _client_name    | libmysql         |                1 |
|             45 | _pid            | 7711             |                2 |
|             45 | _client_version | 10.0.5           |                3 |
|             45 | _platform       | x86_64           |                4 |
|             45 | program_name    | mysql            |                5 |
+----------------+-----------------+------------------+------------------+
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/performance-schema-session_connect_attrs-table/