1include/master-slave.inc 2Warnings: 3Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. 4Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. 5[connection master] 6 7---Setup Section -- 8set timestamp=1000000000; 9DROP TABLE IF EXISTS t1,t2,t3; 10CREATE TABLE t1(word VARCHAR(20)); 11CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY); 12CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT); 13 14---Test1 check table load -- 15SELECT COUNT(*) from t1; 16COUNT(*) 17351 18SELECT COUNT(*) from t2; 19COUNT(*) 20500 21SELECT COUNT(*) from t3; 22COUNT(*) 23500 24SELECT * FROM t1 ORDER BY word LIMIT 5; 25word 26Aarhus 27Aarhus 28Aarhus 29Aarhus 30Aarhus 31SELECT * FROM t2 ORDER BY id LIMIT 5; 32id 331 342 353 364 375 38SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; 39c1 c3 c4 c5 401 2006-02-22 00:00:00 Tested in Texas 2.2 412 2006-02-22 00:00:00 Tested in Texas 4.4 423 2006-02-22 00:00:00 Tested in Texas 6.6 434 2006-02-22 00:00:00 Tested in Texas 8.8 445 2006-02-22 00:00:00 Tested in Texas 11 45SELECT COUNT(*) from t1; 46COUNT(*) 47351 48SELECT COUNT(*) from t2; 49COUNT(*) 50500 51SELECT COUNT(*) from t3; 52COUNT(*) 53500 54SELECT * FROM t1 ORDER BY word LIMIT 5; 55word 56Aarhus 57Aarhus 58Aarhus 59Aarhus 60Aarhus 61SELECT * FROM t2 ORDER BY id LIMIT 5; 62id 631 642 653 664 675 68SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; 69c1 c3 c4 c5 701 2006-02-22 00:00:00 Tested in Texas 2.2 712 2006-02-22 00:00:00 Tested in Texas 4.4 723 2006-02-22 00:00:00 Tested in Texas 6.6 734 2006-02-22 00:00:00 Tested in Texas 8.8 745 2006-02-22 00:00:00 Tested in Texas 11 75insert into t1 values ("Alas"); 76flush logs; 77 78--- Test 1 Dump binlog to file -- 79 80--- Test 1 delete tables, clean master and slave -- 81DROP TABLE t1; 82DROP TABLE t2; 83DROP TABLE t3; 84stop slave; 85include/wait_for_slave_to_stop.inc 86reset master; 87reset slave; 88reset master; 89start slave; 90include/wait_for_slave_to_start.inc 91 92--- Test 1 Load from Dump binlog file -- 93 94--- Test 1 Check Load Results -- 95SELECT COUNT(*) from t1; 96COUNT(*) 97352 98SELECT COUNT(*) from t2; 99COUNT(*) 100500 101SELECT COUNT(*) from t3; 102COUNT(*) 103500 104SELECT * FROM t1 ORDER BY word LIMIT 5; 105word 106Aarhus 107Aarhus 108Aarhus 109Aarhus 110Aarhus 111SELECT * FROM t2 ORDER BY id LIMIT 5; 112id 1131 1142 1153 1164 1175 118SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; 119c1 c3 c4 c5 1201 2006-02-22 00:00:00 Tested in Texas 2.2 1212 2006-02-22 00:00:00 Tested in Texas 4.4 1223 2006-02-22 00:00:00 Tested in Texas 6.6 1234 2006-02-22 00:00:00 Tested in Texas 8.8 1245 2006-02-22 00:00:00 Tested in Texas 11 125SELECT COUNT(*) from t1; 126COUNT(*) 127352 128SELECT COUNT(*) from t2; 129COUNT(*) 130500 131SELECT COUNT(*) from t3; 132COUNT(*) 133500 134SELECT * FROM t1 ORDER BY word LIMIT 5; 135word 136Aarhus 137Aarhus 138Aarhus 139Aarhus 140Aarhus 141SELECT * FROM t2 ORDER BY id LIMIT 5; 142id 1431 1442 1453 1464 1475 148SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; 149c1 c3 c4 c5 1501 2006-02-22 00:00:00 Tested in Texas 2.2 1512 2006-02-22 00:00:00 Tested in Texas 4.4 1523 2006-02-22 00:00:00 Tested in Texas 6.6 1534 2006-02-22 00:00:00 Tested in Texas 8.8 1545 2006-02-22 00:00:00 Tested in Texas 11 155 156--- Test 2 position test -- 157include/mysqlbinlog.inc 158/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; 159/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; 160DELIMITER /*!*/; 161ROLLBACK/*!*/; 162SET @@SESSION.GTID_NEXT= '#'/*!*/; 163use `test`/*!*/; 164SET TIMESTAMP=#/*!*/; 165SET @@session.pseudo_thread_id=#/*!*/; 166SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; 167SET @@session.sql_mode=1436549152/*!*/; 168SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; 169/*!\C latin1 *//*!*/; 170SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 171SET @@session.lc_time_names=0/*!*/; 172SET @@session.collation_database=DEFAULT/*!*/; 173SET @@session.explicit_defaults_for_timestamp=0/*!*/; 174CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT) 175/*!*/; 176SET @@SESSION.GTID_NEXT= '#' /* added by mysqlbinlog */ /*!*/; 177DELIMITER ; 178# End of log file 179/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; 180/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; 181 182--- Test 3 First Remote test -- 183include/mysqlbinlog.inc 184/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; 185/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; 186DELIMITER /*!*/; 187ROLLBACK/*!*/; 188# [empty] 189SET @@SESSION.GTID_NEXT= '#'/*!*/; 190use `test`/*!*/; 191SET TIMESTAMP=#/*!*/; 192SET @@session.pseudo_thread_id=#/*!*/; 193SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; 194SET @@session.sql_mode=1436549152/*!*/; 195SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; 196/*!\C latin1 *//*!*/; 197SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 198SET @@session.lc_time_names=0/*!*/; 199SET @@session.collation_database=DEFAULT/*!*/; 200DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */ 201/*!*/; 202SET @@SESSION.GTID_NEXT= '#'/*!*/; 203SET TIMESTAMP=#/*!*/; 204CREATE TABLE t1(word VARCHAR(20)) 205/*!*/; 206SET @@SESSION.GTID_NEXT= '#'/*!*/; 207SET TIMESTAMP=#/*!*/; 208CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY) 209/*!*/; 210SET @@SESSION.GTID_NEXT= '#'/*!*/; 211SET TIMESTAMP=#/*!*/; 212SET @@session.explicit_defaults_for_timestamp=0/*!*/; 213CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT) 214/*!*/; 215SET @@SESSION.GTID_NEXT= '#' /* added by mysqlbinlog */ /*!*/; 216DELIMITER ; 217# End of log file 218/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; 219/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; 220 221--- Test 4 Second Remote test -- 222DROP TABLE t1; 223DROP TABLE t2; 224DROP TABLE t3; 225stop slave; 226include/wait_for_slave_to_stop.inc 227reset master; 228reset slave; 229reset master; 230start slave; 231include/wait_for_slave_to_start.inc 232SELECT COUNT(*) from t1; 233COUNT(*) 234352 235SELECT COUNT(*) from t2; 236COUNT(*) 237500 238SELECT COUNT(*) from t3; 239COUNT(*) 240500 241SELECT * FROM t1 ORDER BY word LIMIT 5; 242word 243Aarhus 244Aarhus 245Aarhus 246Aarhus 247Aarhus 248SELECT * FROM t2 ORDER BY id LIMIT 5; 249id 2501 2512 2523 2534 2545 255SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; 256c1 c3 c4 c5 2571 2006-02-22 00:00:00 Tested in Texas 2.2 2582 2006-02-22 00:00:00 Tested in Texas 4.4 2593 2006-02-22 00:00:00 Tested in Texas 6.6 2604 2006-02-22 00:00:00 Tested in Texas 8.8 2615 2006-02-22 00:00:00 Tested in Texas 11 262SELECT COUNT(*) from t1; 263COUNT(*) 264352 265SELECT COUNT(*) from t2; 266COUNT(*) 267500 268SELECT COUNT(*) from t3; 269COUNT(*) 270500 271SELECT * FROM t1 ORDER BY word LIMIT 5; 272word 273Aarhus 274Aarhus 275Aarhus 276Aarhus 277Aarhus 278SELECT * FROM t2 ORDER BY id LIMIT 5; 279id 2801 2812 2823 2834 2845 285SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5; 286c1 c3 c4 c5 2871 2006-02-22 00:00:00 Tested in Texas 2.2 2882 2006-02-22 00:00:00 Tested in Texas 4.4 2893 2006-02-22 00:00:00 Tested in Texas 6.6 2904 2006-02-22 00:00:00 Tested in Texas 8.8 2915 2006-02-22 00:00:00 Tested in Texas 11 292 293--- Test 5 LOAD DATA -- 294include/mysqlbinlog.inc 295/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; 296/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; 297DELIMITER /*!*/; 298SET @@SESSION.GTID_NEXT= '#' /* added by mysqlbinlog */ /*!*/; 299DELIMITER ; 300# End of log file 301/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; 302/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; 303 304--- Test 6 reading stdin -- 305include/mysqlbinlog.inc 306/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; 307/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; 308DELIMITER /*!*/; 309ROLLBACK/*!*/; 310# [empty] 311SET @@SESSION.GTID_NEXT= '#'/*!*/; 312use `test`/*!*/; 313SET TIMESTAMP=#/*!*/; 314SET @@session.pseudo_thread_id=#/*!*/; 315SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; 316SET @@session.sql_mode=1436549152/*!*/; 317SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; 318/*!\C latin1 *//*!*/; 319SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 320SET @@session.lc_time_names=0/*!*/; 321SET @@session.collation_database=DEFAULT/*!*/; 322DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */ 323/*!*/; 324SET @@SESSION.GTID_NEXT= '#'/*!*/; 325SET TIMESTAMP=#/*!*/; 326CREATE TABLE t1(word VARCHAR(20)) 327/*!*/; 328SET @@SESSION.GTID_NEXT= '#'/*!*/; 329SET TIMESTAMP=#/*!*/; 330CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY) 331/*!*/; 332SET @@SESSION.GTID_NEXT= '#'/*!*/; 333SET TIMESTAMP=#/*!*/; 334SET @@session.explicit_defaults_for_timestamp=0/*!*/; 335CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT) 336/*!*/; 337SET @@SESSION.GTID_NEXT= '#' /* added by mysqlbinlog */ /*!*/; 338DELIMITER ; 339# End of log file 340/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; 341/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; 342 343--- Test 7 reading stdin w/position -- 344include/mysqlbinlog.inc 345/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; 346/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; 347DELIMITER /*!*/; 348ROLLBACK/*!*/; 349SET @@SESSION.GTID_NEXT= '#'/*!*/; 350use `test`/*!*/; 351SET TIMESTAMP=#/*!*/; 352SET @@session.pseudo_thread_id=#/*!*/; 353SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; 354SET @@session.sql_mode=1436549152/*!*/; 355SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; 356/*!\C latin1 *//*!*/; 357SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 358SET @@session.lc_time_names=0/*!*/; 359SET @@session.collation_database=DEFAULT/*!*/; 360SET @@session.explicit_defaults_for_timestamp=0/*!*/; 361CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT) 362/*!*/; 363SET @@SESSION.GTID_NEXT= '#' /* added by mysqlbinlog */ /*!*/; 364DELIMITER ; 365# End of log file 366/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; 367/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; 368 369--- Test 8 switch internal charset -- 370stop slave; 371include/wait_for_slave_to_stop.inc 372reset master; 373reset slave; 374reset master; 375start slave; 376include/wait_for_slave_to_start.inc 377create table t4 (f text character set utf8); 378create table t5 (f text character set cp932); 379flush logs; 380rename table t4 to t04, t5 to t05; 381select HEX(f) from t04; 382HEX(f) 383E382BD 384select HEX(f) from t4; 385HEX(f) 386E382BD 387select HEX(f) from t05; 388HEX(f) 389835C 390select HEX(f) from t5; 391HEX(f) 392835C 393select HEX(f) from t04; 394HEX(f) 395E382BD 396select HEX(f) from t4; 397HEX(f) 398E382BD 399select HEX(f) from t05; 400HEX(f) 401835C 402select HEX(f) from t5; 403HEX(f) 404835C 405 406--- Test cleanup -- 407DROP TABLE IF EXISTS t1; 408CREATE TABLE t1 (a INT NOT NULL KEY, b INT); 409INSERT INTO t1 VALUES(1,1); 410SELECT * FROM t1; 411a b 4121 1 413FLUSH LOGS; 414DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5; 415include/rpl_end.inc 416