1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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

This commit is contained in:
Vladislav Vaintroub
2020-06-30 12:47:05 +02:00
parent 17ce75b936
commit 59c999fc98
2 changed files with 26 additions and 0 deletions

View File

@ -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