mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
bin/pt-mysql-summary: Enable set -u
This commit is contained in:
@@ -22,8 +22,7 @@ usage() {
|
|||||||
# See https://launchpad.net/percona-toolkit for more information.
|
# See https://launchpad.net/percona-toolkit for more information.
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
|
|
||||||
# pt-mysql-summary isn't ready for this yet.
|
set -u
|
||||||
# set -u
|
|
||||||
|
|
||||||
TMPDIR=""
|
TMPDIR=""
|
||||||
|
|
||||||
@@ -244,6 +243,9 @@ fuzzy_pct () {
|
|||||||
# which should be in $TMPDIR/percona-toolkit.
|
# which should be in $TMPDIR/percona-toolkit.
|
||||||
parse_mysqld_instances () {
|
parse_mysqld_instances () {
|
||||||
local file=$1
|
local file=$1
|
||||||
|
local socket=${socket:-""}
|
||||||
|
local port=${port:-""}
|
||||||
|
local datadir=${datadir:-""}
|
||||||
echo " Port Data Directory Socket"
|
echo " Port Data Directory Socket"
|
||||||
echo " ===== ========================== ======"
|
echo " ===== ========================== ======"
|
||||||
$AP_GREP '/mysqld ' $file | while read line; do
|
$AP_GREP '/mysqld ' $file | while read line; do
|
||||||
@@ -269,7 +271,7 @@ parse_mysqld_instances () {
|
|||||||
# interested in, in case there are multiple instances.
|
# interested in, in case there are multiple instances.
|
||||||
find_my_cnf_file() {
|
find_my_cnf_file() {
|
||||||
local file=$1
|
local file=$1
|
||||||
local port=$2
|
local port=${2:-""}
|
||||||
if test -n "$port" && $AP_GREP -- "/mysqld.*--port=$port" $file >/dev/null 2>&1 ; then
|
if test -n "$port" && $AP_GREP -- "/mysqld.*--port=$port" $file >/dev/null 2>&1 ; then
|
||||||
$AP_GREP -- "/mysqld.*--port=$port" $file \
|
$AP_GREP -- "/mysqld.*--port=$port" $file \
|
||||||
| $AP_AWK 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }' \
|
| $AP_AWK 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }' \
|
||||||
|
Reference in New Issue
Block a user