Skip to content

Commit

Permalink
Merge pull request #1076 from schneider-felix/fix-mysql-scripts
Browse files Browse the repository at this point in the history
Pass command line arguments to mysql scripts
  • Loading branch information
domenkozar authored Apr 1, 2024
2 parents 76e2f35 + 6c88af5 commit c82b8ba
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/modules/services/mysql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,17 @@ in
MYSQL_TCP_PORT = toString cfg.settings.mysqld.port;
});

scripts.mysql.exec = "${mysqlWrapped}/bin/mysql";
scripts.mysql.exec = ''
${mysqlWrapped}/bin/mysql "$@"
'';

scripts.mysqladmin.exec = "${mysqladminWrapped}/bin/mysqladmin";
scripts.mysqladmin.exec = ''
${mysqladminWrapped}/bin/mysqladmin "$@"
'';

scripts.mysqldump.exec = "${mysqldumpWrapped}/bin/mysqldump";
scripts.mysqldump.exec = ''
${mysqldumpWrapped}/bin/mysqldump "$@"
'';

processes.mysql.exec = "${startScript}/bin/start-mysql";
processes.mysql-configure.exec = "${configureScript}/bin/configure-mysql";
Expand Down
10 changes: 9 additions & 1 deletion tests/mysql/.test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
set -e

wait_for_port 3306

# Wait for configure-mysql to finish.
sleep 5

# through unix_socket
mysql -e 'SELECT VERSION()'

# through tcp/ip
mysql -h 127.0.0.1 -udb -pdb -e 'SELECT VERSION()'
mysql -h "127.0.0.1" -udb -pdb -e 'SELECT VERSION()'

ping-mysql
4 changes: 4 additions & 0 deletions tests/mysql/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
};
};
};

scripts.ping-mysql.exec = ''
$DEVENV_PROFILE/bin/mysqladmin ping
'';
}

0 comments on commit c82b8ba

Please sign in to comment.