diff --git a/utils/make_db b/utils/make_db index 007b72bd2d9ff9d6a10d06c1c6ce202c733d3bd8..93a62ea2b9e6776a73b8298cbce1a54aa76e0f68 100755 --- a/utils/make_db +++ b/utils/make_db @@ -56,7 +56,10 @@ function _execute_tests () { for tfile in $TESTS ; do echo "Running $tfile" echo "----- $tfile -----" >> .TEST_RESULTS - cat $tfile | $MYSQL_CMD -D $UNITTEST_DATABASE $(get_db_args_nodb) --disable-pager --batch --raw --skip-column-names --unbuffered >> .TEST_RESULTS 2>&1 + < $tfile $MYSQL_CMD \ + -D $UNITTEST_DATABASE $(get_db_args_nodb) --disable-pager \ + --batch --raw --skip-column-names --unbuffered \ + >> .TEST_RESULTS 2>&1 done; popd @@ -70,7 +73,7 @@ function _execute_tests () { # optional parameter: [--fresh] for installing a fresh data base. Otherwise an existing one would be reused. function _install_unit_test_database () { DATABASE_NAME=$UNITTEST_DATABASE - if [[ "$1" == "--fresh" ]] ; then + if [[ $1 = "--fresh" ]] ; then if _db_exists "$DATABASE_NAME"; then drop "$DATABASE_NAME" ; fi @@ -144,7 +147,7 @@ function grant() { echo read -p "Please repeat the password: " -s password2 echo - [[ "$password" == "$password2" ]] && { + [[ "$password" = "$password2" ]] && { DATABASE_USER_PW="$password" break } @@ -152,10 +155,10 @@ function grant() { done fi - if [[ "$1" == "--strict" ]] ; then + if [[ $1 = "--strict" ]] ; then for host in ${DATABASE_USER_HOST_LIST//,/ } ; do CMD="SELECT COUNT(*) FROM mysql.user WHERE user='${DATABASE_USER}' AND host='${host}';" - [[ $($MYSQL_CMD $(get_mysql_args_nodb) -s -N -e "$CMD") == 0 ]] || { + [[ $($MYSQL_CMD $(get_mysql_args_nodb) -s -N -e "$CMD") = 0 ]] || { echo "The user '${DATABASE_USER}@${host}' is already in the database." echo "Please use another user or delete it, e.g. with" echo "'mysql -u ${MYSQL_USER} -p -e \"DROP USER ${DATABASE_USER}@${host};\"'"