From fc182f1b07ad8199c6a1086bfd8bd1f2943dbe62 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 30 Oct 2024 12:13:21 +0100 Subject: tests: Update test db setup script for mariadb Mariadb now issues warnings when using the deprecated `mysql` binary. So we make sure to use the proper name for the binary depending on the actual DB engine installed. --- tests/create_test_db.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/create_test_db.sh b/tests/create_test_db.sh index b98f5e2a5..dc9122aa0 100755 --- a/tests/create_test_db.sh +++ b/tests/create_test_db.sh @@ -40,6 +40,7 @@ case $HZ_TEST_DB_TYPE in mariadb | mysql ) db_type="mysql" + db_binary=$HZ_TEST_DB_TYPE default_charset="utf8mb4" root_user="root" root_passwd="root" @@ -90,11 +91,11 @@ else echo -e "\n--------------" echo "Client version:" echo -e "--------------\n" - mysql --version + $db_binary --version - mysql -v -u $HZ_TEST_DB_ROOT_USER -p$HZ_TEST_DB_ROOT_PASS -Ns -e "SELECT VERSION();" + $db_binary -v -u $HZ_TEST_DB_ROOT_USER -p$HZ_TEST_DB_ROOT_PASS -Ns -e "SELECT VERSION();" - mysql -u $HZ_TEST_DB_ROOT_USER -p$HZ_TEST_DB_ROOT_PASS <<-EOSQL + $db_binary -u $HZ_TEST_DB_ROOT_USER -p$HZ_TEST_DB_ROOT_PASS <<-EOSQL DROP DATABASE IF EXISTS $HZ_TEST_DB_NAME; CREATE DATABASE $HZ_TEST_DB_NAME CHARACTER SET $HZ_TEST_DB_CHARSET; @@ -107,7 +108,7 @@ else echo -e "\n--------------" echo "Importing schema..." echo -e "--------------\n" - mysql -u $HZ_TEST_DB_USER -p$HZ_TEST_DB_PASS $HZ_TEST_DB_NAME < ./install/schema_mysql.sql - mysql -v -u $HZ_TEST_DB_ROOT_USER -p$HZ_TEST_DB_ROOT_PASS -Ns -e "show databases" - mysql -v -u $HZ_TEST_DB_USER -p$HZ_TEST_DB_PASS $HZ_TEST_DB_NAME -Ns -e "show tables" + $db_binary -u $HZ_TEST_DB_USER -p$HZ_TEST_DB_PASS $HZ_TEST_DB_NAME < ./install/schema_mysql.sql + $db_binary -v -u $HZ_TEST_DB_ROOT_USER -p$HZ_TEST_DB_ROOT_PASS -Ns -e "show databases" + $db_binary -v -u $HZ_TEST_DB_USER -p$HZ_TEST_DB_PASS $HZ_TEST_DB_NAME -Ns -e "show tables" fi -- cgit v1.2.3 From 4daba84223e00c4269219355eba7f0e7890d6fce Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 30 Oct 2024 12:35:08 +0100 Subject: Make phpcs a bit more lax... Allow spaces for indent, and newlines before braces. --- .phpcs.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.phpcs.xml b/.phpcs.xml index 0054e4cda..c9c9cdd57 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -48,6 +48,10 @@ + + + +