MDEV-31609 mtr: only print session tracking from the last statement

We do this by checking server status. By doing this we avoid printing
session tracking info from previous (but not the last) statement.

The change is from Sergei Golubchik
This commit is contained in:
Yuchen Pei 2024-03-01 10:10:44 +11:00
parent 7bec41d25d
commit e32736ec59
No known key found for this signature in database
GPG key ID: 3DD1B35105743563
2 changed files with 2 additions and 8 deletions

View file

@ -7948,6 +7948,8 @@ static const char *trking_info_desc[SESSION_TRACK_END + 1]=
static void append_session_track_info(DYNAMIC_STRING *ds, MYSQL *mysql)
{
if (!(mysql->server_status & SERVER_SESSION_STATE_CHANGED))
return;
#ifndef EMBEDDED_LIBRARY
for (unsigned int type= SESSION_TRACK_BEGIN; type <= SESSION_TRACK_END; type++)
{

View file

@ -11,10 +11,6 @@ create table t1 (a int) engine=innodb;
select @@last_gtid;
@@last_gtid
0-1-1000
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
-- last_gtid
-- 0-1-1000
insert into t1 values (1);
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
-- last_gtid
@ -23,10 +19,6 @@ insert into t1 values (1);
select @@last_gtid;
@@last_gtid
0-1-1001
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
-- last_gtid
-- 0-1-1001
drop table t1;
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
-- last_gtid