Bug #65390 Change master logging should be copy/pastable... (but quotes numeric parameters)
Submitted: 22 May 2012 7:31 Modified: 24 Dec 2012 9:15
Reporter: Simon Mudd (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.5.16 OS:Any
Assigned to: CPU Architecture:Any
Tags: windmill

[22 May 2012 7:31] Simon Mudd
Description:
The logging of change master commands to the log-error output does not show the change master output in a way which can easily be copy/pasted back into the SQL command line.

If something goes wrong when you run a change master command this logging makes it easy to quickly resolve the issue by setting the previous values. However, all parameters are quoted when the numeric ones should not be and therefore the SQL parser fails, requiring the user to adjust the output removing unnecessary quotes.

If you need to fix replication you need this information and you need it fast so it's good that it's now recorded. Please make it even easier so that we can just copy the information from the log file to restore the previous configuration.

How to repeat:
setup a master / slave relationship.
On the slave change the master log file and log pos to some other value so that replication breaks.
Look in the log file and then change the values back. If you copy the Previous state values straight into the  command line you'll notice that you need to unquote at least master_port and master_log_pos. Possibly other parameters are also affected.

Suggested fix:
Please ensure the parameters used in previous state and new state correctly quote (or don't quote) the changed parameters.  This makes resolving unexpected issues faster and the appropriate parameters can just be copied from the log file back to the command line.
[22 May 2012 7:34] Simon Mudd
Logging example:

120521 14:56:18 [Note] 'CHANGE MASTER TO executed'. Previous state master_host='old-master.example.com', master_port='3306', master_log_file='binlog.000122', master_log_pos='428865731'. New state master_host='new-master.example.com', master_port='3306', master_log_file='binlog.004828', master_log_pos='461772904'.

Note: how at least master_port and master_log_pos are quoted. They should not be.  I guess other numeric parameters need to be treated the same.
[22 May 2012 7:43] MySQL Verification Team
Thank you for the bug/feature request.
[22 May 2012 7:47] MySQL Verification Team
On the other hand we have bug reported for the server parser.

http://bugs.mysql.com/bug.php?id=34629
(CHANGE MASTER TO doesn't permit quoted values)
[22 May 2012 7:57] MySQL Verification Team
I should note that the numeric values aren't quoted in recent 5.6 sources. So this is a 5.5 only problem.
[24 Dec 2012 9:15] Erlend Dahl
This is a duplicate of a bug filed internally, fixed in 5.6.5.