Server Tracking of Client Session State Changes tracker information in OK packets so that session state changes can be detected. To enable client applications to extract state-change information from OK packets returned by the server, the MySQL C API provides a pair of functions: • mysql_session_track_get_first()  fetches the first part of the state-change information received from the server. See mysql_session_track_get_first(). • mysql_session_track_get_next()  fetches any remaining state-change information received from the server. Following a successful call to  mysql_session_track_get_first() , call this function repeatedly as long as it returns success. See mysql_session_track_get_next(). The  mysqltest  program has  disable_session_track_info  and  enable_session_track_info commands that control whether session tracker notifications occur. You can use these commands to see from the command line what notifications SQL statements produce. Suppose that a file  testscript contains the following  mysqltest  script: DROP TABLE IF EXISTS test.t1; CREATE TABLE test.t1 (i INT, f FLOAT); --enable_session_track_info SET @@SESSION.session_track_schema=ON; SET @@SESSION.session_track_system_variables=’*’; SET @@SESSION.session_track_state_change=ON; USE information_schema; SET NAMES ’utf8mb4’; SET @@SESSION.session_track_transaction_info=’CHARACTERISTICS’; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET TRANSACTION READ WRITE; START TRANSACTION; SELECT 1; INSERT INTO test.t1 () VALUES(); INSERT INTO test.t1 () VALUES(1, RAND()); COMMIT; Run the script as follows to see the information provided by the enabled trackers. For a description of the  Tracker:  information displayed by  mysqltest  for the various trackers, see mysql_session_track_get_first(). shell>  mysqltest < testscript DROP TABLE IF EXISTS test.t1; CREATE TABLE test.t1 (i INT, f FLOAT); SET @@SESSION.session_track_schema=ON; SET @@SESSION.session_track_system_variables=’*’; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES -- session_track_system_variables -- * SET @@SESSION.session_track_state_change=ON; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES -- session_track_state_change -- ON USE information_schema; -- Tracker : SESSION_TRACK_SCHEMA -- information_schema -- Tracker : SESSION_TRACK_STATE_CHANGE -- 1 SET NAMES ’utf8mb4’; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES -- character_set_client -- utf8mb4 -- character_set_connection 1012