mariadb/mysql-test/main/mysql_install_db_win_utf8.test
Vladislav Vaintroub f97c8f7ece MDEV-26715 Fix mysql_install_db_win tests.
It looks like  C/C reconnect retains the database. It is correct behavior
However there is a problem that mysql_install_db.exe does not create
'test' database, thus using mysql_install_db to create datadir,
then restarting server and reconnecting does not succeed, if 'test' was
current db before reconnect.

The problem became apparent with MDEV-26715. Why it worked before,
with a simpler 'root' definition is a mystery.

Fix is to switch current connection to 'mysql' database, prior to
reconnect to the instance created via mysql_install_db.exe
2022-11-08 14:58:48 +01:00

36 lines
1.2 KiB
Text

--source include/windows.inc
--source include/check_utf8_cli.inc
use mysql;
# Create database in tmp directory using mysql_install_db.exe,
# and start server from this directory.
let $ddir= $MYSQLTEST_VARDIR/tmp/датадир;
--error 0,1
rmdir $ddir;
exec $MYSQL_INSTALL_DB_EXE --datadir=$ddir --password=パスワード -R;
--source include/kill_mysqld.inc
# Note "restart" via MTR does not work, if server's command line has
# non-ASCII characters used (or, characters outside of ANSI codepage).
# This is a perl limitation, which is worked around in this test -
# the server started in background, via exec $MYSQLD
--replace_result $MYSQLD MYSQLD $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
exec $MYSQLD --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.1 --datadir=$ddir --loose-innodb > NUL 2>&1 &;
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
connect (con1,localhost,root,パスワード,mysql);
# 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;
connection default;
--source include/start_mysqld.inc
use test;