Commit 59c999fc authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-23052 - add mysql_install_db.exe test with existing directory.

parent 17ce75b9
......@@ -11,5 +11,7 @@ SELECT @@datadir;
@@datadir
DATADIR/
# Kill the server
1
FOUND 1 /is not empty. Only new or empty existing directories are accepted for --datadir/ in install.log
connection default;
# restart
......@@ -18,6 +18,30 @@ SELECT @@datadir;
# restart in the original datadir again
--source include/kill_mysqld.inc
rmdir $ddir;
# MDEV-23052
# 1. mysql_install_db works on existing, empty directory
mkdir $ddir;
exec $MYSQL_INSTALL_DB_EXE --datadir=$ddir --password=foo -R > /dev/null;
rmdir $ddir;
# 2. mysql_install_db rejects existing, non-empty directory, and does not
# remove it.
mkdir $ddir;
write_file $ddir/1;
EOF
error 1;
exec $MYSQL_INSTALL_DB_EXE --datadir=$ddir --password=foo -R > $MYSQLTEST_VARDIR/tmp/install.log 2>&1;
list_files $ddir;
let $log=$MYSQLTEST_VARDIR/tmp/install.log;
let SEARCH_FILE=$log;
let SEARCH_PATTERN=is not empty. Only new or empty existing directories are accepted for --datadir;
--source include/search_pattern_in_file.inc
remove_file $log;
rmdir $ddir;
let $restart_parameters=;
connection default;
--source include/start_mysqld.inc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment