mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
329d1a7bf7
When set the server-id dynamically, the server_id member of current thread is not updated. Update the server_id member of current thread after updated the global variable value.
34 lines
1.2 KiB
Text
34 lines
1.2 KiB
Text
set global server_id=1;
|
|
reset master;
|
|
drop table if exists t1,t2,t3;
|
|
create table t1 (a int);
|
|
select @@server_id;
|
|
@@server_id
|
|
1
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query 1 # use `test`; drop table if exists t1,t2,t3
|
|
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
|
|
set global server_id=2;
|
|
create table t2 (b int);
|
|
select @@server_id;
|
|
@@server_id
|
|
2
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query 1 # use `test`; drop table if exists t1,t2,t3
|
|
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
|
|
master-bin.000001 # Query 2 # use `test`; create table t2 (b int)
|
|
set global server_id=3;
|
|
create table t3 (c int);
|
|
select @@server_id;
|
|
@@server_id
|
|
3
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query 1 # use `test`; drop table if exists t1,t2,t3
|
|
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
|
|
master-bin.000001 # Query 2 # use `test`; create table t2 (b int)
|
|
master-bin.000001 # Query 3 # use `test`; create table t3 (c int)
|
|
set global server_id=1;
|
|
drop table t1,t2,t3;
|