Bug #41743 | Functions to get information about the original thread | ||
---|---|---|---|
Submitted: | 25 Dec 2008 11:39 | Modified: | 4 Oct 2010 19:04 |
Reporter: | Serdar S. Kacar | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: General | Severity: | S4 (Feature request) |
Version: | 5.1, 6.X | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | CONNECTION_ID, current_user |
[25 Dec 2008 11:39]
Serdar S. Kacar
[5 Oct 2010 15:44]
MySQL Verification Team
One testcase where being able to find out a base thread_id would be just to be able to differentiate if you are in the SQL Thread or not on a slave. When auditing you could then have separate logic branches within a stored procedure or trigger for if it is run within the SQL thread and "normal" connections. So a IS_SQLTHREAD() function or a SERVER_THREAD_ID to always give the servers thread_id value - the CONNECTION_ID() on the slave in the SQL Thread gives the thread_id from the master...