mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / extra / rpl_tests / rpl_row_001.test
blob8eb684e0dff9d5a0b02262a5b1ee5d77f77d67e3
1 let $LOAD_FILE= $MYSQLTEST_VARDIR/std_data/words.dat;
2 CREATE TABLE t1 (word CHAR(20) NOT NULL);
3 --replace_result $LOAD_FILE LOAD_FILE
4 eval LOAD DATA INFILE '$LOAD_FILE' INTO TABLE t1;
5 --replace_result $LOAD_FILE LOAD_FILE
6 eval LOAD DATA INFILE '$LOAD_FILE' INTO TABLE t1;
7 SELECT * FROM t1  ORDER BY word LIMIT 10;
10 # Test slave with wrong password
12 save_master_pos;
13 connection slave;
14 sync_with_master;
15 STOP SLAVE;
16 connection master;
17 SET PASSWORD FOR root@"localhost" = PASSWORD('foo');
18 connection slave;
19 START SLAVE;
20 connection master;
22 # Give slave time to do at last one failed connect retry
23 # This one must be short so that the slave will not stop retrying
24 real_sleep 2;
25 SET PASSWORD FOR root@"localhost" = PASSWORD('');
26 # Give slave time to connect (will retry every second)
27 sleep 2;
29 CREATE TABLE t3(n INT);
30 INSERT INTO t3 VALUES(1),(2);
31 sync_slave_with_master;
32 SELECT * FROM t3 ORDER BY n;
33 SELECT SUM(LENGTH(word)) FROM t1;
34 connection master;
35 DROP TABLE t1,t3;
36 save_master_pos;
37 connection slave;
38 sync_with_master;
40 # Test if the slave SQL thread can be more than 16K behind the slave
41 # I/O thread (> IO_SIZE)
43 connection master;
44 # we'll use table-level locking to delay slave SQL thread
45 eval CREATE TABLE t1 (n INT) ENGINE=$engine_type;
46 sync_slave_with_master;
47 connection master;
48 RESET MASTER;
49 connection slave;
50 STOP SLAVE;
51 RESET SLAVE;
53 connection master;
54 let $1=5000;
55 # Generate 16K of relay log
56 disable_query_log;
57 while ($1)
59  eval INSERT INTO t1 VALUES($1);
60  dec $1;
62 enable_query_log;
63 SELECT COUNT(*) FROM t1;
64 save_master_pos;
66 # Try to cause a large relay log lag on the slave by locking t1
67 connection slave;
68 LOCK TABLES t1 READ;
69 START SLAVE;
70 UNLOCK TABLES;
71 sync_with_master;
72 SELECT COUNT(*) FROM t1;
74 connection master;
75 DROP TABLE t1;
76 CREATE TABLE t1 (n INT);
77 INSERT INTO t1 VALUES(3456);
78 sync_slave_with_master;
79 SELECT n FROM t1;
81 connection master;
82 DROP TABLE t1;
83 sync_slave_with_master;