Skip to content

Commit f97c8f7

Browse files
committed
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
1 parent 125e172 commit f97c8f7

File tree

7 files changed

+15
-3
lines changed

7 files changed

+15
-3
lines changed

mysql-test/main/mysql_install_db_win.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
select database();
2+
database()
3+
test
4+
use mysql;
15
Running bootstrap
26
Creating my.ini file
37
Removing default user
@@ -29,3 +33,4 @@ skip-name-resolve
2933
[client]
3034
port=3307
3135
# restart
36+
use test;

mysql-test/main/mysql_install_db_win.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
--source include/windows.inc
2+
select database();
3+
use mysql;
24

35
# Create database in tmp directory using mysql_install_db.exe,
46
# and start server from this directory.
@@ -87,4 +89,5 @@ perl;
8789
EOF
8890
rmdir $_BASEDIR;
8991
--source include/start_mysqld.inc
92+
use test;
9093

mysql-test/main/mysql_install_db_win_utf8.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use mysql;
12
Running bootstrap
23
Creating my.ini file
34
Removing default user
@@ -12,3 +13,4 @@ DATADIR/
1213
# Kill the server
1314
connection default;
1415
# restart
16+
use test;

mysql-test/main/mysql_install_db_win_utf8.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--source include/windows.inc
22
--source include/check_utf8_cli.inc
3-
3+
use mysql;
44
# Create database in tmp directory using mysql_install_db.exe,
55
# and start server from this directory.
66
let $ddir= $MYSQLTEST_VARDIR/tmp/датадир;
@@ -32,4 +32,5 @@ rmdir $ddir;
3232

3333
connection default;
3434
--source include/start_mysqld.inc
35+
use test;
3536

mysql-test/main/winservice.inc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let $sc_exe= C:\Windows\System32\sc.exe;
99
let $ddir= $MYSQLTEST_VARDIR/tmp/$datadir_name;
1010
let $service_name=$service_name_prefix$MASTER_MYPORT;
1111

12-
12+
use mysql;
1313
error 0,1;
1414
rmdir $ddir;
1515

@@ -72,4 +72,3 @@ rmdir $ddir;
7272
#restart original server
7373
connection default;
7474
source include/start_mysqld.inc;
75-

mysql-test/main/winservice_basic.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use mysql;
12
# run mysql_install_db with --service parameter
23
# Start service
34
# Connect with root user password=password

mysql-test/main/winservice_i18n.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use mysql;
12
# run mysql_install_db with --service parameter
23
# Start service
34
# Connect with root user password=パスワード

0 commit comments

Comments
 (0)