Load Data Infile Errors

Load Data Infile Errors

am 25.10.2010 21:15:37 von James.W.McKelvey

Hello,

I have a question about the execution cycle of LOAD DATA INFILE.
If I issue a large file via LDI LOCAL, I know that the file is copied to
the MySQL server and executed there.

But at what point does the statement finish from the sender's point of view?

1) When the file is successfully copied?
2) When the file is copied and parsed?
3) When the file is completely processed?

I'm guessing 2).

The reason for asking is to determine what errors may be returned and
how I can deal with them.

Is it possible for the file to be partially processed, say, inserting
the first half of the rows? If 2) or 3), I would say no (barring some
serious server error).

Since LOCAL implies IGNORE, is there any way to get the number of
ignored rows? What about replace?

Ultimately I want to know under what conditions I should reissue the
file, and whether or not that could introduce duplicate entries for
tables with non-unique keys.

Thanks!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

RE: Load Data Infile Errors

am 25.10.2010 23:05:52 von Gavin Towey

The answer is 3 =3D)

With myisam tables, you can have partially complete statements. That is if=
you get an error, all rows handled before the error are still in the table=
.. With innodb, an error generates a rollback and your table is returned to=
its state before the statement was run.

To find the actual number of rows processed when using REPLACE or IGNORE, s=
ee the ROW_COUNT() function:
http://dev.mysql.com/doc/refman/5.0/en/information-functions .html#function_=
row-count

Regards,
Gavin Towey


-----Original Message-----
From: James W. McKelvey [mailto:James.W.McKelvey@jpl.nasa.gov]
Sent: Monday, October 25, 2010 12:16 PM
To: mysql@lists.mysql.com
Subject: Load Data Infile Errors

Hello,

I have a question about the execution cycle of LOAD DATA INFILE.
If I issue a large file via LDI LOCAL, I know that the file is copied to
the MySQL server and executed there.

But at what point does the statement finish from the sender's point of view=
?

1) When the file is successfully copied?
2) When the file is copied and parsed?
3) When the file is completely processed?

I'm guessing 2).

The reason for asking is to determine what errors may be returned and
how I can deal with them.

Is it possible for the file to be partially processed, say, inserting
the first half of the rows? If 2) or 3), I would say no (barring some
serious server error).

Since LOCAL implies IGNORE, is there any way to get the number of
ignored rows? What about replace?

Ultimately I want to know under what conditions I should reissue the
file, and whether or not that could introduce duplicate entries for
tables with non-unique keys.

Thanks!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgtowey@ffn.com


This message contains confidential information and is intended only for the=
individual named. If you are not the named addressee, you are notified th=
at reviewing, disseminating, disclosing, copying or distributing this e-mai=
l is strictly prohibited. Please notify the sender immediately by e-mail i=
f you have received this e-mail by mistake and delete this e-mail from your=
system. E-mail transmission cannot be guaranteed to be secure or error-fre=
e as information could be intercepted, corrupted, lost, destroyed, arrive l=
ate or incomplete, or contain viruses. The sender therefore does not accept=
liability for any loss or damage caused by viruses or errors or omissions =
in the contents of this message, which arise as a result of e-mail transmis=
sion. [FriendFinder Networks, Inc., 220 Humboldt Court, Sunnyvale, CA 94089=
, USA, FriendFinder.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg