mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-21 11:30:24 +00:00
Fix for 823431: pt-query-advisor hangs on big queries
This was caused by a regex backtracking itself to a halt. The solution was to add a positive lookahead that searches for the floating but mandatory substrings that the regex needs; if those exist, then eventually it will match, but if they don't, it'll fail quickly.
This commit is contained in:
@@ -4490,6 +4490,7 @@ sub parse_insert {
|
||||
}
|
||||
|
||||
if ( my @into = ($query =~ m/
|
||||
(?=VALUE|SE(?:T|LECT)) # Avoid a backtracking explosion
|
||||
(?:INTO\s+)? # INTO, optional
|
||||
(.+?)\s+ # table ref
|
||||
(\([^\)]+\)\s+)? # column list, optional
|
||||
|
Reference in New Issue
Block a user