mirror of
https://github.com/MariaDB/server.git
synced 2025-01-24 07:44:22 +01:00
Merge mysql.com:/nfsdisk1/lars/bk/mysql-5.0-rpl
into mysql.com:/nfsdisk1/lars/bk/mysql-5.1-new-rpl sql/sql_acl.cc: Auto merged
This commit is contained in:
commit
09c92d0d38
3 changed files with 125 additions and 2 deletions
77
mysql-test/r/rpl_grant.result
Normal file
77
mysql-test/r/rpl_grant.result
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
stop slave;
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
|
reset master;
|
||||||
|
reset slave;
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
|
start slave;
|
||||||
|
**** On Master ****
|
||||||
|
CREATE USER dummy@localhost;
|
||||||
|
CREATE USER dummy1@localhost, dummy2@localhost;
|
||||||
|
SELECT user, host FROM mysql.user WHERE user != 'root';
|
||||||
|
user host
|
||||||
|
dummy localhost
|
||||||
|
dummy1 localhost
|
||||||
|
dummy2 localhost
|
||||||
|
SELECT COUNT(*) FROM mysql.user;
|
||||||
|
COUNT(*)
|
||||||
|
6
|
||||||
|
**** On Slave ****
|
||||||
|
SELECT user,host FROM mysql.user WHERE user != 'root';
|
||||||
|
user host
|
||||||
|
dummy localhost
|
||||||
|
dummy1 localhost
|
||||||
|
dummy2 localhost
|
||||||
|
SELECT COUNT(*) FROM mysql.user;
|
||||||
|
COUNT(*)
|
||||||
|
6
|
||||||
|
**** On Master ****
|
||||||
|
DROP USER nonexisting@localhost;
|
||||||
|
ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
|
||||||
|
DROP USER nonexisting@localhost, dummy@localhost;
|
||||||
|
ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
|
||||||
|
DROP USER dummy1@localhost, dummy2@localhost;
|
||||||
|
SELECT user, host FROM mysql.user WHERE user != 'root';
|
||||||
|
user host
|
||||||
|
SELECT COUNT(*) FROM mysql.user;
|
||||||
|
COUNT(*)
|
||||||
|
3
|
||||||
|
**** On Slave ****
|
||||||
|
SELECT user,host FROM mysql.user WHERE user != 'root';
|
||||||
|
user host
|
||||||
|
SELECT COUNT(*) FROM mysql.user;
|
||||||
|
COUNT(*)
|
||||||
|
3
|
||||||
|
SHOW SLAVE STATUS;
|
||||||
|
Slave_IO_State #
|
||||||
|
Master_Host 127.0.0.1
|
||||||
|
Master_User root
|
||||||
|
Master_Port MASTER_PORT
|
||||||
|
Connect_Retry 1
|
||||||
|
Master_Log_File master-bin.000001
|
||||||
|
Read_Master_Log_Pos 609
|
||||||
|
Relay_Log_File #
|
||||||
|
Relay_Log_Pos #
|
||||||
|
Relay_Master_Log_File master-bin.000001
|
||||||
|
Slave_IO_Running Yes
|
||||||
|
Slave_SQL_Running Yes
|
||||||
|
Replicate_Do_DB
|
||||||
|
Replicate_Ignore_DB
|
||||||
|
Replicate_Do_Table
|
||||||
|
Replicate_Ignore_Table
|
||||||
|
Replicate_Wild_Do_Table
|
||||||
|
Replicate_Wild_Ignore_Table
|
||||||
|
Last_Errno 0
|
||||||
|
Last_Error
|
||||||
|
Skip_Counter 0
|
||||||
|
Exec_Master_Log_Pos 609
|
||||||
|
Relay_Log_Space #
|
||||||
|
Until_Condition None
|
||||||
|
Until_Log_File
|
||||||
|
Until_Log_Pos 0
|
||||||
|
Master_SSL_Allowed No
|
||||||
|
Master_SSL_CA_File
|
||||||
|
Master_SSL_CA_Path
|
||||||
|
Master_SSL_Cert
|
||||||
|
Master_SSL_Cipher
|
||||||
|
Master_SSL_Key
|
||||||
|
Seconds_Behind_Master #
|
42
mysql-test/t/rpl_grant.test
Normal file
42
mysql-test/t/rpl_grant.test
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# 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;
|
||||||
|
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;
|
||||||
|
|
||||||
|
--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;
|
||||||
|
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;
|
||||||
|
|
||||||
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||||
|
--replace_column 1 # 8 # 9 # 23 # 33 #
|
||||||
|
query_vertical SHOW SLAVE STATUS;
|
|
@ -5539,6 +5539,12 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
|
||||||
|
|
||||||
VOID(pthread_mutex_unlock(&acl_cache->lock));
|
VOID(pthread_mutex_unlock(&acl_cache->lock));
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe());
|
||||||
|
|
||||||
|
DBUG_PRINT("info", ("thd->net.last_errno: %d", thd->net.last_errno));
|
||||||
|
DBUG_PRINT("info", ("thd->net.last_error: %s", thd->net.last_error));
|
||||||
|
|
||||||
if (mysql_bin_log.is_open())
|
if (mysql_bin_log.is_open())
|
||||||
{
|
{
|
||||||
thd->binlog_query(THD::MYSQL_QUERY_TYPE,
|
thd->binlog_query(THD::MYSQL_QUERY_TYPE,
|
||||||
|
@ -5547,8 +5553,6 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
|
||||||
|
|
||||||
rw_unlock(&LOCK_grant);
|
rw_unlock(&LOCK_grant);
|
||||||
close_thread_tables(thd);
|
close_thread_tables(thd);
|
||||||
if (result)
|
|
||||||
my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe());
|
|
||||||
DBUG_RETURN(result);
|
DBUG_RETURN(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue