~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/extra/rpl_tests/rpl_row_001.test

  • Committer: Brian Aker
  • Date: 2009-12-09 01:09:43 UTC
  • mfrom: (1240.1.8 build)
  • Revision ID: brian@gaz-20091209010943-n5iq2b9ins7mx73j
Merge build

Show diffs side-by-side

added added

removed removed

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