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

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_row_until.test

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-21 15:31:05 UTC
  • mfrom: (1.1.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20100621153105-pbbz3t6nyrf9t2zq
Tags: upstream-5.1.48
ImportĀ upstreamĀ versionĀ 5.1.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Save master log postion for query DROP TABLE t1
16
16
save_master_pos;
17
17
let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 7);
 
18
let $master_log_file= query_get_value(SHOW BINLOG EVENTS, Log_name, 7);
18
19
 
19
20
CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
20
21
# Save master log postion for query CREATE TABLE t2
46
47
 
47
48
# Try to replicate all queries until drop of t1
48
49
connection slave;
49
 
echo START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1;
 
50
echo START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_drop_t1;
50
51
--disable_query_log
51
 
eval START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=$master_pos_drop_t1;
 
52
eval START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_drop_t1;
52
53
--enable_query_log
53
54
--source include/wait_for_slave_sql_to_stop.inc
54
55
 
55
56
# Here table should be still not deleted
56
57
SELECT * FROM t1;
57
 
--replace_result $master_pos_drop_t1 MASTER_POS_DROP_T1
58
 
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
59
 
query_vertical SHOW SLAVE STATUS;
 
58
--let $slave_param= Exec_Master_Log_Pos
 
59
--let $slave_param_value= $master_pos_drop_t1
 
60
--source include/check_slave_param.inc
60
61
 
61
62
# This should fail right after start
 
63
--replace_result 291 MASTER_LOG_POS
62
64
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
63
65
--source include/wait_for_slave_sql_to_stop.inc
64
66
# again this table should be still not deleted
65
67
SELECT * FROM t1;
66
 
--replace_result $master_pos_drop_t1 MASTER_POS_DROP_T1
67
 
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
68
 
query_vertical SHOW SLAVE STATUS;
 
68
 
 
69
--let $slave_param= Exec_Master_Log_Pos
 
70
--let $slave_param_value= $master_pos_drop_t1
 
71
--source include/check_slave_param.inc
69
72
 
70
73
# Try replicate all up to and not including the second insert to t2;
71
74
echo START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2;
74
77
--enable_query_log
75
78
--source include/wait_for_slave_sql_to_stop.inc
76
79
SELECT * FROM t2;
77
 
--replace_result $relay_pos_insert1_t2 RELAY_POS_INSERT1_T2 $master_pos_insert1_t2 MASTER_POS_INSERT1_T2
78
 
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
79
 
query_vertical SHOW SLAVE STATUS;
 
80
 
 
81
--let $slave_param= Exec_Master_Log_Pos
 
82
--let $slave_param_value= $master_pos_insert1_t2
 
83
--source include/check_slave_param.inc
80
84
 
81
85
# clean up
82
86
START SLAVE;
86
90
--source include/stop_slave.inc
87
91
 
88
92
# This should stop immediately as we are already there
89
 
echo START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2;
 
93
echo START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_create_t2;
90
94
--disable_query_log
91
 
eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=$master_pos_create_t2;
 
95
eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_create_t2;
92
96
--enable_query_log
93
97
let $slave_param= Until_Log_Pos;
94
98
let $slave_param_value= $master_pos_create_t2;
95
99
--source include/wait_for_slave_param.inc
96
100
--source include/wait_for_slave_sql_to_stop.inc
97
101
# here the sql slave thread should be stopped
98
 
--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
99
 
--replace_result $master_pos_create_t2 MASTER_POS_CREATE_T2 $master_pos_drop_t2 MASTER_POS_DROP_T2
100
 
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
101
 
query_vertical SHOW SLAVE STATUS;
 
102
--let $slave_param= Exec_Master_Log_Pos
 
103
--let $slave_param_value= $master_pos_drop_t2
 
104
--source include/check_slave_param.inc
102
105
 
103
106
#testing various error conditions
 
107
--replace_result 561 MASTER_LOG_POS
104
108
--error 1277
105
109
START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=561;
 
110
--replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS
106
111
--error 1277
107
112
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=561, RELAY_LOG_POS=12;
108
113
--error 1277
109
114
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001';
110
115
--error 1277
111
116
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009';
 
117
--replace_result 561 MASTER_LOG_POS
112
118
--error 1277
113
119
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561;
114
120
# Warning should be given for second command
115
121
START SLAVE;
 
122
--replace_result 740 MASTER_LOG_POS
116
123
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740;