I'm running into a problem with MySQL that has me stumped. I cannot find anything about this behavior on the MySQL site either.

I have a table defined with one (string) column, and a PRIMARY key on that column (so each value must also be unique). Now assume I have the following records:

bbbbb

eeeee

pfffft

Next, I change one value, let's say I change "eeeee" to "zzzzz". If I subsequently do a SELECT without an ORDER BY clause, what I would expect is this:

bbbbb

zzzzz

pfffft

Instead, what I get is this:

bbbbb

pfffft

zzzzz

It seems MySQL implicitly sorts by the (primary) key, even if this is not specified with an ORDER BY clause. I cannot find a specification of this behavior.

Unfortunately - for a maintenance form of the table - I actually need to retrieve the records in the same order after a modification, regardless of what strings the column contains. The only workaround I can think of is to add an (otherwise redundant) auto_increment primary key, and define a second key on the actual data column as UNIQUE. This will work, but I'm not fond of adding redundant data...