| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
---Setup Section -- |
| 4 |
set timestamp=1000000000; |
| 5 |
CREATE TABLE t1(word VARCHAR(20)); |
| 6 |
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY); |
| 7 |
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT); |
| 8 |
INSERT INTO t1 VALUES ("abirvalg"); |
| 9 |
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; |
| 10 |
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; |
| 11 |
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; |
| 12 |
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; |
| 13 |
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; |
| 14 |
set @d1 = 'dd1'; |
| 15 |
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1); |
| 16 |
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1); |
| 17 |
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1); |
| 18 |
---Test 1 check table load -- |
| 19 |
SELECT COUNT(*) from t1; |
| 20 |
COUNT(*) |
| 21 |
351 |
| 22 |
SELECT COUNT(*) from t2; |
| 23 |
COUNT(*) |
| 24 |
500 |
| 25 |
SELECT COUNT(*) from t3; |
| 26 |
COUNT(*) |
| 27 |
500 |
| 28 |
SELECT * FROM t1 ORDER BY word LIMIT 5; |
| 29 |
word |
| 30 |
Aarhus |
| 31 |
Aarhus |
| 32 |
Aarhus |
| 33 |
Aarhus |
| 34 |
Aarhus |
| 35 |
SELECT * FROM t2 ORDER BY id LIMIT 5; |
| 36 |
id |
| 37 |
1 |
| 38 |
2 |
| 39 |
3 |
| 40 |
4 |
| 41 |
5 |
| 42 |
SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; |
| 43 |
c1 c3 c4 c5 |
| 44 |
1 2006-02-22 00:00:00 Tested in Texas 2.2 |
| 45 |
2 2006-02-22 00:00:00 Tested in Texas 4.4 |
| 46 |
3 2006-02-22 00:00:00 Tested in Texas 6.6 |
| 47 |
4 2006-02-22 00:00:00 Tested in Texas 8.8 |
| 48 |
5 2006-02-22 00:00:00 Tested in Texas 11 |
| 49 |
connection slave; |
| 50 |
SELECT COUNT(*) from t1; |
| 51 |
COUNT(*) |
| 52 |
351 |
| 53 |
SELECT COUNT(*) from t2; |
| 54 |
COUNT(*) |
| 55 |
500 |
| 56 |
SELECT COUNT(*) from t3; |
| 57 |
COUNT(*) |
| 58 |
500 |
| 59 |
SELECT * FROM t1 ORDER BY word LIMIT 5; |
| 60 |
word |
| 61 |
Aarhus |
| 62 |
Aarhus |
| 63 |
Aarhus |
| 64 |
Aarhus |
| 65 |
Aarhus |
| 66 |
SELECT * FROM t2 ORDER BY id LIMIT 5; |
| 67 |
id |
| 68 |
1 |
| 69 |
2 |
| 70 |
3 |
| 71 |
4 |
| 72 |
5 |
| 73 |
SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; |
| 74 |
c1 c3 c4 c5 |
| 75 |
1 2006-02-22 00:00:00 Tested in Texas 2.2 |
| 76 |
2 2006-02-22 00:00:00 Tested in Texas 4.4 |
| 77 |
3 2006-02-22 00:00:00 Tested in Texas 6.6 |
| 78 |
4 2006-02-22 00:00:00 Tested in Texas 8.8 |
| 79 |
5 2006-02-22 00:00:00 Tested in Texas 11 |
| 80 |
connection master; |
| 81 |
insert into t1 values ("Alas"); |
| 82 |
flush logs; |
| 83 |
--- Test 1 Dump binlog to file -- |
| 84 |
--- Test 1 delete tables, clean master and slave -- |
| 85 |
DROP TABLE t1; |
| 86 |
DROP TABLE t2; |
| 87 |
DROP TABLE t3; |
| 88 |
connection slave; |
| 89 |
stop slave; |
| 90 |
include/wait_for_slave_to_stop.inc |
| 91 |
connection master; |
| 92 |
reset master; |
| 93 |
connection slave; |
| 94 |
include/reset_slave.inc |
| 95 |
start slave; |
| 96 |
include/wait_for_slave_to_start.inc |
| 97 |
connection master; |
| 98 |
--- Test 1 Load from Dump binlog file -- |
| 99 |
--- Test 1 Check Load Results -- |
| 100 |
SELECT COUNT(*) from t1; |
| 101 |
COUNT(*) |
| 102 |
352 |
| 103 |
SELECT COUNT(*) from t2; |
| 104 |
COUNT(*) |
| 105 |
500 |
| 106 |
SELECT COUNT(*) from t3; |
| 107 |
COUNT(*) |
| 108 |
500 |
| 109 |
SELECT * FROM t1 ORDER BY word LIMIT 5; |
| 110 |
word |
| 111 |
Aarhus |
| 112 |
Aarhus |
| 113 |
Aarhus |
| 114 |
Aarhus |
| 115 |
Aarhus |
| 116 |
SELECT * FROM t2 ORDER BY id LIMIT 5; |
| 117 |
id |
| 118 |
1 |
| 119 |
2 |
| 120 |
3 |
| 121 |
4 |
| 122 |
5 |
| 123 |
SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; |
| 124 |
c1 c3 c4 c5 |
| 125 |
1 2006-02-22 00:00:00 Tested in Texas 2.2 |
| 126 |
2 2006-02-22 00:00:00 Tested in Texas 4.4 |
| 127 |
3 2006-02-22 00:00:00 Tested in Texas 6.6 |
| 128 |
4 2006-02-22 00:00:00 Tested in Texas 8.8 |
| 129 |
5 2006-02-22 00:00:00 Tested in Texas 11 |
| 130 |
connection slave; |
| 131 |
SELECT COUNT(*) from t1; |
| 132 |
COUNT(*) |
| 133 |
352 |
| 134 |
SELECT COUNT(*) from t2; |
| 135 |
COUNT(*) |
| 136 |
500 |
| 137 |
SELECT COUNT(*) from t3; |
| 138 |
COUNT(*) |
| 139 |
500 |
| 140 |
SELECT * FROM t1 ORDER BY word LIMIT 5; |
| 141 |
word |
| 142 |
Aarhus |
| 143 |
Aarhus |
| 144 |
Aarhus |
| 145 |
Aarhus |
| 146 |
Aarhus |
| 147 |
SELECT * FROM t2 ORDER BY id LIMIT 5; |
| 148 |
id |
| 149 |
1 |
| 150 |
2 |
| 151 |
3 |
| 152 |
4 |
| 153 |
5 |
| 154 |
SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; |
| 155 |
c1 c3 c4 c5 |
| 156 |
1 2006-02-22 00:00:00 Tested in Texas 2.2 |
| 157 |
2 2006-02-22 00:00:00 Tested in Texas 4.4 |
| 158 |
3 2006-02-22 00:00:00 Tested in Texas 6.6 |
| 159 |
4 2006-02-22 00:00:00 Tested in Texas 8.8 |
| 160 |
5 2006-02-22 00:00:00 Tested in Texas 11 |
| 161 |
connection master; |
| 162 |
--- Test 2 position test -- |
| 163 |
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; |
| 164 |
/*!40019 SET @@session.max_delayed_threads=0*/; |
| 165 |
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; |
| 166 |
DELIMITER /*!*/; |
| 167 |
ROLLBACK/*!*/; |
| 168 |
use `test`/*!*/; |
| 169 |
SET TIMESTAMP=1000000000/*!*/; |
| 170 |
SET @@session.pseudo_thread_id=999999999/*!*/; |
| 171 |
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1, @@session.system_versioning_insert_history=0/*!*/; |
| 172 |
SET @@session.sql_mode=1411383296/*!*/; |
| 173 |
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; |
| 174 |
/*!\C latin1 *//*!*/; |
| 175 |
SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=2304/*!*/; |
| 176 |
SET @@session.lc_time_names=0/*!*/; |
| 177 |
SET @@session.collation_database=DEFAULT/*!*/; |
| 178 |
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT) |
| 179 |
/*!*/; |
| 180 |
DELIMITER ; |
| 181 |
# End of log file |
| 182 |
ROLLBACK /* added by mysqlbinlog */; |
| 183 |
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; |
| 184 |
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; |
| 185 |
--- Test 3 First Remote test -- |
| 186 |
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; |
| 187 |
/*!40019 SET @@session.max_delayed_threads=0*/; |
| 188 |
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; |
| 189 |
DELIMITER /*!*/; |
| 190 |
ROLLBACK/*!*/; |
| 191 |
use `test`/*!*/; |
| 192 |
SET TIMESTAMP=1000000000/*!*/; |
| 193 |
SET @@session.pseudo_thread_id=999999999/*!*/; |
| 194 |
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1, @@session.system_versioning_insert_history=0/*!*/; |
| 195 |
SET @@session.sql_mode=1411383296/*!*/; |
| 196 |
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; |
| 197 |
/*!\C latin1 *//*!*/; |
| 198 |
SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=2304/*!*/; |
| 199 |
SET @@session.lc_time_names=0/*!*/; |
| 200 |
SET @@session.collation_database=DEFAULT/*!*/; |
| 201 |
CREATE TABLE t1(word VARCHAR(20)) |
| 202 |
/*!*/; |
| 203 |
SET TIMESTAMP=1000000000/*!*/; |
| 204 |
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY) |
| 205 |
/*!*/; |
| 206 |
SET TIMESTAMP=1000000000/*!*/; |
| 207 |
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT) |
| 208 |
/*!*/; |
| 209 |
DELIMITER ; |
| 210 |
# End of log file |
| 211 |
ROLLBACK /* added by mysqlbinlog */; |
| 212 |
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; |
| 213 |
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; |
| 214 |
--- Test 4 Second Remote test -- |
| 215 |
DROP TABLE t1; |
| 216 |
DROP TABLE t2; |
| 217 |
DROP TABLE t3; |
| 218 |
connection slave; |
| 219 |
stop slave; |
| 220 |
include/wait_for_slave_to_stop.inc |
| 221 |
connection master; |
| 222 |
reset master; |
| 223 |
connection slave; |
| 224 |
include/reset_slave.inc |
| 225 |
start slave; |
| 226 |
include/wait_for_slave_to_start.inc |
| 227 |
connection master; |
| 228 |
SELECT COUNT(*) from t1; |
| 229 |
COUNT(*) |
| 230 |
352 |
| 231 |
SELECT COUNT(*) from t2; |
| 232 |
COUNT(*) |
| 233 |
500 |
| 234 |
SELECT COUNT(*) from t3; |
| 235 |
COUNT(*) |
| 236 |
500 |
| 237 |
SELECT * FROM t1 ORDER BY word LIMIT 5; |
| 238 |
word |
| 239 |
Aarhus |
| 240 |
Aarhus |
| 241 |
Aarhus |
| 242 |
Aarhus |
| 243 |
Aarhus |
| 244 |
SELECT * FROM t2 ORDER BY id LIMIT 5; |
| 245 |
id |
| 246 |
1 |
| 247 |
2 |
| 248 |
3 |
| 249 |
4 |
| 250 |
5 |
| 251 |
SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; |
| 252 |
c1 c3 c4 c5 |
| 253 |
1 2006-02-22 00:00:00 Tested in Texas 2.2 |
| 254 |
2 2006-02-22 00:00:00 Tested in Texas 4.4 |
| 255 |
3 2006-02-22 00:00:00 Tested in Texas 6.6 |
| 256 |
4 2006-02-22 00:00:00 Tested in Texas 8.8 |
| 257 |
5 2006-02-22 00:00:00 Tested in Texas 11 |
| 258 |
connection slave; |
| 259 |
SELECT COUNT(*) from t1; |
| 260 |
COUNT(*) |
| 261 |
352 |
| 262 |
SELECT COUNT(*) from t2; |
| 263 |
COUNT(*) |
| 264 |
500 |
| 265 |
SELECT COUNT(*) from t3; |
| 266 |
COUNT(*) |
| 267 |
500 |
| 268 |
SELECT * FROM t1 ORDER BY word LIMIT 5; |
| 269 |
word |
| 270 |
Aarhus |
| 271 |
Aarhus |
| 272 |
Aarhus |
| 273 |
Aarhus |
| 274 |
Aarhus |
| 275 |
SELECT * FROM t2 ORDER BY id LIMIT 5; |
| 276 |
id |
| 277 |
1 |
| 278 |
2 |
| 279 |
3 |
| 280 |
4 |
| 281 |
5 |
| 282 |
SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; |
| 283 |
c1 c3 c4 c5 |
| 284 |
1 2006-02-22 00:00:00 Tested in Texas 2.2 |
| 285 |
2 2006-02-22 00:00:00 Tested in Texas 4.4 |
| 286 |
3 2006-02-22 00:00:00 Tested in Texas 6.6 |
| 287 |
4 2006-02-22 00:00:00 Tested in Texas 8.8 |
| 288 |
5 2006-02-22 00:00:00 Tested in Texas 11 |
| 289 |
connection master; |
| 290 |
--- Test 5 LOAD DATA -- |
| 291 |
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; |
| 292 |
/*!40019 SET @@session.max_delayed_threads=0*/; |
| 293 |
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; |
| 294 |
DELIMITER /*!*/; |
| 295 |
DELIMITER ; |
| 296 |
# End of log file |
| 297 |
ROLLBACK /* added by mysqlbinlog */; |
| 298 |
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; |
| 299 |
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; |
| 300 |
--- Test 6 reading stdin -- |
| 301 |
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; |
| 302 |
/*!40019 SET @@session.max_delayed_threads=0*/; |
| 303 |
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; |
| 304 |
DELIMITER /*!*/; |
| 305 |
ROLLBACK/*!*/; |
| 306 |
use `test`/*!*/; |
| 307 |
SET TIMESTAMP=1000000000/*!*/; |
| 308 |
SET @@session.pseudo_thread_id=999999999/*!*/; |
| 309 |
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1, @@session.system_versioning_insert_history=0/*!*/; |
| 310 |
SET @@session.sql_mode=1411383296/*!*/; |
| 311 |
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; |
| 312 |
/*!\C latin1 *//*!*/; |
| 313 |
SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=2304/*!*/; |
| 314 |
SET @@session.lc_time_names=0/*!*/; |
| 315 |
SET @@session.collation_database=DEFAULT/*!*/; |
| 316 |
CREATE TABLE t1(word VARCHAR(20)) |
| 317 |
/*!*/; |
| 318 |
SET TIMESTAMP=1000000000/*!*/; |
| 319 |
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY) |
| 320 |
/*!*/; |
| 321 |
SET TIMESTAMP=1000000000/*!*/; |
| 322 |
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT) |
| 323 |
/*!*/; |
| 324 |
DELIMITER ; |
| 325 |
# End of log file |
| 326 |
ROLLBACK /* added by mysqlbinlog */; |
| 327 |
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; |
| 328 |
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; |
| 329 |
--- Test 7 reading stdin w/position -- |
| 330 |
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; |
| 331 |
/*!40019 SET @@session.max_delayed_threads=0*/; |
| 332 |
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; |
| 333 |
DELIMITER /*!*/; |
| 334 |
ROLLBACK/*!*/; |
| 335 |
use `test`/*!*/; |
| 336 |
SET TIMESTAMP=1000000000/*!*/; |
| 337 |
SET @@session.pseudo_thread_id=999999999/*!*/; |
| 338 |
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1, @@session.system_versioning_insert_history=0/*!*/; |
| 339 |
SET @@session.sql_mode=1411383296/*!*/; |
| 340 |
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; |
| 341 |
/*!\C latin1 *//*!*/; |
| 342 |
SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=2304/*!*/; |
| 343 |
SET @@session.lc_time_names=0/*!*/; |
| 344 |
SET @@session.collation_database=DEFAULT/*!*/; |
| 345 |
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT) |
| 346 |
/*!*/; |
| 347 |
DELIMITER ; |
| 348 |
# End of log file |
| 349 |
ROLLBACK /* added by mysqlbinlog */; |
| 350 |
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; |
| 351 |
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; |
| 352 |
--- Test 8 switch internal charset -- |
| 353 |
connection slave; |
| 354 |
stop slave; |
| 355 |
include/wait_for_slave_to_stop.inc |
| 356 |
connection master; |
| 357 |
reset master; |
| 358 |
connection slave; |
| 359 |
include/reset_slave.inc |
| 360 |
start slave; |
| 361 |
include/wait_for_slave_to_start.inc |
| 362 |
connection master; |
| 363 |
create table t4 (f text character set utf8); |
| 364 |
create table t5 (f text character set cp932); |
| 365 |
flush logs; |
| 366 |
rename table t4 to t04, t5 to t05; |
| 367 |
select HEX(f) from t04; |
| 368 |
HEX(f) |
| 369 |
E382BD |
| 370 |
select HEX(f) from t4; |
| 371 |
HEX(f) |
| 372 |
E382BD |
| 373 |
select HEX(f) from t05; |
| 374 |
HEX(f) |
| 375 |
835C |
| 376 |
select HEX(f) from t5; |
| 377 |
HEX(f) |
| 378 |
835C |
| 379 |
connection slave; |
| 380 |
select HEX(f) from t04; |
| 381 |
HEX(f) |
| 382 |
E382BD |
| 383 |
select HEX(f) from t4; |
| 384 |
HEX(f) |
| 385 |
E382BD |
| 386 |
select HEX(f) from t05; |
| 387 |
HEX(f) |
| 388 |
835C |
| 389 |
select HEX(f) from t5; |
| 390 |
HEX(f) |
| 391 |
835C |
| 392 |
--- Test cleanup -- |
| 393 |
connection master; |
| 394 |
connection slave; |
| 395 |
connection master; |
| 396 |
DROP TABLE t1, t2, t3, t04, t05, t4, t5; |
| 397 |
CREATE TABLE t1 (a INT NOT NULL KEY, b INT); |
| 398 |
INSERT INTO t1 VALUES(1,1); |
| 399 |
SELECT * FROM t1; |
| 400 |
a b |
| 401 |
1 1 |
| 402 |
FLUSH LOGS; |
| 403 |
DROP TABLE t1; |
| 404 |
connection slave; |
| 405 |
include/rpl_end.inc |