pt-config-diff doesn't diff quoted strings properly

Bug #889739 reported by Simon J Mudd
6
This bug affects 1 person
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_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 ~]#

Related branches

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
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: New → Confirmed
Revision history for this message
Brian Fraser (fraserbn) wrote :

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

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
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-434

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.