MySQL 8.4 Release Notes
30.4.5.15 The ps_thread_id() Function
Note
ps_thread_id()已弃用,可能在未来MySQL版本中被删除。应用程序应将其迁移到使用内置的PS_THREAD_ID()和PS_CURRENT_THREAD_ID()函数。请参阅第14.21章,“Performance Schema Functions”
返回给定连接ID分配的Performance Schema线程ID,或者当前连接的线程ID,如果连接ID为NULL。
-
in_connection_id BIGINT UNSIGNED:要返回线程ID的连接ID。这是一个PROCESSLIST_ID列中的值,见Performance Schemathreads表或SHOW PROCESSLIST输出中的Id列。
一个BIGINT UNSIGNED值。
mysql> SELECT sys.ps_thread_id(260);
+-----------------------+
| sys.ps_thread_id(260) |
+-----------------------+
| 285 |
+-----------------------+