mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-08 11:07:58 +00:00
Fix get_tables() for LOAD DATA.
This commit is contained in:
@@ -98,7 +98,7 @@ sub get_tables {
|
||||
|
||||
# These keywords may appear between UPDATE or SELECT and the table refs.
|
||||
# They need to be removed so that they are not mistaken for tables.
|
||||
$query =~ s/ (?:LOW_PRIORITY|IGNORE|STRAIGHT_JOIN|DELAYED) / /ig;
|
||||
$query =~ s/(?:LOW_PRIORITY|IGNORE|STRAIGHT_JOIN|DELAYED)\s+/ /ig;
|
||||
|
||||
# Another special case: LOCK TABLES tbl [[AS] alias] READ|WRITE, etc.
|
||||
# We strip the LOCK TABLES stuff and append "FROM" to fake a SELECT
|
||||
@@ -116,11 +116,16 @@ sub get_tables {
|
||||
|
||||
# INSERT and REPLACE without INTO
|
||||
# https://bugs.launchpad.net/percona-toolkit/+bug/984053
|
||||
if ( $query =~ m/\A\s*(?:INSERT|REPLACE)\s+(?!INTO)/i ) {
|
||||
if ( $query =~ m/\A\s*(?:INSERT|REPLACE)(?!\s+INTO)/i ) {
|
||||
# Add INTO so the reset of the code work as usual.
|
||||
$query =~ s/\A\s*((?:INSERT|REPLACE))\s+/$1 INTO /i;
|
||||
}
|
||||
|
||||
if ( $query =~ m/\A\s*LOAD DATA/i ) {
|
||||
my ($tbl) = $query =~ m/INTO TABLE\s+(\S+)/i;
|
||||
return $tbl;
|
||||
}
|
||||
|
||||
my @tables;
|
||||
foreach my $tbls ( $query =~ m/$tbl_regex/gio ) {
|
||||
PTDEBUG && _d('Match tables:', $tbls);
|
||||
|
Reference in New Issue
Block a user