22.12.8 Performance Schema Connection Attribute Tables

Connection attributes are key-value pairs that application
programs can pass to the server at connect time. Applications
based on the C API define the attribute set using the
mysql_options() and
mysql_options4() functions.
Other MySQL Connectors may provide their own
attribute-definition methods.

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.

The set of connection attributes visible on a given connection
varies depending on your platform and MySQL Connector used to
establish the connection.

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

A fixed limit imposed by the client prior to connect time.

A fixed limit imposed by the server at connect time.

A configurable limit imposed by the Performance Schema at
connect time.

For connections initiated using the C API, the
libmysqlclient library imposes a limit of
64KB on the aggregate size of connection attribute data on the
client side: Calls to
mysql_options() that cause this
limit to be exceeded produce a
CR_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:

The server imposes a limit of 64KB on the aggregate size of
connection attribute data it will accept. If a client
attempts to send more than 64KB of attribute data, the
server rejects the connection.

For accepted connections, the Performance Schema checks
aggregate attribute size against the value of the
performance_schema_session_connect_attrs_size
system variable. If attribute size exceeds this value, these
actions take place: