From d589034b31e6d37d43d6ae787054b931e136fec0 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 30 Jul 2018 14:45:00 -0300 Subject: [PATCH] PT-1422 Improved MariaDB support in pt-mysql-summary --- bin/pt-mysql-summary | 3 +++ lib/bash/report_mysql_info.sh | 3 +++ t/pt-mysql-summary/pt-mysql-summary.t | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index 40f74e49..f5114cc1 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -1366,6 +1366,9 @@ summarize_processlist () { } \$1 == \"Time:\" { t = \$2; + if ( t == \"NULL\" ) { + t = 0; + } } \$1 == \"Command:\" { c = \$2; diff --git a/lib/bash/report_mysql_info.sh b/lib/bash/report_mysql_info.sh index a523ef1f..f3cde980 100644 --- a/lib/bash/report_mysql_info.sh +++ b/lib/bash/report_mysql_info.sh @@ -332,6 +332,9 @@ summarize_processlist () { } \$1 == \"Time:\" { t = \$2; + if ( t == \"NULL\" ) { + t = 0; + } } \$1 == \"Command:\" { c = \$2; diff --git a/t/pt-mysql-summary/pt-mysql-summary.t b/t/pt-mysql-summary/pt-mysql-summary.t index c9b15920..f2cfe44a 100644 --- a/t/pt-mysql-summary/pt-mysql-summary.t +++ b/t/pt-mysql-summary/pt-mysql-summary.t @@ -87,9 +87,13 @@ like( "InnoDB section present" ); +my $users_count = 2; +if ($ENV{FORK} eq 'mariadb') { + $users_count = 8; +} like( $out, - qr/Users \| 2/, + qr/Users \| $users_count/, "Security works" );