1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

MDEV-38435 Add Gtid_binlog_pos to SHOW MASTER STATUS

Other things:
- Extended mysqltest to write GTID's for master and slave if
  sync_slave_with_master fails.

Reviewer: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
This commit is contained in:
Monty
2025-12-27 14:13:49 +02:00
committed by Brandon Nesterenko
parent cbbb3e51d2
commit 56c8bdfd77
18 changed files with 112 additions and 88 deletions

View File

@@ -309,6 +309,7 @@ struct Parser
struct MasterPos
{
char file[FN_REFLEN];
char gtid[256];
ulong pos;
} master_pos;
@@ -4914,7 +4915,7 @@ void do_sync_with_master2(struct st_command *command, long offset,
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL *mysql= cur_con->mysql;
char query_buf[FN_REFLEN+128], query_buf2[120];
char query_buf[FN_REFLEN+128], query_buf2[256];
int timeout= opt_wait_for_pos_timeout;
if (!master_pos.file[0])
@@ -4948,23 +4949,34 @@ void do_sync_with_master2(struct st_command *command, long offset,
/* master_pos_wait returned NULL or < 0 */
fprintf(stderr, "analyze: sync_with_master\n");
sprintf(query_buf2, "show slave \"%s\" status", connection_name);
snprintf(query_buf2, sizeof(query_buf2)-1,
"select Relay_Master_Log_File, Read_Master_Log_Pos, Gtid_IO_Pos, "
"Gtid_Slave_Pos from information_schema.slave_status where "
"Connection_name='%.64s'", connection_name);
/* purify begin tested */
if (!mysql_query(mysql, query_buf2))
{
if ((res= mysql_store_result(mysql)))
{
if ((row= mysql_fetch_row(res)))
{
fprintf(stderr, "Slave position: file: %s position: %s\n",
fprintf(stderr, "Slave position: file: %s position: %s "
"Gtid_Slave_Pos: %s Gtid_IO_Pos: %s\n",
get_col_value(res, row, "Relay_Master_Log_File"),
get_col_value(res, row, "Read_Master_Log_Pos"));
fprintf(stderr, "Master position: file: %s position: %lld\n",
master_pos.file, (longlong) (master_pos.pos + offset));
get_col_value(res, row, "Read_Master_Log_Pos"),
get_col_value(res, row, "Gtid_Slave_Pos"),
get_col_value(res, row, "Gtid_IO_Pos"));
fprintf(stderr, "Master position: file: %s position: %lld "
"Gtid_Master_Pos: %s\n",
master_pos.file, (longlong) (master_pos.pos + offset),
master_pos.gtid);
}
mysql_free_result(res);
}
}
/* purify end tested */
if (!result_str)
{
/*
@@ -5042,8 +5054,9 @@ int do_save_master_pos()
die("mysql_store_result() returned NULL for '%s'", query);
if (!(row = mysql_fetch_row(res)))
die("empty result in show master status");
strnmov(master_pos.file, row[0], sizeof(master_pos.file)-1);
master_pos.pos = strtoul(row[1], (char**) 0, 10);
strmake(master_pos.file, row[0], sizeof(master_pos.file)-1);
master_pos.pos= strtoul(row[1], (char**) 0, 10);
strmake(master_pos.gtid, row[4], sizeof(master_pos.gtid)-1);
mysql_free_result(res);
DBUG_RETURN(0);
}

View File

@@ -1,5 +1,5 @@
# show master status
# mask out the binlog position
-- replace_column 2 # 3 <Binlog_Do_DB> 4 <Binlog_Ignore_DB>
--replace_column 2 # 3 <Binlog_Do_DB> 4 <Binlog_Ignore_DB> 5 <Binlog_GTID>
show master status;

View File

@@ -338,16 +338,16 @@ Log_name Pos Event_type Server_id End_log_pos Info
RESET MASTER;
RESET MASTER;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 <pos>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 <pos>
RESET MASTER TO 100;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000100 <pos>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000100 <pos>
RESET MASTER;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 <pos>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 <pos>
CREATE TABLE t1(a INT, b INT);
CREATE TABLE IF NOT EXISTS t1(a INT, b INT);
Warnings:

View File

@@ -40,7 +40,7 @@ perl;
wsrep file-key-management cracklib-password-check user-variables
provider-bzip2 provider-lzma provider-lzo caching-sha2-password
thread-pool-groups thread-pool-queues thread-pool-stats
thread-pool-waits hashicorp provider gssapi parsec/;
thread-pool-waits hashicorp provider gssapi parsec videx/;
# And substitute the content some environment variables with their
# names:

View File

@@ -38,11 +38,11 @@ count(*)
0
# Binlog is closed
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
# restart
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000004 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000004 # <Binlog_Do_DB> <Binlog_Ignore_DB> <Binlog_GTID>
#
# Crash happens before rename the file
#

View File

@@ -9,8 +9,8 @@ master-bin.000001 #
CREATE TABLE t1_myisam (c1 INT) ENGINE=myisam;
insert into t1_myisam values(0),(1);
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> <Binlog_GTID>
flush logs;
flush logs;
flush logs;
@@ -398,8 +398,8 @@ flush logs;
flush logs;
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000291 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000291 # <Binlog_Do_DB> <Binlog_Ignore_DB> <Binlog_GTID>
show binary logs;
Log_name File_size
master-bin.000001 #
@@ -698,22 +698,22 @@ reset master;
flush logs;
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000003 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000003 # <Binlog_Do_DB> <Binlog_Ignore_DB> <Binlog_GTID>
reset master;
# left times= 2
flush logs;
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000003 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000003 # <Binlog_Do_DB> <Binlog_Ignore_DB> <Binlog_GTID>
reset master;
# left times= 1
flush logs;
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000003 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000003 # <Binlog_Do_DB> <Binlog_Ignore_DB> <Binlog_GTID>
reset master;
# left times= 0
# [engine=myisam] after first loop_times=0, show master logs results
@@ -721,8 +721,8 @@ show binary logs;
Log_name File_size
master-bin.000001 #
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> <Binlog_GTID>
flush logs;
flush logs;
#begin to restart mysqld current loop_times=10

View File

@@ -7,8 +7,8 @@ connection default;
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
INSERT INTO t1 VALUES(9, "");
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 <pos>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 <pos> <gtid>
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
Binlog_snapshot_file master-bin.000001
@@ -46,8 +46,8 @@ Variable_name Value
Binlog_snapshot_file master-bin.000001
Binlog_snapshot_position <pos>
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 <pos>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 <pos> <gtid>
SELECT * FROM t2 ORDER BY a;
a
2
@@ -69,16 +69,16 @@ Variable_name Value
Binlog_snapshot_file master-bin.000001
Binlog_snapshot_position <pos>
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 <pos>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000002 <pos> <gtid>
COMMIT;
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
Binlog_snapshot_file master-bin.000002
Binlog_snapshot_position <pos>
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 <pos>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000002 <pos> <gtid>
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#

View File

@@ -20,6 +20,7 @@ CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
# So concurrent insert won't happen on the table
INSERT INTO t1 VALUES(9, "");
let pos=`select $binlog_start_pos + 431`;
--replace_column 5 <gtid>
--replace_result $pos <pos>
SHOW MASTER STATUS;
--replace_result $pos <pos>
@@ -60,6 +61,7 @@ let pos=`select $binlog_start_pos + 974`;
--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%';
let pos=`select $binlog_start_pos + 1350`;
--replace_column 5 <gtid>
--replace_result $pos <pos>
SHOW MASTER STATUS;
SELECT * FROM t2 ORDER BY a;
@@ -81,11 +83,13 @@ let pos=`select $binlog_start_pos + 974`;
--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%';
let pos=`select $binlog_start_pos + 131`;
--replace_column 5 <gtid>
--replace_result $pos <pos>
SHOW MASTER STATUS;
COMMIT;
--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%';
--replace_column 5 <gtid>
--replace_result $pos <pos>
SHOW MASTER STATUS;

View File

@@ -5,8 +5,8 @@ connection master;
include/kill_binlog_dump_threads.inc
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: No such row
@@ -22,8 +22,8 @@ connection master;
include/kill_binlog_dump_threads.inc
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::1
@@ -39,8 +39,8 @@ connection master;
include/kill_binlog_dump_threads.inc
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
@@ -55,8 +55,8 @@ connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0:0:0:0:0:0:1

View File

@@ -4,8 +4,8 @@ connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: No such row
@@ -20,8 +20,8 @@ connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::1
@@ -36,8 +36,8 @@ connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
@@ -52,8 +52,8 @@ connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0:0:0:0:0:0:1

View File

@@ -5,8 +5,8 @@ include/kill_binlog_dump_threads.inc
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='127.0.0.1';
@@ -21,8 +21,8 @@ include/kill_binlog_dump_threads.inc
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0:0:0:0:0:FFFF:127.0.0.1';
@@ -37,8 +37,8 @@ include/kill_binlog_dump_threads.inc
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0000:0000:0000:0000:0000:FFFF:127.0.0.1';
@@ -53,8 +53,8 @@ include/kill_binlog_dump_threads.inc
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1';
@@ -69,8 +69,8 @@ include/kill_binlog_dump_threads.inc
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0::0000:FFFF:127.0.0.1';
@@ -85,8 +85,8 @@ include/kill_binlog_dump_threads.inc
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='::FFFF:127.0.0.1';
@@ -100,8 +100,8 @@ connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::FFFF:127.0.0.1

View File

@@ -5,8 +5,8 @@ include/kill_binlog_dump_threads.inc
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='::1';
@@ -21,8 +21,8 @@ include/kill_binlog_dump_threads.inc
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0000:0000:0000:0000:0000:0000:0000:0001';
@@ -37,8 +37,8 @@ include/kill_binlog_dump_threads.inc
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0:0:0:0:0:0:0:1';
@@ -52,8 +52,8 @@ connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0:0:0:0:0:0:1

View File

@@ -5,8 +5,8 @@ drop table t1;
call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary");
call mtr.add_suppression ("Error in Log_event::read_log_event");
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> 0-1-4
connection slave;
include/stop_slave.inc
change master to master_log_pos=MASTER_LOG_POS, master_use_gtid=no;
@@ -16,8 +16,8 @@ Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary
include/stop_slave_sql.inc
connection master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> 0-1-4
create table if not exists t1 (n int);
drop table if exists t1;
create table t1 (n int);

View File

@@ -103,8 +103,8 @@ master-bin.000007 #
master-bin.000008 #
master-bin.000009 #
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000009 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000009 # <Binlog_Do_DB> <Binlog_Ignore_DB> 0-1-113
connection slave;
select * from t4;
a

View File

@@ -72,8 +72,8 @@ include/check_slave_is_running.inc
connection master;
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB> 0-1-804
connection slave;
set global max_binlog_size= @my_max_binlog_size;
set global max_relay_log_size= @my_max_relay_log_size;

View File

@@ -72,8 +72,8 @@ include/check_slave_is_running.inc
connection master;
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
File Position Binlog_Do_DB Binlog_Ignore_DB Gtid_Binlog_Pos
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB> 0-1-804
connection slave;
set global max_binlog_size= @my_max_binlog_size;
set global max_relay_log_size= @my_max_relay_log_size;

View File

@@ -5341,6 +5341,9 @@ void show_binlog_info_get_fields(THD *thd, List<Item> *field_list)
field_list->push_back(new (mem_root)
Item_empty_string(thd, "Binlog_Ignore_DB", 255),
mem_root);
field_list->push_back(new (mem_root)
Item_empty_string(thd, "Gtid_Binlog_Pos", 255),
mem_root);
}
@@ -5388,11 +5391,15 @@ bool show_binlog_info(THD* thd)
size_t dir_len = dirname_length(li.log_file_name);
base= li.log_file_name + dir_len;
}
StringBuffer<128> str(system_charset_info);
(void) mysql_bin_log.append_state_pos(&str);
protocol->store(base, strlen(base), &my_charset_bin);
protocol->store((ulonglong)pos);
protocol->store(binlog_filter->get_do_db());
protocol->store(binlog_filter->get_ignore_db());
protocol->store(&str);
if (protocol->write())
DBUG_RETURN(TRUE);
}

View File

@@ -476,7 +476,7 @@ static void test_prepare_simple()
strmov(query, "SHOW MASTER STATUS");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
DIE_UNLESS(mysql_stmt_field_count(stmt) == 4);
DIE_UNLESS(mysql_stmt_field_count(stmt) == 5);
mysql_stmt_close(stmt);
/* show create procedure */