~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

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