mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
2f74826394
and replicated): A DROP USER statement with a non-existing user was correctly written to the binary log (there might be users that were removed, but not all), but the error code was not set, which caused the slave to stop with an error. The error reporting code was moved to before the statement was logged to ensure that the error information for the thread was correctly set up. This works since my_error() will set the fields net.last_errno and net.last_error for the thread that is reporting the error, and this will then be picked up when the Query_log_event is created and written to the binary log.
38 lines
876 B
Text
38 lines
876 B
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;
|
|
sync_slave_with_master;
|
|
--echo **** On Slave ****
|
|
SELECT user,host FROM mysql.user;
|
|
|
|
--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;
|
|
sync_slave_with_master;
|
|
--echo **** On Slave ****
|
|
SELECT user,host FROM mysql.user;
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
--replace_column 1 # 8 # 9 # 23 # 33 #
|
|
query_vertical SHOW SLAVE STATUS;
|