Bug #28270 CHANGE MASTER command does not accept variables
Submitted: 7 May 2007 0:49 Modified: 9 May 2007 3:56
Reporter: MICHELE SARTORI Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.0, 5.1, 4.1 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: CHANGE MASTER, variable
Triage: Triaged: D5 (Feature request)

[7 May 2007 0:49] MICHELE SARTORI
Description:
According to the Reference Manual (http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-replication-failover.html) you can set a variable and pass the variable to the CHANGE MASTER command.

Unfortunately, the CHANGE MASTER command with a variable does not work.

How to repeat:
This command does not work:

mysql> set @myport=3306;
Query OK, 0 rows affected (0.10 sec)

mysql> CHANGE MASTER TO MASTER_HOST='10.0.33.104', MASTER_PORT=@myport, MASTER_USER='replica', MASTER_PASSWORD='mypassword';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@myport, MASTER_USER='replica', MASTER_PASSWORD='mypassword'' at line 1

But this command works:

mysql> CHANGE MASTER TO MASTER_HOST='10.0.33.104', MASTER_PORT=3306, MASTER_USER='replica', MASTER_PASSWORD='mypassword';
[7 May 2007 7:36] Sveta Smirnova
test case

Attachment: rpl_bug28270.test (application/octet-stream, text), 242 bytes.

[7 May 2007 7:37] Sveta Smirnova
Thank you for the report.

Verified as described. All versions are affected.