Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-mysqlbackend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-mysqlbackend
Commits
b2da1f54
Commit
b2da1f54
authored
5 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: there was MYSQL_CMD and CMD_MYSQL; removed one
parent
8ad27d47
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
patches/patch20151022-0/patch.sh
+1
-1
1 addition, 1 deletion
patches/patch20151022-0/patch.sh
patches/utils/patch_header.sh
+3
-4
3 additions, 4 deletions
patches/utils/patch_header.sh
with
4 additions
and
5 deletions
patches/patch20151022-0/patch.sh
+
1
−
1
View file @
b2da1f54
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
patches/utils/patch_header.sh
+
3
−
4
View file @
b2da1f54
...
@@ -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
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment