diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2022-08-26 00:38:00 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2022-09-13 20:00:59 +0200 |
commit | 5a2846a755ea6168f1642f72506cbfb00013a1f5 (patch) | |
tree | 8e915fedd36e060a783cb48716cce091263d36b5 | |
parent | f63f3726fa48bbac92c7c9c33c8f15e829cd4213 (diff) | |
download | mariadb-git-bb-10.11-MDEV-26715.tar.gz |
MDEV-26715 Fix mysql_install_db_win tests.bb-10.11-MDEV-26715
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
-rw-r--r-- | mysql-test/main/mysql_install_db_win.result | 5 | ||||
-rw-r--r-- | mysql-test/main/mysql_install_db_win.test | 3 | ||||
-rw-r--r-- | mysql-test/main/mysql_install_db_win_utf8.result | 2 | ||||
-rw-r--r-- | mysql-test/main/mysql_install_db_win_utf8.test | 3 | ||||
-rw-r--r-- | mysql-test/main/winservice.inc | 3 | ||||
-rw-r--r-- | mysql-test/main/winservice_basic.result | 1 | ||||
-rw-r--r-- | mysql-test/main/winservice_i18n.result | 1 |
7 files changed, 15 insertions, 3 deletions
diff --git a/mysql-test/main/mysql_install_db_win.result b/mysql-test/main/mysql_install_db_win.result index 2440ff351ea..511be75e131 100644 --- a/mysql-test/main/mysql_install_db_win.result +++ b/mysql-test/main/mysql_install_db_win.result @@ -1,3 +1,7 @@ +select database(); +database() +test +use mysql; Running bootstrap Creating my.ini file Removing default user @@ -29,3 +33,4 @@ skip-name-resolve [client] port=3307 # restart +use test; diff --git a/mysql-test/main/mysql_install_db_win.test b/mysql-test/main/mysql_install_db_win.test index c400dbf3fb9..fd3bf6d24b0 100644 --- a/mysql-test/main/mysql_install_db_win.test +++ b/mysql-test/main/mysql_install_db_win.test @@ -1,4 +1,6 @@ --source include/windows.inc +select database(); +use mysql; # Create database in tmp directory using mysql_install_db.exe, # and start server from this directory. @@ -87,4 +89,5 @@ perl; EOF rmdir $_BASEDIR; --source include/start_mysqld.inc +use test; diff --git a/mysql-test/main/mysql_install_db_win_utf8.result b/mysql-test/main/mysql_install_db_win_utf8.result index 744c982b291..edcc69aaeb7 100644 --- a/mysql-test/main/mysql_install_db_win_utf8.result +++ b/mysql-test/main/mysql_install_db_win_utf8.result @@ -1,3 +1,4 @@ +use mysql; Running bootstrap Creating my.ini file Removing default user @@ -12,3 +13,4 @@ DATADIR/ # Kill the server connection default; # restart +use test; diff --git a/mysql-test/main/mysql_install_db_win_utf8.test b/mysql-test/main/mysql_install_db_win_utf8.test index fc67b66d3ca..0dc75af3914 100644 --- a/mysql-test/main/mysql_install_db_win_utf8.test +++ b/mysql-test/main/mysql_install_db_win_utf8.test @@ -1,6 +1,6 @@ --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/датадир; @@ -32,4 +32,5 @@ rmdir $ddir; connection default; --source include/start_mysqld.inc +use test; diff --git a/mysql-test/main/winservice.inc b/mysql-test/main/winservice.inc index 2d8f6ccae1e..d77856f6b5b 100644 --- a/mysql-test/main/winservice.inc +++ b/mysql-test/main/winservice.inc @@ -9,7 +9,7 @@ let $sc_exe= C:\Windows\System32\sc.exe; let $ddir= $MYSQLTEST_VARDIR/tmp/$datadir_name; let $service_name=$service_name_prefix$MASTER_MYPORT; - +use mysql; error 0,1; rmdir $ddir; @@ -72,4 +72,3 @@ rmdir $ddir; #restart original server connection default; source include/start_mysqld.inc; - diff --git a/mysql-test/main/winservice_basic.result b/mysql-test/main/winservice_basic.result index 0a5e8693b6b..da03a15d8b7 100644 --- a/mysql-test/main/winservice_basic.result +++ b/mysql-test/main/winservice_basic.result @@ -1,3 +1,4 @@ +use mysql; # run mysql_install_db with --service parameter # Start service # Connect with root user password=password diff --git a/mysql-test/main/winservice_i18n.result b/mysql-test/main/winservice_i18n.result index 8d5eba3df38..a3ee1137e98 100644 --- a/mysql-test/main/winservice_i18n.result +++ b/mysql-test/main/winservice_i18n.result @@ -1,3 +1,4 @@ +use mysql; # run mysql_install_db with --service parameter # Start service # Connect with root user password=パスワード |