29.12.9 Performance Schema Connection Attribute Tables (original) (raw)

29.12.9 Performance Schema Connection Attribute Tables

Connection attributes are key-value pairs that application programs can pass to the server at connect time. For applications based on the C API implemented by thelibmysqlclient client library, themysql_options() andmysql_options4() functions define the connection attribute set. Other MySQL Connectors may provide their own attribute-definition methods.

These Performance Schema tables expose attribute information:

In addition, connect events written to the audit log may include connection attributes. SeeSection 8.4.5.4, “Audit Log File Formats”.

Attribute names that begin with an underscore (_) are reserved for internal use and should not be created by application programs. This convention permits new attributes to be introduced by MySQL without colliding with application attributes, and enables application programs to define their own attributes that do not collide with internal attributes.

Available Connection Attributes

The set of connection attributes visible within a given connection varies depending on factors such as your platform, MySQL Connector used to establish the connection, or client program.

The libmysqlclient client library sets these attributes:

Other MySQL Connectors may define their own connection attributes.

MySQL Connector/C++ defines these attributes for applications that use X DevAPI or X DevAPI for C:

MySQL Connector/J defines these attributes:

MySQL Connector/NET defines these attributes:

The Connector/Python implementation defines these attributes; some values and attributes depend on the Connector/Python implementation (pure python or c-ext):

PHP defines attributes that depend on how it was compiled:

Many MySQL client programs set a program_name attribute with a value equal to the client name. For example,mysqladmin and mysqldump set program_name tomysqladmin and mysqldump, respectively. MySQL Shell sets program_name to mysqlsh.

Some MySQL client programs define additional attributes:

Connection Attribute Limits

There are limits on the amount of connection attribute data transmitted from client to server:

For connections initiated using the C API, thelibmysqlclient library imposes a limit of 64KB on the aggregate size of connection attribute data on the client side: Calls tomysql_options() that cause this limit to be exceeded produce aCR_INVALID_PARAMETER_NO error. Other MySQL Connectors may impose their own client-side limits on how much connection attribute data can be transmitted to the server.

On the server side, these size checks on connection attribute data occur: