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
This commit is contained in:
Dieter Adriaenssens
2019-01-09 16:37:40 +01:00
committed by GitHub
parent a59993182f
commit 5487319fd1

View File

@@ -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,