mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-01-21 02:13:27 +08:00
Total fix for LOAD DATA distill in pqd.
This commit is contained in:
@@ -8269,7 +8269,7 @@ sub get_tables {
|
||||
return ($tbl);
|
||||
}
|
||||
|
||||
$query =~ s/ (?:LOW_PRIORITY|IGNORE|STRAIGHT_JOIN|DELAYED) / /ig;
|
||||
$query =~ s/(?:LOW_PRIORITY|IGNORE|STRAIGHT_JOIN|DELAYED)\s+/ /ig;
|
||||
|
||||
if ( $query =~ s/^\s*LOCK TABLES\s+//i ) {
|
||||
PTDEBUG && _d('Special table type: LOCK TABLES');
|
||||
@@ -8282,10 +8282,15 @@ sub get_tables {
|
||||
$query =~ s/".*?"/?/sg; # quoted strings
|
||||
$query =~ s/'.*?'/?/sg; # quoted strings
|
||||
|
||||
if ( $query =~ m/\A\s*(?:INSERT|REPLACE)\s+(?!INTO)/i ) {
|
||||
if ( $query =~ m/\A\s*(?:INSERT|REPLACE)(?!\s+INTO)/i ) {
|
||||
$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);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
# Query 1: 0.20 QPS, 0.00x concurrency, ID 0xD989521B246E945B at byte 146
|
||||
# Query 1: 0.20 QPS, 0.00x concurrency, ID 0x14354E1D979884B4 at byte 152
|
||||
# This item is included in the report because it matches --limit.
|
||||
# Scores: V/M = 0.00
|
||||
# Time range: 2007-12-18 11:48:27 to 11:48:37
|
||||
@@ -10,7 +10,7 @@
|
||||
# Lock time 0 0 0 0 0 0 0 0
|
||||
# Rows sent 0 0 0 0 0 0 0 0
|
||||
# Rows examine 0 0 0 0 0 0 0 0
|
||||
# Query size 100 86 43 43 43 43 0 43
|
||||
# Query size 100 98 49 49 49 49 0 49
|
||||
# Query_time distribution
|
||||
# 1us
|
||||
# 10us ################################################################
|
||||
@@ -23,9 +23,9 @@
|
||||
# Tables
|
||||
# SHOW TABLE STATUS FROM `db` LIKE 'tbl'\G
|
||||
# SHOW CREATE TABLE `db`.`tbl`\G
|
||||
LOAD DATA INFILE '/tmp/bar.txt' INTO db.tbl\G
|
||||
LOAD DATA INFILE '/tmp/bar.txt' INTO TABLE db.tbl\G
|
||||
|
||||
# Profile
|
||||
# Rank Query ID Response time Calls R/Call V/M Item
|
||||
# ==== ================== ============= ===== ====== ===== ======
|
||||
# 1 0xD989521B246E945B 0.0000 100.0% 2 0.0000 0.00 db.tbl
|
||||
# ==== ================== ============= ===== ====== ===== ===============
|
||||
# 1 0x14354E1D979884B4 0.0000 100.0% 2 0.0000 0.00 LOAD DATA db.tbl
|
||||
|
||||
@@ -82,8 +82,8 @@ replace `foo` values("bar")\G
|
||||
# 1s
|
||||
# 10s+
|
||||
# Tables
|
||||
# SHOW TABLE STATUS FROM `db` LIKE 'table'\G
|
||||
# SHOW CREATE TABLE `db`.`table`\G
|
||||
# SHOW TABLE STATUS FROM `db` LIKE 'foo'\G
|
||||
# SHOW CREATE TABLE `db`.`foo`\G
|
||||
load data local infile '/tmp/foo.txt' into table `foo`\G
|
||||
|
||||
# Profile
|
||||
|
||||
Reference in New Issue
Block a user