At 12:54 AM +0200 1999-12-30, Michael Widenius wrote:
>>>>>> "Paul" == Paul DuBois <paul@stripped> writes:
>Paul> Actually, this does look incorrect to me, too. Should the filename
>Paul> in the LOAD DATA statement be just "data.txt" without a leading dot?
>What do you mean? I think the explanation isn't that bad...
>The server starts by doing a 'cd' to the mysql data directory. Any
>file name, without a path, will automaticly get the current threads
>data directory before the name. In other words, assuming you have the
>You can read the first file with:
>LOAD DATA INFILE "./rows.txt" ...
>LOAD DATA INFILE "/my/data/rows.txt" ...
>and the second file with:
>LOAD DATA INFILE "rows2.txt" ...
>LOAD DATA INFILE "./test/rows2.txt"
>LOAD DATA INFILE "/my/data/test/rows2.txt" ...
>Your are welcome to improve the explanation in the manual :)
The explanation is fine, it's just that the example is incorrect, because
it's supposed to illustrate that even though the file is being read into
a table explicitly named as being in db2, the file is read from the data
directory for db1. At least that's the intent. The filename in the
example, however ("./data.txt") will be read from the server's data
directory. I think I'll change the last sentence of the narrative
before the example to make it clearer what the intent of the example
is, and fix the example so that it illustrates the intent better.
>Paul> At 4:43 PM +0200 1999-12-29, <sinisa@stripped> wrote:
>>> qJames Lyon writes:
>>> > I think the dox have a superfluous "./" in them as follows: -
>>> > Note that these rules mean a file given as `./myfile.txt' is read
>>> > from the server's data directory, whereas a file given as
>>> > `myfile.txt' is read from the database directory of the current
>>> > database. Note also that for statements such as those below,
>>> > the file is read from the database directory for db1, not db2:
>>> > mysql> USE db1;
>>> > mysql> LOAD DATA INFILE "./data.txt" INTO TABLE
>>> > db2.my_table;
>>> > (It appears that the example should refer to just "data.txt" instead.)
>>> > Ref: www.mysql.net/Manual_chapter/manual_Reference.html#LOAD_DATA
>>> > Hope this helps ... oh, and BTW do you want tidbits like this on the
>>> > mailing list, or should I go
>>> > somewhere else. (So to speak.)
>>> > Ta,
> >> > James.
Paul DuBois, paul@stripped