summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/rpl/t/rpl_grant.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/rpl/t/rpl_grant.test')
-rw-r--r--mysql-test/suite/rpl/t/rpl_grant.test37
1 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/t/rpl_grant.test b/mysql-test/suite/rpl/t/rpl_grant.test
new file mode 100644
index 00000000..02206453
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_grant.test
@@ -0,0 +1,37 @@
+# Tests of grants and users
+
+source include/not_embedded.inc;
+source include/master-slave.inc;
+
+connection master;
+
+CREATE USER dummy@localhost;
+CREATE USER dummy1@localhost, dummy2@localhost;
+
+SELECT user, host FROM mysql.user WHERE user like 'dummy%';
+SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
+sync_slave_with_master;
+--echo **** On Slave ****
+SELECT user,host FROM mysql.user WHERE user like 'dummy%';
+SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
+
+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 like 'dummy%';
+SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
+sync_slave_with_master;
+SELECT user,host FROM mysql.user WHERE user like 'dummy%';
+SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
+
+--source include/rpl_end.inc