~michaeleguo/ubuntu/trusty/percona-xtradb-cluster-5.5/arm64fix

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/r/rpl_loaddata.result

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-10 14:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20140210144423-f2134l2gxuvq2m6l
Tags: upstream-5.5.34-25.9+dfsg
ImportĀ upstreamĀ versionĀ 5.5.34-25.9+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
include/master-slave.inc
 
2
[connection master]
 
3
select last_insert_id();
 
4
last_insert_id()
 
5
0
 
6
create table t1(a int not null auto_increment, b int, primary key(a) );
 
7
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
 
8
select last_insert_id();
 
9
last_insert_id()
 
10
1
 
11
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
 
12
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
 
13
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
 
14
insert into t3 select * from t2;
 
15
select * from t1;
 
16
a       b
 
17
1       10
 
18
2       15
 
19
select * from t3;
 
20
day     id      category        name
 
21
2003-02-22      2461    b       a a a @ %  ' " a
 
22
2003-03-22      2161    c       asdf
 
23
2003-03-22      2416    a       bbbbb
 
24
drop table t1;
 
25
drop table t2;
 
26
drop table t3;
 
27
create table t1(a int, b int, unique(b));
 
28
insert into t1 values(1,10);
 
29
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
 
30
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062");
 
31
call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0");
 
32
include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
 
33
include/check_slave_no_error.inc
 
34
set sql_log_bin=0;
 
35
delete from t1;
 
36
set sql_log_bin=1;
 
37
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
 
38
include/wait_for_slave_sql_error.inc [errno=1062]
 
39
include/stop_slave_io.inc
 
40
change master to master_user='test';
 
41
change master to master_user='root';
 
42
include/check_slave_no_error.inc
 
43
set global sql_slave_skip_counter=1;
 
44
start slave;
 
45
set sql_log_bin=0;
 
46
delete from t1;
 
47
set sql_log_bin=1;
 
48
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
 
49
include/wait_for_slave_sql_error.inc [errno=1062]
 
50
stop slave;
 
51
reset slave;
 
52
include/check_slave_no_error.inc
 
53
reset master;
 
54
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
 
55
unique(day)) engine=MyISAM;
 
56
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
 
57
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
 
58
'\n##\n' starting by '>' ignore 1 lines;
 
59
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
 
60
select * from t2;
 
61
day     id      category        name
 
62
2003-02-22      2461    b       a a a @ %  ' " a
 
63
2003-03-22      2161    c       asdf
 
64
start slave;
 
65
select * from t2;
 
66
day     id      category        name
 
67
2003-02-22      2461    b       a a a @ %  ' " a
 
68
2003-03-22      2161    c       asdf
 
69
alter table t2 drop key day;
 
70
delete from t2;
 
71
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
 
72
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
 
73
'\n##\n' starting by '>' ignore 1 lines;
 
74
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
 
75
include/wait_for_slave_sql_error.inc [errno=0]
 
76
drop table t1, t2;
 
77
drop table t1, t2;
 
78
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
 
79
LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
 
80
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
 
81
DROP TABLE t1;
 
82
include/rpl_reset.inc
 
83
drop database if exists b48297_db1;
 
84
drop database if exists b42897_db2;
 
85
create database b48297_db1;
 
86
create database b42897_db2;
 
87
use b48297_db1;
 
88
CREATE TABLE t1 (c1 VARCHAR(256)) engine=MyISAM;;
 
89
use b42897_db2;
 
90
### assertion: works with cross-referenced database
 
91
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
 
92
use b48297_db1;
 
93
### assertion: works with fully qualified name on current database
 
94
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
 
95
### assertion: works without fully qualified name on current database
 
96
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1;
 
97
### create connection without default database
 
98
### connect (conn2,localhost,root,,*NO-ONE*);
 
99
### assertion: works without stating the default database
 
100
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
 
101
### disconnect and switch back to master connection
 
102
use b48297_db1;
 
103
include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
 
104
DROP DATABASE b48297_db1;
 
105
DROP DATABASE b42897_db2;
 
106
include/rpl_reset.inc
 
107
use test;
 
108
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
 
109
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
 
110
SELECT * FROM t1;
 
111
key     text
 
112
Field A 'Field B'
 
113
Field 1 'Field 2' 
 
114
Field 3 'Field 4'
 
115
'Field 5'       'Field 6'
 
116
Field 6  'Field 7'
 
117
DROP TABLE t1;
 
118
include/rpl_end.inc