MySQL sucks

(Warning: too much wine makes Andrew rant.)

It seems I was a bit too charitable about MySQL back when I saidI’m firmly convinced PostgreSQL is the better database”.

What I should of actually said is “MySQL is a worthless piece of shit that doesn’t deserve to be dignified by the moniker ‘database’ and should be eradicated from this earth“.

An example:
mysql> drop database foobar;
ERROR 1217: Cannot delete or update a parent row: a foreign key constraint fails
mysql> drop database foobar;
Query OK, 0 rows affected (0.01 sec)

The explanation is in the user comments for the DROP DATABASE documentation:

DROP DATABASE seemingly drops each table, first, in arbitrary order. Since the ordering is arbitrary, it may drop them in the ‘wrong’ order. In this case, you’ll get the message … and half of your tables will be gone, the other half remaining. You can repeatedly execute “DROP DATABASE” commands and each time (at least for me), MySQL gets closer to an empty database, at which point, the database itself is dropped.

The bug report and subsequent thread have an official response from the MySQL developers … basically, foreign keys could link to other databases. So why not check for links to foreign databases, and only screw up in those cases?

This is yet another example of the difference between a proper database (Postgres, Oracle, DB/2, etc) and a pile of scrappy code that has gained prominence through canny marketing and a few high-profile sites using it because they don’t know any better.

Sorry, Jeremy, but I don’t believe it comes down to a misunderstanding of how the database works, or of unfair comparisons with the competition. The example above is just one of the many ways in which MySQL is half-arsed, obtuse, and dangerously broken.


Currently listening to Aerodynamic from the album Discovery by Daft Punk

This entry was posted in Computing. Bookmark the permalink.