~vkolesnikov/pbxt/pbxt-1.5-23.06.2011

« back to all changes in this revision

Viewing changes to test/mysql-test/test_data/505/t/rpl_load_table_from_master.test

  • Committer: vladimir at primebase
  • Date: 2011-06-23 15:11:13 UTC
  • mfrom: (824.1.48 pbxt11)
  • Revision ID: vladimir@primebase.org-20110623151113-ie7mezix8dv68jts
merged changes from PBXT 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
############################################################
 
19
#
 
20
# Test forced timestamp
 
21
#
 
22
-- source include/master-slave.inc
 
23
 
 
24
-- echo "******************** Test Requirment 1 *************"
 
25
 
 
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;
 
34
 
 
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;
 
43
 
 
44
#
 
45
# Test copying table with checksum
 
46
#
 
47
 
 
48
# Don't log table creating to the slave as we want to test LOAD TABLE
 
49
set SQL_LOG_BIN=0;
 
50
 
 
51
#######################################################
 
52
# REQUIREMENTi TEST 2:
 
53
#LOAD TABLE FROM MASTER must work with table checksum
 
54
#######################################################
 
55
-- echo "******************** Test Requirment 2 *************"
 
56
 
 
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;
 
70
 
 
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_ln/words.dat' into table t1;
 
75
create table t2 (word char(20) not null)ENGINE=MyISAM;
 
76
load data infile '../std_data_ln/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;
 
93
 
 
94
 
 
95
 
 
96
 
 
97
 
 
98
# End of 4.1 tests