summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/grant.test1
-rw-r--r--mysql-test/t/myisam.test10
-rw-r--r--mysql-test/t/rpl_flush_log_loop-master.opt1
-rw-r--r--mysql-test/t/rpl_flush_log_loop-slave.opt1
-rw-r--r--mysql-test/t/rpl_flush_log_loop.test17
-rw-r--r--mysql-test/t/rpl_log.test40
-rw-r--r--mysql-test/t/rpl_mystery22.test2
-rw-r--r--mysql-test/t/rpl_redirect.test (renamed from mysql-test/t/rpl_magic.test)13
-rw-r--r--mysql-test/t/rpl_rotate_logs.test7
9 files changed, 70 insertions, 22 deletions
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index be1b09a9b78..c75069f8c55 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -8,6 +8,7 @@ flush privileges;
grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
show grants for mysqltest_1@localhost;
grant delete on mysqltest.* to mysqltest_1@localhost;
+select * from mysql.user where user="mysqltest_1";
show grants for mysqltest_1@localhost;
revoke delete on mysqltest.* from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index dec53e92036..cba7b522650 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -104,3 +104,13 @@ INSERT INTO t1 VALUES (1), (2), (3);
OPTIMIZE TABLE t1;
DROP TABLE t1;
+#
+# Test of creating table with too long key
+#
+
+--error 1071
+CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), KEY t1 (a, b, c));
+CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255));
+--error 1071
+ALTER TABLE t1 ADD INDEX t1 (a, b, c);
+DROP TABLE t1;
diff --git a/mysql-test/t/rpl_flush_log_loop-master.opt b/mysql-test/t/rpl_flush_log_loop-master.opt
new file mode 100644
index 00000000000..eb35347af33
--- /dev/null
+++ b/mysql-test/t/rpl_flush_log_loop-master.opt
@@ -0,0 +1 @@
+-O max_binlog_size=1M
diff --git a/mysql-test/t/rpl_flush_log_loop-slave.opt b/mysql-test/t/rpl_flush_log_loop-slave.opt
new file mode 100644
index 00000000000..eb35347af33
--- /dev/null
+++ b/mysql-test/t/rpl_flush_log_loop-slave.opt
@@ -0,0 +1 @@
+-O max_binlog_size=1M
diff --git a/mysql-test/t/rpl_flush_log_loop.test b/mysql-test/t/rpl_flush_log_loop.test
new file mode 100644
index 00000000000..2b559180a42
--- /dev/null
+++ b/mysql-test/t/rpl_flush_log_loop.test
@@ -0,0 +1,17 @@
+# Testing if "flush logs" command bouncing resulting in logs created in a loop
+# in case of bi-directional replication
+
+source include/master-slave.inc
+
+connection slave;
+eval change master to master_host='127.0.0.1',master_user='root',
+ master_password='',master_port=$MASTER_MYPORT;
+slave start;
+connection master;
+slave stop;
+eval change master to master_host='127.0.0.1',master_user='root',
+ master_password='',master_port=$SLAVE_MYPORT;
+slave start;
+flush logs;
+sleep 5;
+show slave status;
diff --git a/mysql-test/t/rpl_log.test b/mysql-test/t/rpl_log.test
index 3514d435737..85782e78142 100644
--- a/mysql-test/t/rpl_log.test
+++ b/mysql-test/t/rpl_log.test
@@ -9,7 +9,6 @@ let $VERSION=`select version()`;
connection master;
reset master;
-drop table if exists t1;
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL);
drop table t1;
@@ -22,6 +21,19 @@ show binlog events from 79 limit 1;
show binlog events from 79 limit 2;
show binlog events from 79 limit 2,1;
flush logs;
+
+# Sync slave and force it to start on another binary log
+
+save_master_pos;
+connection slave;
+slave start;
+sync_with_master;
+flush logs;
+slave stop;
+connection master;
+
+# Create some entries for second log
+
create table t1 (n int);
insert into t1 values (1);
drop table t1;
@@ -35,23 +47,19 @@ slave start;
sync_with_master;
show master logs;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
-# We can't compare binlog from slave as the result differ between
-# machines based on where the LOAD DATA file is stored.
-disable_result_log;
-
show binlog events in 'slave-bin.001' from 4;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
-enable_result_log;
show binlog events in 'slave-bin.002' from 4;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
-show new master for slave with master_log_file='master-bin.001' and
- master_log_pos=4 and master_server_id=1;
-show new master for slave with master_log_file='master-bin.001' and
- master_log_pos=79 and master_server_id=1;
-show new master for slave with master_log_file='master-bin.001' and
- master_log_pos=311 and master_server_id=1;
-show new master for slave with master_log_file='master-bin.002' and
- master_log_pos=4 and master_server_id=1;
-show new master for slave with master_log_file='master-bin.002' and
- master_log_pos=122 and master_server_id=1;
+
+# Need to recode the following
+
+#show new master for slave with master_log_file='master-bin.001' and master_log_pos=4 and master_server_id=1;
+#show new master for slave with master_log_file='master-bin.001' and master_log_pos=79 and master_server_id=1;
+#show new master for slave with master_log_file='master-bin.001' and master_log_pos=311 and master_server_id=1;
+#show new master for slave with master_log_file='master-bin.002' and master_log_pos=4 and master_server_id=1;
+#show new master for slave with master_log_file='master-bin.002' and master_log_pos=122 and master_server_id=1;
+
+--error 1220
+show binlog events in 'slave-bin.005' from 4;
diff --git a/mysql-test/t/rpl_mystery22.test b/mysql-test/t/rpl_mystery22.test
index 371c5ba21ed..5280cb360dd 100644
--- a/mysql-test/t/rpl_mystery22.test
+++ b/mysql-test/t/rpl_mystery22.test
@@ -13,7 +13,7 @@ insert into t1 values(NULL);
insert into t1 values(NULL);
save_master_pos;
connection slave;
-sleep 1; # there is no way around this sleep - we have to wait until
+sleep 3; # there is no way around this sleep - we have to wait until
# the slave tries to run the query, fails and aborts slave thread
delete from t1 where n = 2;
slave start;
diff --git a/mysql-test/t/rpl_magic.test b/mysql-test/t/rpl_redirect.test
index c93add93d9d..4082542f295 100644
--- a/mysql-test/t/rpl_magic.test
+++ b/mysql-test/t/rpl_redirect.test
@@ -1,3 +1,7 @@
+#
+# Test of automatic redirection of queries to master/slave.
+#
+
source include/master-slave.inc;
#first, make sure the slave has had enough time to register
@@ -7,6 +11,10 @@ sync_with_master;
#discover slaves
connection master;
+--replace_result $MASTER_MYPORT MASTER_PORT
+SHOW SLAVE STATUS;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+SHOW SLAVE HOSTS;
rpl_probe;
#turn on master/slave query direction auto-magic
@@ -16,11 +24,12 @@ create table t1 ( n int);
insert into t1 values (1),(2),(3),(4);
disable_rpl_parse;
save_master_pos;
-enable_rpl_parse;
connection slave;
sync_with_master;
insert into t1 values(5);
connection master;
+enable_rpl_parse;
+# The first of the queries will be sent to the slave, the second to the master.
select * from t1;
select * from t1;
disable_rpl_parse;
@@ -28,3 +37,5 @@ select * from t1;
connection slave;
select * from t1;
drop table t1;
+connection master;
+drop table t1;
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
index cea2f9008dc..f6fbb76e55e 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -20,12 +20,11 @@ system chmod 600 var/slave-data/master.info;
--error 1201
slave start;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
-!eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT,
- master_user='root';
+# Will get error 13 on Unix systems becasue file is not readable
+!eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
reset slave;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
-eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT,
- master_user='root';
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
connection master;
reset master;
connection slave;