mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-19 08:56:34 +00:00
Add func to col ident struct to fix QueryAdvisorRules.t.
This commit is contained in:
@@ -1299,8 +1299,9 @@ sub parse_identifier {
|
||||
return unless $type && $ident;
|
||||
PTDEBUG && _d("Parsing", $type, "identifier:", $ident);
|
||||
|
||||
my ($func, $expr);
|
||||
if ( $ident =~ m/^\w+\(/ ) { # Function like MIN(col)
|
||||
my ($func, $expr) = $ident =~ m/^(\w+)\(([^\)]*)\)/;
|
||||
($func, $expr) = $ident =~ m/^(\w+)\(([^\)]*)\)/;
|
||||
PTDEBUG && _d('Function', $func, 'arg', $expr);
|
||||
return { col => $ident } unless $expr; # NOW()
|
||||
$ident = $expr; # col from MAX(col)
|
||||
@@ -1340,6 +1341,10 @@ sub parse_identifier {
|
||||
}
|
||||
}
|
||||
|
||||
if ( $func ) {
|
||||
$ident_struct{func} = uc $func;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($type, "identifier struct:", Dumper(\%ident_struct));
|
||||
return \%ident_struct;
|
||||
}
|
||||
|
Reference in New Issue
Block a user