Handle IF [NOT] EXITS for ddl statements in distill.

This commit is contained in:
Daniel Nichter
2013-08-03 14:01:25 -07:00
parent cd6e41be0e
commit 9059853136
2 changed files with 16 additions and 0 deletions

View File

@@ -298,6 +298,8 @@ sub distill_verbs {
eval $QueryParser::tbl_ident;
my ( $dds ) = $query =~ /^\s*($QueryParser::data_def_stmts)\b/i;
if ( $dds) {
# https://bugs.launchpad.net/percona-toolkit/+bug/821690
$query =~ s/\s+IF(?:\s+NOT)?\s+EXISTS/ /i;
my ( $obj ) = $query =~ m/$dds.+(DATABASE|TABLE)\b/i;
$obj = uc $obj if $obj;
PTDEBUG && _d('Data def statment:', $dds, 'obj:', $obj);