Commit 5b209040 authored by unknown's avatar unknown
Browse files

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1

into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-mysqladmin

parents 595d467d b4786351
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -2899,3 +2899,41 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
6109	-1	-1
61	0	0
DROP TABLE t1;
CREATE TABLE t1 (
`id` int(11) NOT NULL auto_increment,
`url` varchar(200) NOT NULL default '',
`name` varchar(250) NOT NULL default '',
`type` int(11) NOT NULL default '0',
`website` varchar(250) NOT NULL default '',
`adddate` date NOT NULL default '0000-00-00',
`size` varchar(20) NOT NULL default '',
`movieid` int(11) NOT NULL default '0',
`musicid` int(11) NOT NULL default '0',
`star` varchar(20) NOT NULL default '',
`download` int(11) NOT NULL default '0',
`lastweek` int(11) NOT NULL default '0',
`thisweek` int(11) NOT NULL default '0',
`page` varchar(250) NOT NULL default '',
PRIMARY KEY  (`id`),
UNIQUE KEY `url` (`url`)
) CHARACTER SET tis620;
INSERT INTO t1 VALUES
(1,'http://www.siamzone.com/download/download/000001-frodo_1024.jpg','The Lord
of the Rings
Wallpapers',1,'http://www.lordoftherings.net','2002-01-22','',448,0,'',3805,0,0,
'');
INSERT INTO t1 VALUES (2,'http://www.othemovie.com/OScreenSaver1.EXE','O
Screensaver',2,'','2002-01-22','',491,0,'',519,0,0,'');
INSERT INTO t1 VALUES
(3,'http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg','Jaso
n X Wallpapers',1,'','2002-05-31','',579,0,'',1091,0,0,'');
select * from t1 order by id;
id	url	name	type	website	adddate	size	movieid	musicid	star	download	lastweek	thisweek	page
1	http://www.siamzone.com/download/download/000001-frodo_1024.jpg	The Lord
of the Rings
Wallpapers	1	http://www.lordoftherings.net	2002-01-22		448	0		3805	0	0	
2	http://www.othemovie.com/OScreenSaver1.EXE	O
Screensaver	2		2002-01-22		491	0		519	0	0	
3	http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg	Jaso
n X Wallpapers	1		2002-05-31		579	0		1091	0	0	
DROP TABLE t1;
+70 −0
Original line number Diff line number Diff line
@@ -20,3 +20,73 @@ a
9
drop table t1;
drop database mysqltest1;
drop database if exists rewrite;
create database rewrite;
use test;
create table t1 (a date, b date, c date not null, d date);
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
Warnings:
Warning	1265	Data truncated for column 'a' at row 1
Warning	1265	Data truncated for column 'c' at row 1
Warning	1265	Data truncated for column 'd' at row 1
Warning	1265	Data truncated for column 'a' at row 2
Warning	1265	Data truncated for column 'b' at row 2
Warning	1265	Data truncated for column 'd' at row 2
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
select * from rewrite.t1;
a	b	c	d
0000-00-00	NULL	0000-00-00	0000-00-00
0000-00-00	0000-00-00	0000-00-00	0000-00-00
2003-03-03	2003-03-03	2003-03-03	NULL
2003-03-03	2003-03-03	2003-03-03	NULL
truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
Warnings:
Warning	1265	Data truncated for column 'c' at row 1
Warning	1265	Data truncated for column 'd' at row 1
Warning	1265	Data truncated for column 'b' at row 2
Warning	1265	Data truncated for column 'd' at row 2
select * from rewrite.t1;
a	b	c	d
NULL	NULL	0000-00-00	0000-00-00
NULL	0000-00-00	0000-00-00	0000-00-00
NULL	2003-03-03	2003-03-03	NULL
drop table t1;
create table t1 (a text, b text);
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
Warnings:
Warning	1261	Row 3 doesn't contain data for all columns
select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
concat('|',a,'|')	concat('|',b,'|')
|Field A|	|Field B|
|Field 1|	|Field 2' 
Field 3,'Field 4|
|Field 5' ,'Field 6|	NULL
|Field 6|	| 'Field 7'|
drop table t1;
create table t1 (a int, b char(10));
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
Warning	1265	Data truncated for column 'a' at row 3
Warning	1262	Row 3 was truncated; it contained more data than there were input columns
Warning	1265	Data truncated for column 'a' at row 5
Warning	1262	Row 5 was truncated; it contained more data than there were input columns
select * from rewrite.t1;
a	b
1	row 1
2	row 2
0	1234567890
3	row 3
0	1234567890
truncate table t1;
load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
Warnings:
Warning	1265	Data truncated for column 'a' at row 4
Warning	1261	Row 4 doesn't contain data for all columns
select * from rewrite.t1;
a	b
1	row 1
2	row 2
3	row 3
0	
drop table t1;
+35 −0
Original line number Diff line number Diff line
@@ -116,3 +116,38 @@ CREATE TABLE t1 (a char(10) not null) CHARACTER SET tis620;
INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
DROP TABLE t1;

#
# Bug#6608
#
CREATE TABLE t1 (
  `id` int(11) NOT NULL auto_increment,
  `url` varchar(200) NOT NULL default '',
  `name` varchar(250) NOT NULL default '',
  `type` int(11) NOT NULL default '0',
  `website` varchar(250) NOT NULL default '',
  `adddate` date NOT NULL default '0000-00-00',
  `size` varchar(20) NOT NULL default '',
  `movieid` int(11) NOT NULL default '0',
  `musicid` int(11) NOT NULL default '0',
  `star` varchar(20) NOT NULL default '',
  `download` int(11) NOT NULL default '0',
  `lastweek` int(11) NOT NULL default '0',
  `thisweek` int(11) NOT NULL default '0',
  `page` varchar(250) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `url` (`url`)
) CHARACTER SET tis620;

INSERT INTO t1 VALUES
(1,'http://www.siamzone.com/download/download/000001-frodo_1024.jpg','The Lord
of the Rings
Wallpapers',1,'http://www.lordoftherings.net','2002-01-22','',448,0,'',3805,0,0,
'');
INSERT INTO t1 VALUES (2,'http://www.othemovie.com/OScreenSaver1.EXE','O
Screensaver',2,'','2002-01-22','',491,0,'',519,0,0,'');
INSERT INTO t1 VALUES
(3,'http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg','Jaso
n X Wallpapers',1,'','2002-05-31','',579,0,'',1091,0,0,'');
select * from t1 order by id;
DROP TABLE t1;
+1 −1
Original line number Diff line number Diff line
"--replicate-rewrite-db=mysqltest1->test"
"--replicate-rewrite-db=test->rewrite" "--replicate-rewrite-db=mysqltest1->test"
+58 −0
Original line number Diff line number Diff line
@@ -17,3 +17,61 @@ drop table t1;
drop database mysqltest1;
sync_slave_with_master;

#
# BUG#6353:
#   Option --replicate-rewrite-db should work together with LOAD DATA INFILE
#

connection slave;
--disable_warnings
drop database if exists rewrite;
--enable_warnings
create database rewrite;

connection master;
use test;
create table t1 (a date, b date, c date not null, d date);
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
sync_slave_with_master;

connection slave;
select * from rewrite.t1;

connection master;
truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
sync_slave_with_master;

connection slave;
select * from rewrite.t1;

connection master;
drop table t1;
create table t1 (a text, b text);
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
sync_slave_with_master;

connection slave;
select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;

connection master;
drop table t1;
create table t1 (a int, b char(10));
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
sync_slave_with_master;

connection slave;
select * from rewrite.t1;

connection master;
truncate table t1;
load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
sync_slave_with_master;

connection slave;
# The empty line last comes from the end line field in the file
select * from rewrite.t1;

connection master;
drop table t1;
Loading