~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_row_001.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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;
 
8
 
 
9
#
 
10
# Test slave with wrong password
 
11
#
 
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;
 
21
#
 
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;
 
28
 
 
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;
 
39
 
 
40
# Test if the slave SQL thread can be more than 16K behind the slave
 
41
# I/O thread (> IO_SIZE)
 
42
 
 
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;
 
52
 
 
53
connection master;
 
54
let $1=5000;
 
55
# Generate 16K of relay log
 
56
disable_query_log;
 
57
while ($1)
 
58
{
 
59
 eval INSERT INTO t1 VALUES($1);
 
60
 dec $1;
 
61
}
 
62
enable_query_log;
 
63
SELECT COUNT(*) FROM t1;
 
64
save_master_pos;
 
65
 
 
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;
 
73
 
 
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;
 
80
 
 
81
connection master;
 
82
DROP TABLE t1;
 
83
sync_slave_with_master;