Skip to content

Commit

Permalink
MDEV-30275: mariadb names rather than mysql names should be used
Browse files Browse the repository at this point in the history
* mariadb-service-convert to use mariadbd-safe
* galera_recovery to use mariadbd
* mtr - wsrep use mariadb executables
* debian/mariadb-server.mariadb.init use mariadbd-safe
* debian/tests/smoke uses mariadb instead of mysql as client.

Co-Author: Daniel Black <daniel@mariadb.org>
  • Loading branch information
grooverdan committed Jan 3, 2023
1 parent fd6f19d commit c4938ea
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
8 changes: 7 additions & 1 deletion debian/mariadb-server-10.5.mariadb.init
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)

MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"

if [ ! -x /usr/bin/mariadbd-safe ]
then
log_failure_msg "/usr/bin/mariadbd-safe not found or executable! This SysV init script depends on it."
exit -1
fi

# priority can be overridden and "-s" adds output to stderr
ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mariadb -i"

Expand Down Expand Up @@ -118,7 +124,7 @@ case "${1:-''}" in
test -e /run/mysqld || install -m 755 -o mysql -g root -d /run/mysqld

# Start MariaDB!
/usr/bin/mysqld_safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER &
/usr/bin/mariadbd-safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER &

for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do
sleep 1
Expand Down
12 changes: 6 additions & 6 deletions debian/tests/smoke
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,28 @@ else
echo "Found systemctl, continuing smoke test.."
fi

mysql <<EOT
mariadb <<EOT
CREATE DATABASE testdatabase;
CREATE USER 'testuser'@'localhost' identified by 'testpassword';
GRANT ALL ON testdatabase.* TO 'testuser'@'localhost';
EOT

mysql testdatabase <<EOT
mariadb testdatabase <<EOT
CREATE TABLE foo (bar INTEGER);
INSERT INTO foo (bar) VALUES (41);
EOT

result=$(echo 'SELECT bar+1 FROM foo;'|mysql --batch --skip-column-names --user=testuser --password=testpassword testdatabase)
result=$(echo 'SELECT bar+1 FROM foo;'|mariadb --batch --skip-column-names --user=testuser --password=testpassword testdatabase)
if [ "$result" != "42" ]; then
echo "Unexpected result" >&2
exit 1
fi

mysql --user=testuser --password=testpassword testdatabase <<EOT
mariadb --user=testuser --password=testpassword testdatabase <<EOT
DROP TABLE foo;
EOT

mysql <<EOT
mariadb <<EOT
DROP DATABASE testdatabase;
DROP USER 'testuser'@'localhost';
EOT
Expand Down Expand Up @@ -89,7 +89,7 @@ if [ "$(dpkg-architecture -qDEB_HOST_ARCH_BITS)" != 32 ] &&
LOG=/var/lib/mysql/#rocksdb/LOG
# XXX: The server may only be started during the install of
# mariadb-server-10.5, which happens before that of the plugin.
[ -e $LOG ] || mysql -e "INSTALL PLUGIN RocksDB SONAME 'ha_rocksdb';"
[ -e $LOG ] || mariadb -e "INSTALL PLUGIN RocksDB SONAME 'ha_rocksdb';"
# XXX: rocksdb_supported_compression_types variable does not report ZSTD.

# Print RocksDB supported items so test log is easier to debug
Expand Down
8 changes: 4 additions & 4 deletions mysql-test/suite/wsrep/common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ sub check_wsrep_support() {
mtr_error("No SST scripts") unless $spath;
$ENV{PATH}="$spath:$ENV{PATH}";

# ADD mysql client library path to path so that wsrep_notify_cmd can find mysql
# client for loading the tables. (Don't assume each machine has mysql install)
my ($cpath) = grep { -f "$_/mysql"; } "$::bindir/scripts", $::path_client_bindir;
mtr_error("No scritps") unless $cpath;
# ADD mariadb client to path so that wsrep_notify_cmd can find mariadb
# client for loading the tables. (Don't assume each machine has mariadb installed)
my ($cpath) = grep { -f "$_/mariadb"; } "$::bindir/scripts", $::path_client_bindir;
mtr_error("No mariadb client found") unless $cpath;
$ENV{PATH}="$cpath:$ENV{PATH}" unless $cpath eq $spath;

# ADD my_print_defaults script path to path so that SST scripts can find it
Expand Down
2 changes: 1 addition & 1 deletion scripts/galera_recovery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ parse_arguments() {

wsrep_recover_position() {
# Redirect server's error log to the log file.
eval @sbindir@/mysqld $cmdline_args --user=$user --wsrep_recover \
eval @sbindir@/mariadbd $cmdline_args --user=$user --wsrep_recover \
--disable-log-error 2> "$log_file"
ret=$?
if [ $ret -ne 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/mariadb-service-convert
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

tz_old=$TZ

. /usr/bin/mysqld_safe --dry-run
. /usr/bin/mariadbd-safe --dry-run

echo "# converted using $0"
echo "#"
Expand Down

0 comments on commit c4938ea

Please sign in to comment.