MySQL:
PS_CURRENT_THREAD_ID
PS_CURRENT_THREAD_ID()
Returns a BIGINT UNSIGNED value representing the Performance Schema
thread ID assigned to the current connection.
The thread ID return value is a value of the type given in the
THREAD_ID column of Performance Schema tables.
Performance Schema configuration affects PS_CURRENT_THREAD_ID() the
same way as for PS_THREAD_ID(). For details, see the description of
that function.
URL: https://dev.mysql.com/doc/refman/8.0/en/performance-schema-functions.html
Example
mysql> SELECT PS_CURRENT_THREAD_ID();
+------------------------+
| PS_CURRENT_THREAD_ID() |
+------------------------+
| 52 |
+------------------------+
mysql> SELECT PS_THREAD_ID(CONNECTION_ID());
+-------------------------------+
| PS_THREAD_ID(CONNECTION_ID()) |
+-------------------------------+
| 52 |
+-------------------------------+