mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-7021 allow config file parameter for mysql_install_db.exe
The new parameter is called --config The config file is copied to the data directory as my.ini, and possibly modified. Bootstrap will now use my.ini to create tables. In case of non-standard directory/file placements, this will ensure correct permissions for the service user. mysql_install_db_win test is extended to test --config with non-trivial config file.
This commit is contained in:
@ -20,5 +20,39 @@ SELECT @@datadir;
|
||||
rmdir $ddir;
|
||||
let $restart_parameters=;
|
||||
connection default;
|
||||
|
||||
# Test --template option
|
||||
let _BASEDIR = $MYSQLTEST_VARDIR/tmp/basedir;
|
||||
perl;
|
||||
|
||||
open(IN, '<', "std_data/mysql_install_db_win.ini.in") or die;
|
||||
open(OUT, '>', "$ENV{MYSQLTEST_VARDIR}/tmp/mysql_install_db_win.ini") or die;
|
||||
while (<IN>) {
|
||||
s/BASEDIR/$ENV{_BASEDIR}/g;
|
||||
print OUT $_;
|
||||
}
|
||||
close IN;
|
||||
close OUT
|
||||
EOF
|
||||
mkdir $_BASEDIR;
|
||||
mkdir $_BASEDIR/temp;
|
||||
|
||||
# Run mysql_install_db.exe with config parameter
|
||||
--disable_result_log
|
||||
exec $MYSQL_INSTALL_DB_EXE -o --port=3307 --config=$MYSQLTEST_VARDIR/tmp/mysql_install_db_win.ini;
|
||||
--enable_result_log
|
||||
|
||||
# dump the modified config in data directory
|
||||
perl;
|
||||
open(IN, '<', "$ENV{_BASEDIR}/data/my.ini") or die;
|
||||
while (<IN>) {
|
||||
s/$ENV{_BASEDIR}/BASEDIR/g;
|
||||
# when testing on installation layout, client's plugin
|
||||
# dir is added, but when testing in build dir.
|
||||
print unless $_ =~ /plugin-dir/;
|
||||
}
|
||||
close IN;
|
||||
EOF
|
||||
rmdir $_BASEDIR;
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
|
Reference in New Issue
Block a user