diff --git a/make_db b/make_db index c4f653f6ba5cc8ad9707443c5e0e99eb9e0c613f..1d1e7d79f1a631a49316e9f0e22f76302c66ad54 100755 --- a/make_db +++ b/make_db @@ -67,7 +67,7 @@ function _execute_tests () { # options: [--fresh] function _install_unit_test_database () { DATABASE_NAME=$UNITTEST_DATABASE - if _db_exists "$SQL" "$DATABASE_NAME"; then + if _db_exists "$DATABASE_NAME"; then if [[ "$1" == "--fresh" ]] ; then drop "$DATABASE_NAME" ; else @@ -91,7 +91,7 @@ function _install_unit_test_database () { # install test framework MyTAP if not installed function _setup_mytap() { - if _db_exists "$SQL" "tap" ; then + if _db_exists "tap" ; then echo MyTAB framework is already installed [OK] return 0 fi @@ -201,9 +201,9 @@ function drop() { # Returns 0 or non-zero, depending on whether the database exists already. -# Optional parameters: [SQL [DATABASE_NAME]] +# Optional parameter: [DATABASE_NAME] function _db_exists() { - ${1-${SQL}} -D "${2-${DATABASE_NAME}}" -e "show tables;" > /dev/null 2>&1 \ + $SQL -D "${1-${DATABASE_NAME}}" -e "show tables;" > /dev/null 2>&1 \ && return 0 || return 1 }