How asinine is this?!? The best part is
“The auto-increment counter is stored only in main memory, not on disk.“
Let’s see how this lets us have fun.
- Create a table with an auto-increment key
- Insert two entries into said table
- Delete entry with greatest key; note key value
- Stop MySQL
- Start MySQL
- Insert a single entry into our favorite table
The newly inserted key value will be equal to the deleted key value. Wait, what? Another way to have fun with this is
- Create a table with an auto-increment key
- Insert a single entry into our favorite table; note key value
- Delete entry (using where id =); table should be empty
- Stop MySQL
- Start MySQL
- Insert a single entry into our favorite table
The newly inserted key value will be 1, regardless of the deleted key value. Why bother having auto_increment functionality if it always wants to reset itself?
Apr 20, 2005, 02:33PM PDT | 1 comment
Try this one!
create table A (i enum (‘a’) not null);
insert into A (i) values (‘b’)
Rather than failing the insert it inserts the empty-string into the enum column. What’s the point of having an enum?
Apr 13, 2005, 05:49PM PDT | 1 comment
I ran into this bug today. Yay!
Mar 23, 2005, 02:42PM PST | 0 comments
autoincrement keys on InnoDB table types without binary logging turned on reset themselves upon a hard reboot, which happened to me on Friday by mistake. autoincrement keys are supposed to have a lifetime associated with the table. Crashing shouldn’t matter. This can have serious problems if the autoincrement value is used to assign message identifiers for delivery systems. Why can’t people just use PostgreSQL?
Mar 12, 2005, 01:22PM PST | 0 comments
The following query doesn’t work in 4.1.
update animals set color=’spotted’ where genus in (select genus from elephant limit 1)
It doesn’t allow a limit clause on a subquery. Wonderful!
Mar 12, 2005, 01:19PM PST | 0 comments