Brian "Krow" Aker (krow) wrote,
Brian "Krow" Aker

Rant from Slashdot Article, Constraint on Types

I've been reading through the comments on the Slashdot article from yesterday and I found this gem:

one of my biggest pet peeves of MySQL... when I say CREATE TABLE(varchar(255) blah NOT NULL) please do not add your own 'DEFAULT ""' to the end--it is considered by some to be rather rude! I can spot MySQL schema's a mile away by this single trait. Anything NOT NULL almost always has a bullshit default value. Got a NOT NULL int--it will have a DEFAULT 0! Got a NOT NULL date, "DEFAULT 0000-00-00", which isn't even a valid date! How is that for taking your data seriously?

I have always agreed with the above. When we set out to create the "strict" mode within MySQL we could never get agreement on the above sort of problems. Personally I have despised this stuff for over a decade. I know where they come from, aka the limitations of Unireg (the original code), but I have always thought that we should fix this sort of thing (the first time I met Ann Harrison we were both in a room in Germany ranting about how bad this stuff is).

Guess what we did in Drizzle?

We have fixed all of these issues. I go through the manual from time to time to make sure we haven't left any of this stuff in. If we find ones we missed, we fix them.

There was a lot of these sorts of design decisions. The internal conversion system was never really designed around the concept that "some conversions should not happen."

The rule is simple, if the data doesn't fit within the constraint of the type, we need to toss an error, not just "warn" the user.

No "automagic" sorts of conversions.

Always do what the user expects.

No Magic.

No Gotchas.

When people ask me about the differences between the different forks are, this is probably one of the most significant philosophical differences that I can talk about. There are plenty of other differences in features, development processes, and target audiences. But in the end I think this is probably one of the most significant differences.

One of the nice things about having different distributions now, is that we can let people decide on their preferences.

Maybe Jay will follow up with more since he has been working on this stuff :)
  • Post a new comment


    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded