mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-26 01:02:25 +08:00
Missing /g in a Quoter regex
This commit is contained in:
@@ -2712,7 +2712,7 @@ sub split_unquote {
|
|||||||
next unless $_;
|
next unless $_;
|
||||||
s/\A`//;
|
s/\A`//;
|
||||||
s/`\z//;
|
s/`\z//;
|
||||||
s/``/`/;
|
s/``/`/g;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($db, $tbl);
|
return ($db, $tbl);
|
||||||
|
|||||||
+1
-1
@@ -102,7 +102,7 @@ sub split_unquote {
|
|||||||
next unless $_;
|
next unless $_;
|
||||||
s/\A`//;
|
s/\A`//;
|
||||||
s/`\z//;
|
s/`\z//;
|
||||||
s/``/`/;
|
s/``/`/g;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($db, $tbl);
|
return ($db, $tbl);
|
||||||
|
|||||||
@@ -89,6 +89,21 @@ is_deeply(
|
|||||||
'splits with a db',
|
'splits with a db',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
is_deeply(
|
||||||
|
[$q->split_unquote("`db`.`tb``l```")],
|
||||||
|
[qw(db tb`l`)],
|
||||||
|
'splits with a quoted db.tbl ad embedded quotes',
|
||||||
|
);
|
||||||
|
|
||||||
|
TODO: {
|
||||||
|
local $::TODO = "Embedded periods not yet supported";
|
||||||
|
is_deeply(
|
||||||
|
[$q->split_unquote("`d.b`.`tbl`")],
|
||||||
|
[qw(d.b tbl)],
|
||||||
|
'splits with embedded periods: `d.b`.`tbl`',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
is( $q->literal_like('foo'), "'foo'", 'LIKE foo');
|
is( $q->literal_like('foo'), "'foo'", 'LIKE foo');
|
||||||
is( $q->literal_like('foo_bar'), "'foo\\_bar'", 'LIKE foo_bar');
|
is( $q->literal_like('foo_bar'), "'foo\\_bar'", 'LIKE foo_bar');
|
||||||
is( $q->literal_like('foo%bar'), "'foo\\%bar'", 'LIKE foo%bar');
|
is( $q->literal_like('foo%bar'), "'foo\\%bar'", 'LIKE foo%bar');
|
||||||
|
|||||||
Reference in New Issue
Block a user