From 48f642551e04abfd14d36dfd62b64c1df53c7b65 Mon Sep 17 00:00:00 2001 From: Baron Schwartz Date: Sun, 3 Jun 2012 20:53:57 -0400 Subject: [PATCH] fix some problems that happen when there are many mysqld instances --- lib/bash/collect_mysql_info.sh | 1 + t/lib/bash/collect_mysql_info.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/bash/collect_mysql_info.sh b/lib/bash/collect_mysql_info.sh index 79355e61..27b30757 100644 --- a/lib/bash/collect_mysql_info.sh +++ b/lib/bash/collect_mysql_info.sh @@ -43,6 +43,7 @@ collect_mysqld_instances () { echo "internal::oom_of_$pid $oom" >> "$variables_file" done + pids="$pids" pids="$(echo $pids | sed -e 's/ /,/g')" ps ww -p "$pids" 2>/dev/null else diff --git a/t/lib/bash/collect_mysql_info.sh b/t/lib/bash/collect_mysql_info.sh index bfde7628..5cf8a84b 100644 --- a/t/lib/bash/collect_mysql_info.sh +++ b/t/lib/bash/collect_mysql_info.sh @@ -31,7 +31,9 @@ file_count=$(ls "$p" | wc -l) is $file_count 14 "Creates the correct number of files (without --databases)" awk '{print $1}' "$p/mysqld-instances" > "$TMPDIR/collect_mysqld_instances1.test" -ps ww -p "$(_pidof mysqld | sed -e "s/ /,/g")" | awk '{print $1}' > "$TMPDIR/collect_mysqld_instances2.test" +pids="$(_pidof mysqld)" +pids="$(echo $pids | sed -e "s/[ \n]/,/g")" +ps ww -p "$pids" | awk '{print $1}' > "$TMPDIR/collect_mysqld_instances2.test" no_diff \ "$TMPDIR/collect_mysqld_instances1.test" \