[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    mysql: load data infile
From:       "Thomas Zwolsky" <thomasz () grindstone ! softspot ! de>
Date:       1998-03-31 14:31:06
[Download RAW message or body]

Hi all,

- currently, I have no idea whether I've done something wrong or whether it is 
actually a bug...

- System: Linux Kernel 2.0.29 (slackware)
- mysql "3.21.22-beta for pc-linux-gnu on i586"

Before:

mysql> show fields from documents;
+----------+-------------+------+-----+---------+-------+
| Field    | Type        | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| docnr    | int(11)     |      | MUL | 0       |       |
| titel    | mediumblob  | YES  |     | NULL    |       |
| quelle   | mediumblob  | YES  |     | NULL    |       |
| jahr     | varchar(80) | YES  |     | NULL    |       |
| dokument | varchar(80) | YES  |     | NULL    |       |
| datenart | varchar(80) | YES  |     | NULL    |       |
| autor    | varchar(80) | YES  |     | NULL    |       |
| words    | int(11)     | YES  |     | NULL    |       |
+----------+-------------+------+-----+---------+-------+

mysql> LOAD DATA INFILE '/u/tmp/docs.import' INTO TABLE documents
    -> FIELDS TERMINATED BY ', '
    -> ENCLOSED BY '"' ESCAPED BY '\\'
    -> LINES TERMINATED BY '\n';

--> no problem

Now:

mysql> show fields from documents;
+----------+-------------+------+-----+---------+-------+
| Field    | Type        | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| docnr    | int(11)     |      | MUL | 0       |       |
| titel    | mediumblob  | YES  |     | NULL    |       |
| quelle   | mediumblob  | YES  |     | NULL    |       |
| jahr     | varchar(80) | YES  |     | NULL    |       |
| dokument | varchar(80) | YES  |     | NULL    |       |
| datenart | varchar(80) | YES  |     | NULL    |       |
| autor    | varchar(80) | YES  |     | NULL    |       |
| manufact | mediumblob  | YES  |     | NULL    |       |
| keywords | mediumblob  | YES  |     | NULL    |       |
| words    | int(11)     | YES  |     | NULL    |       |
+----------+-------------+------+-----+---------+-------+

mysql> LOAD DATA INFILE '/u/tmp/docs.import' INTO TABLE documents
    -> FIELDS TERMINATED BY ', '
    -> ENCLOSED BY '"' ESCAPED BY '\\'
    -> LINES TERMINATED BY '\n';
ERROR 2000: Unknown error

- the logfile revealed nothing:

980331 14:24:52     37 Query      LOAD DATA INFILE '/u/tmp/docs.import' INTO TAB
LE doc2 FIELDS TERMINATED BY ', ' ENCLOSED BY '"' ESCAPED BY '\\' LINES
TERMINATED BY '\n' 
980331 14:25:22     37 Query      show fields from documents

- is it possible that the error results from field contents too long (I thought 
mysql simply truncates) ?

- what may be the reason ?
- has anyone encountered this before

(remark: I use load data infile very often for _huge_ amounts of data, both 
recordwise and lengthwise)

- if I parse the import file and insert the records one by one via "insert 
into ...  values()" statements, everything works fine (which is what I used as 
workaround)

- in case someone asks: no, I'm not running mysql with special settings 
concerning debugging (out of the box configure, only --without-perl)

Thanks

Thomas
----------------------------------------------------
SoftSpot
Thomas Zwolsky
Affinger Str. 10
86167 Augsburg
fon +49.821.7471420
fax +49.821.7471421

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic