Skip to content
This repository was archived by the owner on Apr 9, 2021. It is now read-only.

Commit fd0eb84

Browse files
committed
Adapted MySQL-Sandbox to new default users
- Changed grants to support new users changes in 5.7.19 and 8.0.4 (mysql.session, mysql.infoschema) - Improved tests to deal with new default users
1 parent 8526034 commit fd0eb84

File tree

6 files changed

+32
-5
lines changed

6 files changed

+32
-5
lines changed

Changelog

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
3.2.15 18-Nov-2017
2+
- Changed grants to support new users in 5.7.19 and 8.0.4
3+
- Improved tests to deal with new default users
14
3.2.14 05-Sep-2017
25
- Added a conditional delay in ./use, as a temporary workaround for
36
changed replication defaults in MySQL 8.0.x.

lib/MySQL/Sandbox.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ our @EXPORT_OK= qw( is_port_open
3131
split_version
3232
) ;
3333

34-
our $VERSION=q{3.2.14};
34+
our $VERSION=q{3.2.15};
3535
our $DEBUG;
3636

3737
BEGIN {

lib/MySQL/Sandbox/Recipes.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package MySQL::Sandbox::Recipes;
33
use strict;
44
use warnings;
55

6-
our $VERSION=q{3.2.14};
6+
our $VERSION=q{3.2.15};
77

88
1;
99
__END__

lib/MySQL/Sandbox/Scripts.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ our @EXPORT_OK = qw(
1717
);
1818
our @EXPORT = @EXPORT_OK;
1919

20-
our $VERSION=q{3.2.14};
20+
our $VERSION=q{3.2.15};
2121

2222
our @MANIFEST = (
2323
'clear.sh',
@@ -1795,7 +1795,7 @@ set password='_DBPASSWORD_';
17951795
-- delete from tables_priv;
17961796
-- delete from columns_priv;
17971797
-- delete from db;
1798-
delete from user where user not in ('root', 'mysql.sys', 'mysqlxsys');
1798+
delete from user where user not in ('root', 'mysql.sys', 'mysqlxsys', 'mysql.session', 'mysql.infoschema');
17991799
18001800
flush privileges;
18011801

t/Test_Helper.pm

+9-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ BEGIN {
3131
}
3232
}
3333
$test_version = $ENV{TEST_VERSION} ;
34+
my ($major, $minor, $rev) = split_version($test_version);
35+
my $compare_test = sprintf("%05d-%05d-%05d", $major, $minor, $rev);
36+
my $ver_8_0_3 = sprintf("%05d-%05d-%05d", 8, 0, 3);
37+
# Adds delay to 8.0.3+
38+
if ( ( $major != 10 ) && ($compare_test ge $ver_8_0_3) )
39+
{
40+
$ENV{TEST_REPL_DELAY} = 2;
41+
}
42+
3443
};
3544

3645
use strict;
@@ -66,7 +75,6 @@ sub skip_version
6675
sub confirm_version
6776
{
6877
my ($min_version, $max_version) = @_;
69-
my $will_skip =0;
7078
my ($major, $minor, $rev) = split_version($test_version);
7179
my ($major1, $minor1, $rev1) = split_version($min_version);
7280
my ($major2, $minor2, $rev2) = split_version($max_version);

t/user_privileges.sb.pl

+16
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@
3232
$number_of_users = 9;
3333
}
3434

35+
if (
36+
( ($major ==5) && ($minor == 7) && ($rev >= 19))
37+
or
38+
( ($major ==8) && ($minor == 0) && ($rev >= 3))
39+
)
40+
# Starting with MySQL 5.7.19 we have the mysql.session user created by default.
41+
{
42+
$number_of_users = 10;
43+
}
44+
45+
# Starting with MySQL 8.0.4 we have also users mysql.session and
46+
# mysql.infoschema created by default.
47+
if (($major ==8) && ($minor == 0) && ($rev > 3))
48+
{
49+
$number_of_users = 11;
50+
}
3551
ok_exec({
3652
command => "make_sandbox $TEST_VERSION -- --no_confirm --sandbox_directory=msb_XXXX",
3753
expected => "sandbox server started",

0 commit comments

Comments
 (0)