wsrep_notify_cmd to use bash rather than sed
Bug #1291679 reported by
Daniel Black
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL patches by Codership |
New
|
Undecided
|
Unassigned | |||
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Confirmed
|
Wishlist
|
Unassigned | |||
5.6 |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
Having a notify_cmd example that shows explicitly where the uuid, name, incoming_address are and how to extract them without sed is useful.
I've also added a timestamp as minor enhancement.
There was also an excess ";' in the BEGIN.
There are DELETE FROM tables where the tables are only just created.
To allow for future changes of extra parameters in the script lets just omit them for now.
To post a comment you must log in.
Checked on PXC 5.5 and 5.6
{code}
BEGIN;
DELETE FROM $MEMB_TABLE;
DELETE FROM $STATUS_TABLE;
"
END="COMMIT;"
configuration_ change( )
{
echo "$BEGIN;"
local idx=0
for NODE in $(echo $MEMBERS | sed s/,/\ /g)
do
echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, "
# Don't forget to properly quote string values
echo "'$NODE'" | sed s/\\//\',\'/g
echo ");"
idx=$(( $idx + 1 ))
done
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
echo "$END"
}
{code}