Skip to content
Snippets Groups Projects
Unverified Commit 479e4681 authored by Daniel's avatar Daniel
Browse files

STY: Bash style changes to utils/make_db.

parent 7c496e09
No related branches found
No related tags found
No related merge requests found
......@@ -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};\"'"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment