1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Windows : create a minimalistic MTR test for mysql_install_db.exe

only --datadir option is tested in this test.
Other options (notably --password and --service) would need another,
more comprehensive test.
This commit is contained in:
Vladislav Vaintroub
2018-12-06 15:09:17 +01:00
parent f77895ebf3
commit 50c850c9b1
4 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,10 @@
# Kill the server
Running bootstrap
Removing default user
Creating my.ini file
Creation of the database was successful
my.ini
SELECT @@datadir;
@@datadir
DATADIR/
# Kill the server

View File

@ -0,0 +1,22 @@
--source include/windows.inc
# Create database in tmp directory using mysql_install_db.exe,
# and start server from this directory.
let $ddir= $MYSQLTEST_VARDIR/tmp/ddir;
exec $MYSQL_INSTALL_DB_EXE --datadir=$ddir;
--source include/kill_mysqld.inc
let $restart_parameters=--datadir=$ddir --loose-innodb;
--source include/start_mysqld.inc
# Smoke test - check that we're actually using datadir
# we've created (i.e restart_parameters worked)
--replace_result $ddir DATADIR
SELECT @@datadir;
# restart in the original datadir again
--source include/kill_mysqld.inc
rmdir $ddir;
let $restart_parameters=;
--source include/start_mysqld.inc

View File

@ -2292,6 +2292,10 @@ sub environment_setup {
$ENV{'EXE_MYSQL'}= $exe_mysql;
$ENV{'MYSQL_PLUGIN'}= $exe_mysql_plugin;
$ENV{'MYSQL_EMBEDDED'}= $exe_mysql_embedded;
if(IS_WINDOWS)
{
$ENV{'MYSQL_INSTALL_DB_EXE'}= mtr_exe_exists("$bindir/sql$opt_vs_config/mysql_install_db");
}
my $client_config_exe=
mtr_exe_maybe_exists(

View File

@ -198,7 +198,7 @@ int main(int argc, char **argv)
die("database creation failed");
}
printf("Creation of the database was successful");
printf("Creation of the database was successful\n");
return 0;
}