From e9461995347de6f9bd200dde26bf565580377b72 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Mon, 14 May 2012 11:39:40 -0600 Subject: [PATCH] Add --[no]drop-new-table. --- bin/pt-online-schema-change | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 29c84834..36ea055b 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -5419,6 +5419,12 @@ sub main { . "--swap-tables failed. To drop the new table, " . "execute:\n$sql\n"; } + elsif ( !$o->get('drop-new-table') ) { + # https://bugs.launchpad.net/percona-toolkit/+bug/998831 + print "Not dropping the new table $new_tbl->{name} because " + . "--no-drop-new-table was specified. To drop the new table, " + . "execute:\n$sql\n"; + } else { print "Dropping new table...\n"; print $sql, "\n" if $o->get('print'); @@ -7121,6 +7127,12 @@ short form: -F; type: string Only read mysql options from the given file. You must give an absolute pathname. +=item --[no]drop-new-table + +default: yes + +Drop the new table if copying the original table fails. + =item --[no]drop-old-table default: yes