pt-config-diff doesn't diff quoted strings properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Brian Fraser |
Bug Description
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_
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-
Though not relevant in this case, the version of mysql used is:
[root@server ~]# rpm -qa | grep MySQL
MySQL-client-
MySQL-server-
[root@server ~]#
Related branches
- Daniel Nichter: Approve
-
Diff: 85 lines (+40/-2)3 files modifiedbin/pt-config-diff (+7/-0)
lib/MySQLConfig.pm (+7/-0)
t/lib/MySQLConfigComparer.t (+26/-2)
tags: | added: pt-cong |
tags: |
added: pt-config-diff removed: pt-cong |
summary: |
- quoted strings in my.cnf not treated properly + pt-config-diff doesn't diff quoted strings properly |
Changed in percona-toolkit: | |
status: | New → Confirmed |
Changed in percona-toolkit: | |
status: | Confirmed → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Brian Fraser (fraserbn) |
milestone: | none → 2.1.3 |
tags: | added: wrong-output |
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
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