Skip to content
Snippets Groups Projects
Commit b2da1f54 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: there was MYSQL_CMD and CMD_MYSQL; removed one

parent 8ad27d47
Branches
Tags
No related merge requests found
...@@ -35,7 +35,7 @@ fi ...@@ -35,7 +35,7 @@ fi
check_version $OLD_VERSION check_version $OLD_VERSION
function addIdx { function addIdx {
$CMD_MYSQL $MYSQL_CONNECTION -D $DATABASE -e "ALTER TABLE $1 ADD COLUMN pidx TINYINT UNSIGNED NOT NULL DEFAULT 0;" $MYSQL_CMD $MYSQL_CONNECTION -D $DATABASE -e "ALTER TABLE $1 ADD COLUMN pidx TINYINT UNSIGNED NOT NULL DEFAULT 0;"
} }
addIdx "reference_data" addIdx "reference_data"
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
# ** end header # ** end header
# #
#header for patch scripts #header for patch scripts
CMD_MYSQL=mysql
CMD_MYSQL_DUMP=mysqldump CMD_MYSQL_DUMP=mysqldump
USAGE="$1 [ --env=ENV_FILE ] [ --patch=PATCH ] [ --backupdir=BACKUPDIR ]\n\n" USAGE="$1 [ --env=ENV_FILE ] [ --patch=PATCH ] [ --backupdir=BACKUPDIR ]\n\n"
CMD_OPTIONS=cat <<EOF CMD_OPTIONS=cat <<EOF
...@@ -148,7 +147,7 @@ function uptodate { ...@@ -148,7 +147,7 @@ function uptodate {
# @param $1: db version string, e.g. v2.0.0 # @param $1: db version string, e.g. v2.0.0
# @return: 0 on success, 1 on failure # @return: 0 on success, 1 on failure
function check_version { function check_version {
local version=$($CMD_MYSQL $MYSQL_CONNECTION -B -e "Select CaosDBVersion();") local version=$($MYSQL_CMD $MYSQL_CONNECTION -B -e "Select CaosDBVersion();")
if [[ "$(echo $version | sed 's/^CaosDBVersion()\s//')" = "$1" ]]; then if [[ "$(echo $version | sed 's/^CaosDBVersion()\s//')" = "$1" ]]; then
return 0 return 0
fi fi
...@@ -168,7 +167,7 @@ function dump_table { ...@@ -168,7 +167,7 @@ function dump_table {
function mysql_execute { function mysql_execute {
set +e set +e
$CMD_MYSQL $MYSQL_CONNECTION -e "$1" $MYSQL_CMD $MYSQL_CONNECTION -e "$1"
ret=${PIPESTATUS[0]} ret=${PIPESTATUS[0]}
if [ "$ret" -ne 0 ]; then if [ "$ret" -ne 0 ]; then
failure "MYSQL ERROR" failure "MYSQL ERROR"
...@@ -177,6 +176,6 @@ function mysql_execute { ...@@ -177,6 +176,6 @@ function mysql_execute {
} }
function redo_table { function redo_table {
$CMD_MYSQL $MYSQL_CONNECTION < ${DATABASE_NAME}.${1}.${OLD_VERSION}.dump.sql $MYSQL_CMD $MYSQL_CONNECTION < ${DATABASE_NAME}.${1}.${OLD_VERSION}.dump.sql
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment