Description:
slaves does not honore the mysqlimport --lines-terminated-by='\n\n' switch
How-To-Repeat:
i've set up two machines as master - slave. i start out with a running
replication in a sane state.
now i do on the master:
mysql -e '
drop table TOR5;
create table TOR5 (
lx_company INT NOT NULL,
lx_type INT NOT NULL,
request_min INT NOT NULL,
request_texts tinytext NOT NULL,
INDEX (lx_company),
INDEX (lx_type),
INDEX (request_min));'
mysqlimport --lines-terminated-by='\n\n' TOR5
sdb.TOR5: Records: 6488 Deleted: 0 Skipped: 0 Warnings: 8
using input like this (tab-separated)
8--
826 11811263601 Analogplatine mit wand komlett/ Best.-Nr.: 3450 246/7
Analogplatine komplett mit wand #3450246-7
147248441263611 Akku 6V 1,2Ah f=FCr Netzteil brille
797 35031263701 Kapsulotomiespitze Nr.:VE 201726
Kapsulotomiespitze VE 201726
Oertli-Spitzen VE 201726
Kapsolutomie-Spitze VE201726
8--
and this is what i get:
on the master:
mysql select count(*) from TOR5;
+--+
| count(*) |
+--+
| 6488 |
+--+
and on the slave:
mysql select count(*) from TOR5;
+--+
| count(*) |
+--+
|13966 |
+--+
for the example above on the master:
mysql select * from TOR5 where request_min=1263701;
++-+-+-+
| lx_company | lx_type | request_min | request_texts |
++-+-+-
|797 |3503 | 1263701 | Kapsulotomiespitze Nr.:VE 201726
Kapsulotomiespitze VE 201726
Oertli-Spitzen VE 201726
Kapsolutomie-Spitze VE201726 |
++-+-+-+
1 row in set (0.01 sec)
and the slave:
mysql select * from TOR5 where request_min=1263701;
++-+-+--+
| lx_company | lx_type | request_min | request_texts|
++-+-+--+
|797 |3503 | 1263701 | Kapsulotomiespitze Nr.:VE 201726 |
++-+-+--+
1 row in set (0.00 sec)
the slave does not honore multiline records, but read each line as a
separate record and create thousands of rows like that:
mysql select * from TOR5 where lx_company 1 limit 3;
++-+-+---+
| lx_company | lx_type | request_min | request_texts |
++-+-+---+
| 0 | 0 | 0 | |
| 0 | 0 | 0 | |
| 0 | 0 | 0 | |
++-+-+---+
Fix:
Submitter-Id:
Originator:kai uwe tempel
Organization: university leipzig
MySQL support: none
Synopsis: slaves (bin-logs?) do not respect --lines-terminated-by switch of
mysqlimport
Severity: serious
Priority: medium
Category: mysql
Class: sw-bug
Release: mysql-3.23.47 (Source distribution)
Server: /usr/bin/mysqladmin Ver 8.23 Distrib 3.23.47, for pc-linux-gnu on i686
Copyright (C) 2000 MySQL AB MySQL Finland AB TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Server version 3.23.47-log
Protocol version10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 20 hours 39 min 45 sec
Threads: 1 Questions: 129 Slow queries: 2 Opens: 27 Flush tables: 2 Open tables:
4 Queries per second avg: 0.002
Environment:
System: Linux pc59 2.4.17 #10 Thu Dec 27 09:05:25 CET 2001 i586 unknown
Architecture: i586
Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)
Compilation info: CC='gcc' CFLAGS='' CXX='c++' CXXFLAGS='' LDFLAGS=''
LIBC:
lrwxrwxrwx1 root root 14 Jan 28 18:44 /lib/libc.so.5 -
libc.so.5.4.46
-rw-r--r--1 root root 563068 Jan 25 13:45 /lib/libc.so.5.4.46
lrwxrwxrwx1 root root