Skip to content

Commit

Permalink
MDEV-22010: use executables MariaDB named in scripts
Browse files Browse the repository at this point in the history
As a part of this MDEV following changes were made:
1) Mariadb named executables used instead of mysql named executables in scripts
2) renamed mysql-test-run and mysql-stress-test to mariadb-test-run and
mariadb-stress-test and created a symlink.
  • Loading branch information
mariadb-RuchaDeodhar committed Jun 14, 2021
1 parent cb0cad8 commit 193bfdd
Show file tree
Hide file tree
Showing 17 changed files with 113 additions and 69 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ mysql-test/lib/My/SafeProcess/my_safe_process
mysql-test/lib/My/SafeProcess/wsrep_check_version
mysql-test/mtr
mysql-test/mysql-test-run
mysql-test/mariadb-test-run
mysql-test/mysql-stress-test.pl
mysql-test/mysql-test-run.pl
mysql-test/var*
mysql-test-gcov.err
mysql-test-gcov.msg
Expand Down
4 changes: 2 additions & 2 deletions debian/mariadb-test.install
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ usr/share/man/man1/mariadb-client-test-embedded.1
usr/share/man/man1/mariadb-client-test.1
usr/share/man/man1/mariadb-test-embedded.1
usr/share/man/man1/mariadb-test.1
usr/share/man/man1/mysql-stress-test.pl.1
usr/share/man/man1/mysql-test-run.pl.1
usr/share/man/man1/mysql_client_test.1
usr/share/man/man1/mysql_client_test_embedded.1
Expand All @@ -36,8 +35,9 @@ usr/share/mysql/mysql-test/README-gcov
usr/share/mysql/mysql-test/README.stress
usr/share/mysql/mysql-test/dgcov.pl
usr/share/mysql/mysql-test/lib
usr/share/mysql/mysql-test/mysql-stress-test.pl
usr/share/mysql/mysql-test/mariadb-stress-test.pl
usr/share/mysql/mysql-test/mysql-test-run.pl
usr/share/mysql/mysql-test/mariadb-test-run.pl
usr/share/mysql/mysql-test/purify.supp
usr/share/mysql/mysql-test/suite.pm
usr/share/mysql/mysql-test/valgrind.supp
6 changes: 4 additions & 2 deletions debian/mariadb-test.links
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ usr/bin/mariadb-client-test usr/bin/mysql_client_test
usr/bin/mariadb-client-test-embedded usr/bin/mysql_client_test_embedded
usr/bin/mariadb-test usr/bin/mysqltest
usr/bin/mariadb-test-embedded usr/bin/mysqltest_embedded
usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/mtr
usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/mysql-test-run
usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run.pl
usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run
usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mtr
usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mariadb-test-run
64 changes: 51 additions & 13 deletions mysql-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,63 @@ INSTALL_MYSQL_TEST("." ".")
IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
# Enable running mtr from build directory
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/mtr.out-of-source
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run.pl
${CMAKE_CURRENT_SOURCE_DIR}/mtr.out-of-source
${CMAKE_CURRENT_BINARY_DIR}/mariadb-test-run.pl
@ONLY
)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/mariadb-stress-test.pl
${CMAKE_CURRENT_BINARY_DIR}/mariadb-stress-test.pl
@ONLY
)
IF(WIN32)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/mtr.out-of-source
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run.pl
@ONLY)
ENDIF()
SET(out_of_source_build TRUE)
ELSEIF(WIN32)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/mariadb-test-run.pl
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run.pl
COPYONLY)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/mariadb-stress-test.pl
${CMAKE_CURRENT_BINARY_DIR}/mysql-stress-test.pl
COPYONLY)
ENDIF()

IF(UNIX)
EXECUTE_PROCESS(
COMMAND chmod +x mysql-test-run.pl
COMMAND ${CMAKE_COMMAND} -E create_symlink
./mysql-test-run.pl mtr
COMMAND ${CMAKE_COMMAND} -E create_symlink
./mysql-test-run.pl mysql-test-run
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
IF(INSTALL_MYSQLTESTDIR AND out_of_source_build)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run
COMMAND chmod +x mariadb-test-run.pl
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
FOREACH (lnk mysql-test-run mtr mysql-test-run.pl mariadb-test-run)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E create_symlink
./mariadb-test-run.pl ${lnk}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

IF(INSTALL_MYSQLTESTDIR)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${lnk}
DESTINATION ${INSTALL_MYSQLTESTDIR}
COMPONENT Test)
ENDIF()
ENDFOREACH()
EXECUTE_PROCESS(
COMMAND chmod +x mariadb-stress-test.pl
COMMAND ${CMAKE_COMMAND} -E create_symlink
./mariadb-stress-test.pl mysql-stress-test.pl
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
ELSE()
IF(INSTALL_MYSQLTESTDIR)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mariadb-test-run.pl
RENAME mysql-test-run.pl
DESTINATION ${INSTALL_MYSQLTESTDIR}
COMPONENT Test)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mariadb-stress-test.pl
RENAME mysql-stress-test.pl
DESTINATION ${INSTALL_MYSQLTESTDIR}
COMPONENT Test)
ENDIF()
Expand Down Expand Up @@ -156,4 +195,3 @@ IF (MAX_INDEXES)
MESSAGE(STATUS "mysql-test/include/max_indexes.inc adjusted")
ENDIF()
ENDIF()

2 changes: 1 addition & 1 deletion mysql-test/lib/mtr_stress.pl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ ()
}

mtr_init_args(\$args);
mtr_add_args($args, "$::glob_mysql_test_dir/mysql-stress-test.pl");
mtr_add_args($args, "$::glob_mysql_test_dir/mariadb-stress-test.pl");
mtr_add_arg($args, "--server-socket=%s", $::master->[0]->{'path_sock'});
mtr_add_arg($args, "--server-user=%s", $::opt_user);
mtr_add_arg($args, "--server-database=%s", "test");
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/lib/v1/mtr_stress.pl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ ()
}

#Run stress test
mtr_run("$::glob_mysql_test_dir/mysql-stress-test.pl", $args, "", "", "", "");
mtr_run("$::glob_mysql_test_dir/mariadb-stress-test.pl", $args, "", "", "", "");
if ( ! $::glob_use_embedded_server )
{
stop_all_servers();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

BEGIN {
# Check that mysql-test-run.pl is started from mysql-test/
unless ( -f "mysql-test-run.pl" )
unless ( -f "mariadb-test-run.pl" )
{
print "**** ERROR **** ",
"You must start mysql-test-run from the mysql-test/ directory\n";
Expand All @@ -57,10 +57,10 @@ BEGIN
if ( $version == 1 )
{
print "=======================================================\n";
print " WARNING: Using mysql-test-run.pl version 1! \n";
print " WARNING: Using mariadb-test-run.pl version 1! \n";
print "=======================================================\n";
# Should use exec() here on *nix but this appears not to work on Windows
exit(system($^X, "lib/v1/mysql-test-run.pl", @ARGV) >> 8);
exit(system($^X, "lib/v1/mariadb-test-run.pl", @ARGV) >> 8);
}
elsif ( $version == 2 )
{
Expand All @@ -69,7 +69,7 @@ BEGIN
}
else
{
print "ERROR: Version $version of mysql-test-run does not exist!\n";
print "ERROR: Version $version of mariadb-test-run does not exist!\n";
exit(1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/mtr.out-of-source
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Call mtr in out-of-source build
$ENV{MTR_BINDIR} = '@CMAKE_BINARY_DIR@';
chdir('@CMAKE_SOURCE_DIR@/mysql-test');
exit(system($^X, '@CMAKE_SOURCE_DIR@/mysql-test/mysql-test-run.pl', @ARGV) >> 8);
exit(system($^X, '@CMAKE_SOURCE_DIR@/mysql-test/mariadb-test-run.pl', @ARGV) >> 8);
2 changes: 1 addition & 1 deletion mysql-test/suite/stress/t/wrapper.test
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ EOF
--source $MYSQL_TMP_DIR/mtest.inc
--remove_file $MYSQL_TMP_DIR/mtest.inc

exec perl mysql-stress-test.pl --mysqltest=$MYSQLTEST_BIN
exec perl mariadb-stress-test.pl --mysqltest=$MYSQLTEST_BIN
--server-port=$MASTER_MYPORT --server-socket=$MASTER_MYSOCK
--server-user=root --cleanup
--server-logs-dir=$MYSQLTEST_VARDIR/log
Expand Down
8 changes: 4 additions & 4 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,27 +146,27 @@ IF(UNIX)
# FIND_PROC and CHECK_PID are used by mysqld_safe
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET (FIND_PROC
"ps wwwp $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
"ps wwwp $PID | grep -vE mariadbd-safe -vE mysqld_safe | grep -- $MYSQLD > /dev/null")
ENDIF()
IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS")
SET (FIND_PROC
"ps -p $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
"ps -p $PID | grep -v mariadbd-safe | grep -- $MYSQLD > /dev/null")
ENDIF()

IF(NOT FIND_PROC)
# BSD style
EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
IF(result MATCHES 0)
SET( FIND_PROC
"ps -uaxww | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
"ps -uaxww | grep -v mariadbd-safe | grep -- $MYSQLD | grep $PID > /dev/null")
ENDIF()
ENDIF()

IF(NOT FIND_PROC)
# SysV style
EXECUTE_PROCESS(COMMAND ps -ef OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
IF(result MATCHES 0)
SET( FIND_PROC "ps -ef | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
SET( FIND_PROC "ps -ef | grep -v mariadbd-safe | grep -- $MYSQLD | grep $PID > /dev/null")
ENDIF()
ENDIF()

Expand Down
20 changes: 10 additions & 10 deletions scripts/mysql_install_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ parse_arguments `"$print_defaults" $defaults $defaults_group_suffix --mysqld mys

parse_arguments PICK-ARGS-FROM-ARGV "$@"

rel_mysqld="$dirname0/@INSTALL_SBINDIR@/mysqld"
rel_mysqld="$dirname0/@INSTALL_SBINDIR@/mariadbd"

# Configure paths to support files
if test -n "$srcdir"
Expand All @@ -338,11 +338,11 @@ then
cannot_find_file resolveip @resolveip_locations@
exit 1
fi
mysqld=`find_in_dirs mysqld @mysqld_locations@`
mysqld=`find_in_dirs mariadbd @mysqld_locations@`
if test -z "$mysqld"
then
cannot_find_file mysqld @mysqld_locations@
exit 1
cannot_find_file mariadbd @mysqld_locations@
exit 1
fi
langdir=`find_in_dirs --dir errmsg.sys @errmsg_locations@`
if test -z "$langdir"
Expand All @@ -360,7 +360,7 @@ then
plugindir=`find_in_dirs --dir auth_pam.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin $basedir/lib/*/mariadb19/plugin`
pamtooldir=$plugindir
# relative from where the script was run for a relocatable install
elif test -n "$dirname0" -a -x "$rel_mysqld" -a ! "$rel_mysqld" -ef "@sbindir@/mysqld"
elif test -n "$dirname0" -a -x "$rel_mysqld" -a ! "$rel_mysqld" -ef "@sbindir@/mariadbd"
then
basedir="$dirname0"
bindir="$basedir/@INSTALL_BINDIR@"
Expand All @@ -374,7 +374,7 @@ else
basedir="@prefix@"
bindir="@bindir@"
resolveip="$bindir/resolveip"
mysqld="@sbindir@/mysqld"
mysqld="@sbindir@/mariadbd"
srcpkgdatadir="@pkgdatadir@"
buildpkgdatadir="@pkgdatadir@"
plugindir="@pkgplugindir@"
Expand Down Expand Up @@ -580,7 +580,7 @@ else
echo
echo " shell> $mysqld --skip-grant-tables --general-log &"
echo
echo "and use the command line tool $bindir/mysql"
echo "and use the command line tool $bindir/mariadb"
echo "to connect to the mysql database and look at the grant tables:"
echo
echo " shell> $bindir/mysql -u root mysql"
Expand Down Expand Up @@ -614,11 +614,11 @@ then
echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !"
echo "To do so, start the server, then issue the following commands:"
echo
echo "'$bindir/mysqladmin' -u root password 'new-password'"
echo "'$bindir/mysqladmin' -u root -h $hostname password 'new-password'"
echo "'$bindir/mariadb-admin' -u root password 'new-password'"
echo "'$bindir/mariadb-admin' -u root -h $hostname password 'new-password'"
echo
echo "Alternatively you can run:"
echo "'$bindir/mysql_secure_installation'"
echo "'$bindir/mariadb-secure-installation'"
echo
echo "which will also give you the option of removing the test"
echo "databases and anonymous user created by default. This is"
Expand Down
8 changes: 4 additions & 4 deletions scripts/mysql_secure_installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ then
cannot_find_file my_print_defaults $basedir/bin $basedir/extra
exit 1
fi
mysql_command=`find_in_basedir mysql bin`
mysql_command=`find_in_basedir mariadb bin`
if test -z "$mysql_command"
then
cannot_find_file mysql $basedir/bin
exit 1
cannot_find_file mariadb $basedir/bin
exit 1
fi
else
print_defaults="@bindir@/my_print_defaults"
mysql_command="@bindir@/mysql"
mysql_command="@bindir@/mariadb"
fi

if test ! -x "$print_defaults"
Expand Down
6 changes: 3 additions & 3 deletions scripts/mysqlaccess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ BEGIN {

# ****************************
# information on MariaDB
$MYSQL = '@bindir@/mysql'; # path to mysql executable
$MYSQL = '@bindir@/mariadb'; # path to mariadb executable
$SERVER = '3.21';
$MYSQL_OPT = ' --batch --unbuffered';
$ACCESS_DB = 'mysql'; # name of DB with grant-tables
Expand All @@ -50,8 +50,8 @@ BEGIN {
$ACCESS_U_BCK = 'user_backup';
$ACCESS_D_BCK = 'db_backup';
$DIFF = '/usr/bin/diff';
$MYSQLDUMP = '@bindir@/mysqldump';
#path to mysqldump executable
$MYSQLDUMP = '@bindir@/mariadb-dump';
#path to mariadb-dump executable

$MYSQLADMIN= 'http://foobar.com/MySQLadmin';
#URL of CGI for manipulating
Expand Down
Loading

0 comments on commit 193bfdd

Please sign in to comment.