On 28.02.2001 05:58:33 ?US-ASCII?Q?Fabio_Ottolini?= wrote:

> mysqldump "spits" not only table structures but data also. When you use
> mysql to import data it will first attempt to create the table and then load
> its values. If your table's got AUTO_INCREMENT set it will work fine after
> recreating the database. Anyway... Give it a try! :)

Once more: No, it won't.
Again, do this, and you'll see that it will not work correctly - or rather it
will work correctly, but the recreated table will have different values.
Create a table with one AUTO_INCREMENT column called ID.
Insert one row, like so:
     INSERT INTO Tbl (ID) VALUES (0)
Check all the rows:
     SELECT ID FROM Tbl
You'll see that the row's ID column is != 0.
Do this to set the column to 0:
     UPDATE Tbl SET ID=0 WHERE ID = 1
Check all the rows:
     SELECT ID FROM Tbl
Now the row will have the ID set to 0.
Dump the table, drop the table, replay the dump.
Now you'll have just one row again, but ID will be != 0, because the dump
contained the statement "INSERT INTO Tbl (ID) VALUES (0)" - as I just explained,
this won't work.

Give it a try before you disagree again :-))



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to