mariadb/mysql-test/t/rpl_grant.test
Chad MILLER 392ff10eac Bug#35754: mysql_install_db does not work if no hostname is set
Machines with hostname set to "localhost" cause uniqueness errors in 
the SQL bootstrap data.

Now, insert zero lines for cases where the (lowercased) hostname is 
the same as an already-inserted 'localhost' name.  Also, fix a few tests 
that expect certain local accounts to have a certain host name.
2008-09-24 08:59:56 -04:00

42 lines
1.4 KiB
Text

# Tests of grants and users
source include/master-slave.inc;
source include/not_embedded.inc;
--echo **** On Master ****
connection master;
CREATE USER dummy@localhost;
CREATE USER dummy1@localhost, dummy2@localhost;
SELECT user, host FROM mysql.user WHERE user != 'root'; # root host non-determ
SELECT COUNT(*) FROM mysql.user WHERE user != 'root' or (host != 'localhost' and host != @hostname);
sync_slave_with_master;
--echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user != 'root'; # root host non-determ
SELECT COUNT(*) FROM mysql.user WHERE user != 'root' or (host != 'localhost' and host != @hostname);
--echo **** On Master ****
connection master;
# No user exists
error ER_CANNOT_USER;
DROP USER nonexisting@localhost;
# At least one user exists, but not all
error ER_CANNOT_USER;
DROP USER nonexisting@localhost, dummy@localhost;
# All users exist
DROP USER dummy1@localhost, dummy2@localhost;
SELECT user, host FROM mysql.user WHERE user != 'root'; # root host non-determ
SELECT COUNT(*) FROM mysql.user WHERE user != 'root' or (host != 'localhost' and host != @hostname);
sync_slave_with_master;
--echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user != 'root'; # root host non-determ
SELECT COUNT(*) FROM mysql.user WHERE user != 'root' or (host != 'localhost' and host != @hostname);
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
query_vertical SHOW SLAVE STATUS;