Uploaded image for project: 'ProxySQL Admin Scripts'
  1. ProxySQL Admin Scripts
  2. PSQLADM-120

/bin/proxysql_galera_checker: line 514: $7: unbound variable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 1.4.10
    • Fix Version/s: 1.4.12
    • Component/s: None
    • Labels:
      None

      Description

      A variable is not initialized, based on my understanding of the script does not initialize $7.

      $ grep change_server_status proxysql_galera_checker
      function change_server_status() {
       change_server_status $LINENO $HOSTGROUP_WRITER_ID "$server" $port "OFFLINE_SOFT" "$rdstat" \
       change_server_status $LINENO $HOSTGROUP_WRITER_ID "$server" $port "ONLINE" "$rdstat" \
       change_server_status $LINENO $HOSTGROUP_WRITER_ID "$server" $port "OFFLINE_SOFT" "" \
       change_server_status $LINENO $HOSTGROUP_WRITER_ID "$server" $port "ONLINE" "$rdstat"\
       change_server_status $LINENO $HOSTGROUP_WRITER_ID "$server" $port "OFFLINE_SOFT" "" \
       change_server_status $LINENO $HOSTGROUP_WRITER_ID "$server" $port "OFFLINE_SOFT" "" \
       change_server_status $LINENO $HOSTGROUP_READER_ID "$server" $port "ONLINE" ""\
       change_server_status $LINENO $HOSTGROUP_READER_ID "$server" $port "OFFLINE_SOFT" ""\
       change_server_status $LINENO $HOSTGROUP_READER_ID "$server" $port "ONLINE" ""\
       change_server_status $LINENO $HOSTGROUP_READER_ID "$server" $port "OFFLINE_SOFT" ""\
       change_server_status $LINENO $HOSTGROUP_READER_ID "$server" $port "OFFLINE_SOFT" ""\
       change_server_status $LINENO $HOSTGROUP_WRITER_ID "$server" $port "ONLINE" ""\
       change_server_status $LINENO $HOSTGROUP_READER_ID "$server" $port "ONLINE" ""\
      
      $ grep -n -A12 'function change_server_status' proxysql_galera_checker
      507:function change_server_status() {
      508-  local lineno=$1
      509-  local hostgroup=$2
      510-  local server=$3
      511-  local port=$4
      512-  local status=$5
      513-  local reader_status=$6
      514-  local comment=$7
      515-

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                kenn.takara Kenn Takara
                Reporter:
                jericho.rivera Jericho Rivera
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 3 hours
                  3h