From 5487319fd1c0488104b904b35a4dd4bca5a80bb1 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Wed, 9 Jan 2019 16:37:40 +0100 Subject: [PATCH] PT-1633 fix incorrect parsing of a variable with number + K,M,G,T This fixes bug https://jira.percona.com/browse/PT-1633 A regexp to convert numbers matches any variable ending in a number followed by character K, M, G or T, even if the variable contains other characters, fe. 'ibtmp1:12M:autoextend:max:5G'. This fix changes the regexp so it matches only those variables that contain only a number followed by K,M,G or T --- bin/pt-config-diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pt-config-diff b/bin/pt-config-diff index 1ffd97fb..042b5070 100755 --- a/bin/pt-config-diff +++ b/bin/pt-config-diff @@ -3244,7 +3244,7 @@ sub _process_val { $val =~ s/\s*#.*//; } - if ( my ($num, $factor) = $val =~ m/(\d+)([KMGT])b?$/i ) { + if ( my ($num, $factor) = $val =~ m/^(\d+)([KMGT])b?$/i ) { my %factor_for = ( k => 1_024, m => 1_048_576,