Commit f97c8f7e authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

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
parent 125e172a
select database();
database()
test
use mysql;
Running bootstrap Running bootstrap
Creating my.ini file Creating my.ini file
Removing default user Removing default user
...@@ -29,3 +33,4 @@ skip-name-resolve ...@@ -29,3 +33,4 @@ skip-name-resolve
[client] [client]
port=3307 port=3307
# restart # restart
use test;
--source include/windows.inc --source include/windows.inc
select database();
use mysql;
# Create database in tmp directory using mysql_install_db.exe, # Create database in tmp directory using mysql_install_db.exe,
# and start server from this directory. # and start server from this directory.
...@@ -87,4 +89,5 @@ perl; ...@@ -87,4 +89,5 @@ perl;
EOF EOF
rmdir $_BASEDIR; rmdir $_BASEDIR;
--source include/start_mysqld.inc --source include/start_mysqld.inc
use test;
use mysql;
Running bootstrap Running bootstrap
Creating my.ini file Creating my.ini file
Removing default user Removing default user
...@@ -12,3 +13,4 @@ DATADIR/ ...@@ -12,3 +13,4 @@ DATADIR/
# Kill the server # Kill the server
connection default; connection default;
# restart # restart
use test;
--source include/windows.inc --source include/windows.inc
--source include/check_utf8_cli.inc --source include/check_utf8_cli.inc
use mysql;
# Create database in tmp directory using mysql_install_db.exe, # Create database in tmp directory using mysql_install_db.exe,
# and start server from this directory. # and start server from this directory.
let $ddir= $MYSQLTEST_VARDIR/tmp/датадир; let $ddir= $MYSQLTEST_VARDIR/tmp/датадир;
...@@ -32,4 +32,5 @@ rmdir $ddir; ...@@ -32,4 +32,5 @@ rmdir $ddir;
connection default; connection default;
--source include/start_mysqld.inc --source include/start_mysqld.inc
use test;
...@@ -9,7 +9,7 @@ let $sc_exe= C:\Windows\System32\sc.exe; ...@@ -9,7 +9,7 @@ let $sc_exe= C:\Windows\System32\sc.exe;
let $ddir= $MYSQLTEST_VARDIR/tmp/$datadir_name; let $ddir= $MYSQLTEST_VARDIR/tmp/$datadir_name;
let $service_name=$service_name_prefix$MASTER_MYPORT; let $service_name=$service_name_prefix$MASTER_MYPORT;
use mysql;
error 0,1; error 0,1;
rmdir $ddir; rmdir $ddir;
...@@ -72,4 +72,3 @@ rmdir $ddir; ...@@ -72,4 +72,3 @@ rmdir $ddir;
#restart original server #restart original server
connection default; connection default;
source include/start_mysqld.inc; source include/start_mysqld.inc;
use mysql;
# run mysql_install_db with --service parameter # run mysql_install_db with --service parameter
# Start service # Start service
# Connect with root user password=password # Connect with root user password=password
......
use mysql;
# run mysql_install_db with --service parameter # run mysql_install_db with --service parameter
# Start service # Start service
# Connect with root user password=パスワード # Connect with root user password=パスワード
......
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