Commit e00090dd authored by 6543's avatar 6543
Browse files

services.mysql: make sql statements consistent uppercase

parent 534f90a2
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ in
                    ( echo 'CREATE DATABASE IF NOT EXISTS `${database.name}`;'

                      ${lib.optionalString (database.schema != null) ''
                        echo 'use `${database.name}`;'
                        echo 'USE `${database.name}`;'

                        # TODO: this silently falls through if database.schema does not exist,
                        # we should catch this somehow and exit, but can't do it here because we're in a subshell.
@@ -488,7 +488,7 @@ in
              ${lib.optionalString (cfg.replication.role == "master") ''
                # Set up the replication master

                ( echo "use mysql;"
                ( echo "USE mysql;"
                  echo "CREATE USER '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}' IDENTIFIED WITH mysql_native_password;"
                  echo "SET PASSWORD FOR '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}' = PASSWORD('${cfg.replication.masterPassword}');"
                  echo "GRANT REPLICATION SLAVE ON *.* TO '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}';"
@@ -498,9 +498,9 @@ in
              ${lib.optionalString (cfg.replication.role == "slave") ''
                # Set up the replication slave

                ( echo "stop slave;"
                  echo "change master to master_host='${cfg.replication.masterHost}', master_user='${cfg.replication.masterUser}', master_password='${cfg.replication.masterPassword}';"
                  echo "start slave;"
                ( echo "STOP SLAVE;"
                  echo "CHANGE MASTER TO MASTER_HOST='${cfg.replication.masterHost}', MASTER_USER='${cfg.replication.masterUser}', MASTER_PASSWORD='${cfg.replication.masterPassword}';"
                  echo "START SLAVE;"
                ) | ${cfg.package}/bin/mysql -u ${superUser} -N
              ''}