diff --git a/bin/pt-stalk b/bin/pt-stalk index cb3e5e5c..80dfc508 100755 --- a/bin/pt-stalk +++ b/bin/pt-stalk @@ -909,7 +909,8 @@ collect() { local curr_time=$start_time local ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \ | sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/') - if [ $ps_instrumentation_enabled != "yes" ]; then + + if [ $ps_instrumentation_enabled != "yes"]; then log "Performance Schema instrumentation is disabled" fi @@ -955,7 +956,7 @@ collect() { (echo $ts; transactions) >>"$d/$p-transactions" & fi - if [ $ps_instrumentation_enabled == "yes" ]; then + if [ [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes"] ]; then ps_locks_transactions "$d/$p-ps-locks-transactions" fi diff --git a/lib/bash/collect.sh b/lib/bash/collect.sh index 8f68a615..e3a3cb0c 100644 --- a/lib/bash/collect.sh +++ b/lib/bash/collect.sh @@ -194,7 +194,8 @@ collect() { local curr_time=$start_time local ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \ | sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/') - if [ $ps_instrumentation_enabled != "yes" ]; then + + if [ $ps_instrumentation_enabled != "yes"]; then log "Performance Schema instrumentation is disabled" fi @@ -247,7 +248,7 @@ collect() { (echo $ts; transactions) >>"$d/$p-transactions" & fi - if [ $ps_instrumentation_enabled == "yes" ]; then + if [ [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes"] ]; then ps_locks_transactions "$d/$p-ps-locks-transactions" fi