1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Merge pull request #331 from mariadb-corporation/MCOL-942

MCOL-942 - backported mysql rep fixes from 1.1
This commit is contained in:
benthompson15
2017-11-28 15:36:56 -06:00
committed by GitHub
7 changed files with 219 additions and 214 deletions

View File

@ -34,6 +34,7 @@ install(PROGRAMS post-install
myCnf-include-args.text
myCnf-exclude-args.text
columnstore.service
mariadb-command-line.sh
DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
install(FILES module DESTINATION ${ENGINE_LOCALDIR} COMPONENT platform)

View File

@ -0,0 +1,59 @@
#!/bin/bash
#
# $Id$
#
# generic MariaDB Columnstore Command Line script.
#
# Notes: This script gets run by ProcMon during installs and upgrades:
# check log for error
checkForError() {
grep ERROR /tmp/mariadb-command-line.log > /tmp/error.check
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
echo "ERROR: check log file: /tmp/mariadb-command-line.log"
rm -f /tmp/error.check
exit 1
fi
rm -f /tmp/error.check
}
prefix=/usr/local
installdir=$prefix/mariadb/columnstore
pwprompt=
for arg in "$@"; do
if [ `expr -- "$arg" : '--command='` -eq 10 ]; then
command1="`echo $arg | awk -F= '{print $2}'`"
command2="`echo $arg | awk -F= '{print $3}'`"
command=$command1"="$command2
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
installdir="`echo $arg | awk -F= '{print $2}'`"
prefix=`dirname $installdir`
elif [ `expr -- "$arg" : '--port='` -eq 7 ]; then
port="`echo $arg | awk -F= '{print $2}'`"
fi
done
test -f $installdir/post/functions && . $installdir/post/functions
>/tmp/mariadb-command-line.log
#
# Run command
#
echo "Run command" >>/tmp/mariadb-command-line.log
cat >/tmp/mariadb-command-line.sql <<EOD
$command;
EOD
cat /tmp/mariadb-command-line.sql >> /tmp/mariadb-command-line.log
$installdir/mysql/bin/mysql \
--defaults-extra-file=$installdir/mysql/my.cnf \
--user=root \
calpontsys < /tmp/mariadb-command-line.sql >> /tmp/mariadb-command-line.log 2>&1
checkForError
#alls good, 'OK' for success
echo "OK"
exit 0