Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
0d2029ff
Commit
0d2029ff
authored
Oct 26, 2020
by
Daniel Black
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mysql_install_db test cases
Includes tests for MDEV-23494 and MDEV-23326
parent
1b640fbd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
335 additions
and
0 deletions
+335
-0
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+12
-0
mysql-test/r/mysql_install_db.result
mysql-test/r/mysql_install_db.result
+148
-0
mysql-test/t/mysql_install_db.test
mysql-test/t/mysql_install_db.test
+175
-0
No files found.
mysql-test/mysql-test-run.pl
View file @
0d2029ff
...
...
@@ -2527,6 +2527,18 @@ sub environment_setup {
$ENV
{'
MYSQLD_CMD
'}
=
"
$exe_mysqld
--defaults-group-suffix=.1
"
.
"
--defaults-file=
$path_config_file
$extra_opts
";
# ----------------------------------------------------
# mysql_install_db
# ----------------------------------------------------
my
$exe_mysql_install_db
=
mtr_exe_exists
("
$bindir
/scripts/mysql_install_db
",
"
$path_client_bindir
/my_install_db
");
$ENV
{'
MYSQL_INSTALL_DB
'}
=
native_path
(
$exe_mysql_install_db
)
.
"
--defaults-file=
$path_config_file
$extra_opts
"
.
"
--defaults-group-suffix=.1
"
.
"
--srcdir=
"
.
cwd
()
.
"
/..
"
.
"
--builddir=
$bindir
";
# ----------------------------------------------------
# bug25714 executable may _not_ exist in
# some versions, test using it should be skipped
...
...
mysql-test/r/mysql_install_db.result
0 → 100644
View file @
0d2029ff
#
#
# mysql_install_db (no args)
#
Installing MariaDB/MySQL system tables in 'MYSQLTEST_VARDIR/mysqld.1/data' ...
OK
SELECT user,host,plugin,password FROM mysql.user order by user,host;
user host plugin password
HOSTNAME
localhost
root 127.0.0.1
root ::1
root HOSTNAME
root localhost
SHOW DATABASES;
Database
information_schema
mysql
performance_schema
test
SHOW GRANTS FOR root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR ''@localhost;
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
#
#
# mysql_install_db --auth-root-authentication-method=normal
#
Installing MariaDB/MySQL system tables in 'MYSQLTEST_VARDIR/mysqld.1/data' ...
OK
SELECT user,host,plugin,password FROM mysql.user order by user,host;
user host plugin password
HOSTNAME
localhost
root 127.0.0.1
root ::1
root HOSTNAME
root localhost
SHOW DATABASES;
Database
information_schema
mysql
performance_schema
test
SHOW GRANTS FOR root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR ''@localhost;
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
#
#
# mysql_install_db --auth-root-authentication-method=socket \
# --auth-root-socket-user=$USER
#
Installing MariaDB/MySQL system tables in 'MYSQLTEST_VARDIR/mysqld.1/data' ...
OK
connect unix,localhost,$USER;
connection unix;
SELECT user,host,plugin,password FROM mysql.user order by user,host;
user host plugin password
HOSTNAME
localhost
USER localhost unix_socket
SHOW DATABASES;
Database
information_schema
mysql
performance_schema
test
SHOW GRANTS FOR USER@localhost;
Grants for USER@localhost
GRANT ALL PRIVILEGES ON *.* TO 'USER'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION
SHOW GRANTS FOR ''@localhost;
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
#
#
# MDEV-23494 mysql_install_db --auth-root-hostname=%
#
Installing MariaDB/MySQL system tables in 'MYSQLTEST_VARDIR/mysqld.1/data' ...
OK
connection default;
SELECT user,host,plugin,password FROM mysql.user order by user,host;
user host plugin password
%
localhost
root %
root 127.0.0.1
root ::1
root localhost
SHOW DATABASES;
Database
information_schema
mysql
performance_schema
test
SHOW GRANTS FOR root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR root@'%';
Grants for root@%
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'%' WITH GRANT OPTION
SHOW GRANTS FOR ''@localhost;
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
#
#
# MDEV-23326 mysql_install_db --timezones=$MYSQLTEST_VARDIR/std_data/zoneinfo
#
Installing MariaDB/MySQL system tables in 'MYSQLTEST_VARDIR/mysqld.1/data' ...
OK
connection default;
SELECT user,host,plugin,password FROM mysql.user order by user,host;
user host plugin password
HOSTNAME
localhost
root 127.0.0.1
root ::1
root HOSTNAME
root localhost
SHOW DATABASES;
Database
information_schema
mysql
performance_schema
test
SHOW GRANTS FOR root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR ''@localhost;
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
SELECT * FROM mysql.time_zone
LEFT JOIN mysql.time_zone_name USING (Time_zone_id)
LEFT JOIN mysql.time_zone_transition USING (Time_zone_id)
LEFT JOIN mysql.time_zone_transition_type USING (Transition_type_id);
Transition_type_id Time_zone_id Use_leap_seconds Name Transition_time Time_zone_id Offset Is_DST Abbreviation
NULL 1 N GMT NULL NULL NULL NULL NULL
# End of 10.2 tests
# Kill the server
mysql-test/t/mysql_install_db.test
0 → 100644
View file @
0d2029ff
--
source
include
/
not_windows
.
inc
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_unix_socket
.
inc
--
let
MYSQLD_DATADIR
=
`select @@datadir`
--
let
HOSTNAME
=
`select @@hostname`
--
echo
#
--
echo
#
--
echo
# mysql_install_db (no args)
--
echo
#
--
source
include
/
shutdown_mysqld
.
inc
--
rmdir
$MYSQLD_DATADIR
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
exec
$MYSQL_INSTALL_DB
--
verbose
--
source
include
/
start_mysqld
.
inc
--
replace_result
$HOSTNAME
HOSTNAME
SELECT
user
,
host
,
plugin
,
password
FROM
mysql
.
user
order
by
user
,
host
;
--
sorted_result
SHOW
DATABASES
;
--
sorted_result
SHOW
GRANTS
FOR
root
@
localhost
;
--
sorted_result
SHOW
GRANTS
FOR
''
@
localhost
;
--
echo
#
--
echo
#
--
echo
# mysql_install_db --auth-root-authentication-method=normal
--
echo
#
--
source
include
/
shutdown_mysqld
.
inc
--
rmdir
$MYSQLD_DATADIR
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
exec
$MYSQL_INSTALL_DB
--
auth
-
root
-
authentication
-
method
=
normal
--
source
include
/
start_mysqld
.
inc
--
replace_result
$HOSTNAME
HOSTNAME
SELECT
user
,
host
,
plugin
,
password
FROM
mysql
.
user
order
by
user
,
host
;
--
sorted_result
SHOW
DATABASES
;
--
sorted_result
SHOW
GRANTS
FOR
root
@
localhost
;
--
sorted_result
SHOW
GRANTS
FOR
''
@
localhost
;
--
echo
#
--
echo
#
--
echo
# mysql_install_db --auth-root-authentication-method=socket \\
--
echo
# --auth-root-socket-user=\$USER
--
echo
#
--
source
include
/
shutdown_mysqld
.
inc
--
rmdir
$MYSQLD_DATADIR
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
exec
$MYSQL_INSTALL_DB
--
auth
-
root
-
authentication
-
method
=
socket
--
auth
-
root
-
socket
-
user
=
$USER
--
source
include
/
start_mysqld
.
inc
--
replace_result
$MASTER_MYSOCK
MASTER_SOCKET
$MASTER_MYPORT
MASTER_PORT
$USER
USER
connect
(
unix
,
localhost
,
$USER
);
connection
unix
;
--
replace_result
$HOSTNAME
HOSTNAME
$USER
USER
SELECT
user
,
host
,
plugin
,
password
FROM
mysql
.
user
order
by
user
,
host
;
--
sorted_result
SHOW
DATABASES
;
--
replace_result
$USER
USER
--
sorted_result
eval
SHOW
GRANTS
FOR
$USER
@
localhost
;
--
sorted_result
SHOW
GRANTS
FOR
''
@
localhost
;
--
echo
#
--
echo
#
--
echo
# MDEV-23494 mysql_install_db --auth-root-hostname=%
--
echo
#
--
source
include
/
shutdown_mysqld
.
inc
--
rmdir
$MYSQLD_DATADIR
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
exec
$MYSQL_INSTALL_DB
--
auth
-
root
-
hostname
=%
--
source
include
/
start_mysqld
.
inc
connection
default
;
--
enable_reconnect
SELECT
user
,
host
,
plugin
,
password
FROM
mysql
.
user
order
by
user
,
host
;
--
sorted_result
SHOW
DATABASES
;
--
sorted_result
SHOW
GRANTS
FOR
root
@
localhost
;
--
sorted_result
SHOW
GRANTS
FOR
root
@
'%'
;
--
sorted_result
SHOW
GRANTS
FOR
''
@
localhost
;
--
echo
#
--
echo
#
--
echo
# MDEV-23326 mysql_install_db --timezones=\$MYSQLTEST_VARDIR/std_data/zoneinfo
--
echo
#
--
source
include
/
shutdown_mysqld
.
inc
--
rmdir
$MYSQLD_DATADIR
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
exec
$MYSQL_INSTALL_DB
--
timezones
=
$MYSQLTEST_VARDIR
/
std_data
/
zoneinfo
--
source
include
/
start_mysqld
.
inc
connection
default
;
--
enable_reconnect
--
replace_result
$HOSTNAME
HOSTNAME
SELECT
user
,
host
,
plugin
,
password
FROM
mysql
.
user
order
by
user
,
host
;
--
sorted_result
SHOW
DATABASES
;
--
sorted_result
SHOW
GRANTS
FOR
root
@
localhost
;
--
sorted_result
SHOW
GRANTS
FOR
''
@
localhost
;
# intentionally leave out leap_seconds here as largely deprecated (world wide more than mariadb)
#
SELECT
*
FROM
mysql
.
time_zone
LEFT
JOIN
mysql
.
time_zone_name
USING
(
Time_zone_id
)
LEFT
JOIN
mysql
.
time_zone_transition
USING
(
Time_zone_id
)
LEFT
JOIN
mysql
.
time_zone_transition_type
USING
(
Transition_type_id
);
--
echo
# End of 10.2 tests
# Cleanup
--
source
include
/
kill_mysqld
.
inc
--
rmdir
$MYSQLD_DATADIR
--
mkdir
$MYSQLD_DATADIR
perl
;
use
lib
"lib"
;
use
My
::Handles { suppress_init_messages => 1 }
;
use
My
::File::Path
;
my
$install_db_dir
=
(
$ENV
{
MTR_PARALLEL
}
==
1
)
?
"
$ENV
{
'MYSQLTEST_VARDIR'
}
/install.db"
:
"
$ENV
{
'MYSQLTEST_VARDIR'
}
/../install.db"
;
copytree
(
$install_db_dir
,
$ENV
{
'MYSQLD_DATADIR'
});
EOF
--
source
include
/
start_mysqld
.
inc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment