mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / rpl / t / rpl_load_table_from_master.test
blob5474124c337e19eb9d64c1c857087fc43966e714
1 ###########################################################
2 # Change Author: JBM
3 # Change Date: 2006-2-2
4 # Change: Added ENGINE=$engine_type for first create table
5 # Reason: Only MyISAM supports load from master no need to
6 # run test case for other engines, in addition test will
7 # fail if other engines are set as default engine
8 ###########################################################
9 # Change Author: JBM
10 # Change Date: 2006-2-3
11 # Change: removed ENGINE=$engine_type for first create table
12 # and renamed test file to rpl_load_table_from_master.test.
13 # In addition added test requirements.
14 # Reason: Request from review.
15 ############################################################
16 # REQUIREMENT TEST 1:
17 # LOAD TABLE FROM MASTER must work with a forced timestamp.
18 ############################################################
20 # Test forced timestamp
22 -- source include/master-slave.inc
24 -- echo "******************** Test Requirment 1 *************"
26 # Don't log table creating to the slave as we want to test LOAD TABLE
27 SET SQL_LOG_BIN=0,timestamp=200006;
28 eval CREATE TABLE t1(t TIMESTAMP NOT NULL,a CHAR(1))ENGINE=MyISAM;
29 INSERT INTO t1 ( a) VALUE ('F');
30 select unix_timestamp(t) from t1;
31 connection slave;
32 load table t1 from master;
33 select unix_timestamp(t) from t1;
35 # Delete the created table on master and slave
36 connection master;
37 set SQL_LOG_BIN=1,timestamp=default;
38 drop table t1;
39 save_master_pos;
40 connection slave;
41 sync_with_master;
42 connection master;
45 # Test copying table with checksum
48 # Don't log table creating to the slave as we want to test LOAD TABLE
49 set SQL_LOG_BIN=0;
51 #######################################################
52 # REQUIREMENTi TEST 2:
53 #LOAD TABLE FROM MASTER must work with table checksum
54 #######################################################
55 -- echo "******************** Test Requirment 2 *************"
57 eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM MAX_ROWS=4000 CHECKSUM=1;
58 INSERT INTO t1 VALUES (1);
59 save_master_pos;
60 connection slave;
61 sync_with_master;
62 load table t1 from master;
63 check table t1;
64 drop table t1;
65 connection master;
66 drop table t1;
67 save_master_pos;
68 connection slave;
69 sync_with_master;
71 connection master;
72 set SQL_LOG_BIN=0;
73 create table t1 (word char(20) not null, index(word))ENGINE=MyISAM;
74 load data infile '../../std_data/words.dat' into table t1;
75 create table t2 (word char(20) not null)ENGINE=MyISAM;
76 load data infile '../../std_data/words.dat' into table t2;
77 create table t3 (word char(20) not null primary key)ENGINE=MyISAM;
78 connection slave;
79 load table t1 from master;
80 load table t2 from master;
81 load table t3 from master;
82 check table t1;
83 select count(*) from t2;
84 select count(*) from t3;
85 connection master;
86 set SQL_LOG_BIN=1;
87 drop table if exists t1,t2,t3;
88 save_master_pos;
89 connection slave;
90 sync_with_master;
91 create table t1(n int);
92 drop table t1;
98 # End of 4.1 tests
99 --source include/rpl_end.inc