Seriously, WTF?

Iain Barnett iainspeed at gmail.com
Wed May 7 11:20:39 BST 2008


On 6 May 2008, at 3:14 am, Toby Corkindale wrote:
>
> 2)
> MySQL's 'REPLACE INTO' command. What were they thinking?
> I suppose it seemed like a good idea at the time, but try this at  
> home kids:
> create table A. Create table B which has a foreign key into table  
> A, with 'on
> delete cascade' set. Nowever do a REPLACE INTO table A for an  
> existing row..
> Note that table B has now deleted all related rows. Wonderful!
>

One good reason to never cascade deletes, but control them yourself.  
Control Freaks Rule! :)

>
> (I've been having to work with MySQL for over a year now and it  
> STILL keeps
> coming up with new ways to fall to pieces when I least expect it..

That's because it wasn't designed to be an ACID or SQL compliant  
database. I'm sure that's why it's faster than most - it doesn't need  
to check anything before doing it, and that's probably why it's so  
much better than Postgres at replication, it's just a file copy! ;)


Iain
Hates mySQL


More information about the london.pm mailing list