From 9bff1b4e3e889e6da6ea925ccb4d59e2439fd19d Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Thu, 1 Mar 2012 18:03:05 -0800 Subject: [PATCH 1/3] Check and die if pt-table-checksum ran with DBD::mysql v4.014. --- bin/pt-table-checksum | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 5d709291..1dd0868e 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -7383,6 +7383,18 @@ sub _d { # ############################################################################ # Run the program. # ############################################################################ + +# https://bugs.launchpad.net/percona-toolkit/+bug/916999 +# http://www.mysqlperformanceblog.com/2012/02/21/dbd-mysql-4-014-breaks-pt-table-checksum-2-0/ +eval { + require DBD::mysql; + if ( ($DBD::mysql::VERSION || '') eq '4.014' ) { + die "DBD::mysql v4.014 is installed but it has as bug which prevents " + . "pt-table-checksum 2.0 from working properly. Please upgrade " + . "DBD::mysql to any new version.\n" + } +}; + if ( !caller ) { exit main(@ARGV); } 1; # Because this is a module as well as a script. From 681a45b7beef0a421ae44abf83cb8a698d800762 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Fri, 2 Mar 2012 07:46:18 -0800 Subject: [PATCH 2/3] Don't catch our own die. --- bin/pt-table-checksum | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 1dd0868e..7b471481 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -7388,12 +7388,12 @@ sub _d { # http://www.mysqlperformanceblog.com/2012/02/21/dbd-mysql-4-014-breaks-pt-table-checksum-2-0/ eval { require DBD::mysql; - if ( ($DBD::mysql::VERSION || '') eq '4.014' ) { - die "DBD::mysql v4.014 is installed but it has as bug which prevents " - . "pt-table-checksum 2.0 from working properly. Please upgrade " - . "DBD::mysql to any new version.\n" - } }; +if ( !$EVAL_ERROR && $DBD::mysql::VERSION eq "4.014" ) { + die "DBD::mysql v4.014 is installed but it has as bug which prevents " + . "pt-table-checksum 2.0 from working properly. Please upgrade " + . "DBD::mysql to any new version.\n" +} if ( !caller ) { exit main(@ARGV); } From b989b7c4c896c2dc436c6b75d2106f16065af71a Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Fri, 2 Mar 2012 07:51:28 -0800 Subject: [PATCH 3/3] Tweak error message. --- bin/pt-table-checksum | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 7b471481..62cf48f5 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -7390,9 +7390,9 @@ eval { require DBD::mysql; }; if ( !$EVAL_ERROR && $DBD::mysql::VERSION eq "4.014" ) { - die "DBD::mysql v4.014 is installed but it has as bug which prevents " - . "pt-table-checksum 2.0 from working properly. Please upgrade " - . "DBD::mysql to any new version.\n" + die "DBD::mysql v4.014 is installed, but it has as bug which causes " + . "pt-table-checksum to fail. Please upgrade DBD::mysql to any " + . "newer version.\n" } if ( !caller ) { exit main(@ARGV); }