LP #889739: pt-config-diff doesn't diff quoted strings properly

Description

**Reported in Launchpad by Simon J Mudd last update 10-08-2012 18:13:20

From a recent check on a server I see:

[root@server ~]# pt-config-diff /etc/my.cnf F=/root/.my.cnf
9 config differences
Variable /etc/my.cnf server
========================= ================ ==================================
init_connect 'SET NAMES utf8' SET NAMES utf8
innodb_log_file_size 536870912 134217728
innodb_open_files 3000 300
log_slave_updates ON OFF
max_heap_table_size 67108864 16777216
relay_log ../log/relaylog
server_id 147212030 147212020
sort_buffer_size 268435456 4194304
tmp_table_size 67108864 16777216
[root@server ~]# grep NAMES /etc/my.cnf
init_connect = 'SET NAMES utf8'
[root@server ~]#

The differences except init_connect are valid differences. However, the check made against init_connect should not show a difference. I believe the quoted string should have the quotes removed when doing the comparison.

Version of percona toolkit used:

[root@server ~]# rpm -q percona-toolkit
percona-toolkit-1.0.1-1

Though not relevant in this case, the version of mysql used is:

[root@server ~]# rpm -qa | grep MySQL
MySQL-client-advanced-gpl-5.1.49-1.rhel5
MySQL-server-advanced-gpl-5.1.49-1.rhel5
[root@server ~]#

Environment

None

Smart Checklist

Activity

lpjirasync January 24, 2018 at 2:58 PM

**Comment from Launchpad by: Brian Fraser on: 08-03-2012 03:50:37

The fix for this sounds relatively simple, but I don't know enough of the config files to know if I'm missing something. Basically though, it needs something like this:

$val =~ s/
\A #Start of value
(['"`]) # Opening quote
(.*) # Value
\1 # Closing quote
\R?\z # End of value
/$2/x;

in MySQLConfig::_parse_varvals

Done

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 2:57 PM
Updated January 24, 2018 at 2:58 PM
Resolved January 24, 2018 at 2:58 PM

Flag notifications