CONNECTION_ID()
Returns the connection ID (thread ID) for the connection. Every thread (including events) has an ID that is unique among the set of currently connected clients.
Until MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG
, or bigint(10), in all cases. From MariaDB 10.3.1, returns MYSQL_TYPE_LONG
, or int(10), when the result would fit within 32-bits.
SELECT CONNECTION_ID(); +-----------------+ | CONNECTION_ID() | +-----------------+ | 3 | +-----------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/connection_id/