From f28a1e3497b34928a2abae2d1f7ead23de7efebb Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Tue, 3 Nov 2015 13:49:55 -0800 Subject: [PATCH] Disable --analyze-before-swap if MySQL < 5.6. --- bin/pt-online-schema-change | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index f98dbca7..39f4fb6c 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -8177,11 +8177,9 @@ sub main { # ######################################################################## my $analyze_table = $o->get('analyze-before-swap'); if ( $o->got('analyze-before-swap') ) { - # User specified - # so respect their wish. If --analyze-before-swap, do it regardless of - # MySQL version and innodb_stats_peristent. If --no-analyze-before-swap, - # don't do it. - $analyze_table = $o->get('analyze-before-swap'); + # User specified so respect their wish. If --analyze-before-swap, do it + # regardless of MySQL version and innodb_stats_peristent. + # If --no-analyze-before-swap, don't do it. PTDEBUG && _d('User specified explicit --analyze-before-swap:', ($analyze_table ? 'on' : 'off')); } @@ -8199,6 +8197,9 @@ sub main { PTDEBUG && _d('innodb_stats_peristent is OFF, disabling --analyze-before-swap'); $analyze_table = 0; } + } else { + PTDEBUG && _d('MySQL < 5.6, disabling --analyze-before-swap'); + $analyze_table = 0; } }