I noticed after running,
DELETE FROM tablename
My ID (auto increment) values became weird
7, 8, 9, 0, 1, 12, 3, 4, 15
In this order when I do a,
SELECT * FROM tablename
I know that the certification guide says that IDs may or may not be reset when DELETE without WHERE is used to empty a table, but what caused the ID sequence to be so weird? I am quite certain that’s the order the rows were inserted. Originally before delete I had 6 rows in the table so 7, 8, 9 seems understandable .
in reference to your screen shots:http://img19.imageshack.us/img19/7336/82051321.png and http://img27.imageshack.us/img27/2935/24285862.png
the problem is with your “application code”. you’re using LOAD DATA INFILE with a file that has windows style (\r\n) line endings, and the default in mysql unless you specify otherwise is unix style (\n).
to see what i mean, try this:
what’s happening is the \r is clobbering the display of your values. did you notice how your tables “walls” don’t line up? this should be a hint that something is wrong with the display, as evidenced by the query with hex(val) where the “walls” do line up.
to fix the import, you have to specify the line endings in the file: