Skip to content

Commit

Permalink
Repalce mysql names with mariadb (depricated)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-suse committed Nov 24, 2023
1 parent 4f3477a commit 3d5f508
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion product/ma/local/init_datadir.sh.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ set -e

eatmydata=$(which eatmydata 2>/dev/null) || :

$eatmydata mysql_install_db --no-defaults --data=__datadir --log-error=__workdir/.install | head -n 10
$eatmydata mariadb-install-db --no-defaults --data=__datadir --log-error=__workdir/.install | head -n 10
12 changes: 6 additions & 6 deletions product/ma/local/sql.sh.m4
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
if [[ $1 == -* ]] ; then
mysql --batch --socket=__workdir/.sock "$@"
mariadb --batch --socket=__workdir/.sock "$@"
elif [ -z "$2" ]; then
if [ "$(basename $0)" == sql ]; then
if [ -f __workdir/default_db.cnf ] && [ "$#" == 1 ]; then
mysql "$(cat __workdir/default_db.cnf)" --batch --socket=__workdir/.sock -Ne "$*"
mariadb "$(cat __workdir/default_db.cnf)" --batch --socket=__workdir/.sock -Ne "$*"
else
mysql --batch --socket=__workdir/.sock -Ne "$*"
mariadb --batch --socket=__workdir/.sock -Ne "$*"
fi
else
db=${0#*_}
if [ "$#" == 0 ]; then
mysql "$db" --socket=__workdir/.sock
mariadb "$db" --socket=__workdir/.sock
else
mysql $db --socket=__workdir/.sock --batch -Ne "$@"
mariadb $db --socket=__workdir/.sock --batch -Ne "$@"
fi
fi
else
db=$1
shift
mysql "$db" --batch --socket=__workdir/.sock -Ne "$@"
mariadb "$db" --batch --socket=__workdir/.sock -Ne "$@"
fi
9 changes: 7 additions & 2 deletions product/ma/local/start.sh.m4
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -e

/usr/sbin/mariadbd --datadir=__datadir --user=$USER --socket=__workdir/.sock --skip-networking --log-error=__workdir/.cerr --pid-file=__workdir/.pid "$@" &

sleep 1
__workdir/status >& /dev/null || sleep 1
sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 0.1
__workdir/status >& /dev/null || sleep 1
2 changes: 1 addition & 1 deletion product/ma/local/status.sh.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mysqladmin --socket=__workdir/.sock status
mariadbadmin --socket=__workdir/.sock status
2 changes: 1 addition & 1 deletion product/ma/local/stop.sh.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mysqladmin --socket=__workdir/.sock shutdown
mariadbadmin --socket=__workdir/.sock shutdown

0 comments on commit 3d5f508

Please sign in to comment.