[MDEV-6956] SET STATEMENT default_master_connection = ... has no effect Created: 2014-10-27  Updated: 2015-03-16  Resolved: 2015-03-12

Status: Closed
Project: MariaDB Server
Component/s: Admin statements, Replication
Affects Version/s: N/A
Fix Version/s: 10.1.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5231 Per query variables from Percona Serv... Closed
relates to MDEV-6923 Testing for SET STATEMENT .. FOR (MDE... Closed

 Description   

default_master_connection defines which slave (in a multi-source replication) anonymous commands will be applied to. It does not work with SET STATEMENT (works in the same cases if it's set via normal SET). See comments in the test case for details.

Test case

--source include/master-slave.inc
 
--connection slave
 
--source include/stop_slave.inc
RESET SLAVE ALL;
 
--echo # Does not work for CHANGE MASTER:
 
eval SET STATEMENT default_master_connection = 'm1' FOR 
  CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
 
 
--echo #
--echo # The first field, Connection_name, should say 'm1'...
--echo #
query_vertical SHOW ALL SLAVES STATUS;
--echo #
--echo # but it doesn't.
--echo #
 
 
RESET SLAVE ALL;
 
--echo # Does not work for START SLAVE:
 
eval CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
--echo #
--echo # START SLAVE should be applied to 'm1', but it tries to find the anonymous slave instead (and fails):
--echo #
SET STATEMENT default_master_connection = 'm1' FOR START SLAVE;

commit e64f5d8f758bcc1a8856ba9fba01780533f80747
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date:   Sun Oct 26 16:27:54 2014 +0100
 
    Fixed test suite global variable saving

Percona server does not have this functionality and variable, so nothing to compare with.



 Comments   
Comment by Oleksandr Byelkin [ 2014-10-29 ]

The variable is prohibited in SET STATEMENT for now.

Comment by Oleksandr Byelkin [ 2015-02-25 ]

default_master_connection as a defult set in sql_yacc.yy (i.e. in parser).

Comment by Oleksandr Byelkin [ 2015-02-26 ]

revision-id: 8bae7b66a911ad4f275a146fe8a23c8fa3e8d387
parent(s): da181fee4ec849985b15a758c6b26058a0f5e318
committer: Oleksandr Byelkin
branch nick: server
timestamp: 2015-02-26 11:23:30 +0100
message:

MDEV-6956:SET STATEMENT default_master_connection = ... has no effect

the problem was in assigning default value during parsing.

Comment by Oleksandr Byelkin [ 2015-03-06 ]

revision-id: 6c772ae62a0a43ea227f491509c02efb99c5ce92
parent(s): da181fee4ec849985b15a758c6b26058a0f5e318
committer: Oleksandr Byelkin
branch nick: server
timestamp: 2015-03-06 15:51:51 +0100
message:

MDEV-6956:SET STATEMENT default_master_connection = ... has no effect

the problem was in assigning default value during parsing.

Generated at Thu Feb 08 07:15:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.