List:General Discussion« Previous MessageNext Message »
From:Jochem van Dieten Date:April 20 2004 7:48am
Subject:Re: Gripe with MySQL
View as plain text  
Stormblade said:
> Ok. Love MySQL and I will be using it for my personal use and
> recommending it to clients as a lower cost alternative. I've only
> been using it for a very short time but there one major gripe I have
> with it and I believe it's just a design thing.
>
> MySQL seems to put the burden of error checking and such on the
> client.
>
> - All fields have a default value even when I don't tell it to?
> - Allow Null will only result in an error if I explicitly try to set
> the field to null.

Date fields allow invalid dates: 0000-00-00
Trailing spaces are silently discarded (fixed in 5)
Decimal fields are silently truncated if the inserted value is too long
etc.

http://sql-info.de/mysql/gotchas.html has a nice list.


> These are the two things that I really dislike. I think it's a poor
> design to rely on clients only for error checking. MySQL supports
> foreign keys.

To some extend. It is not enforced that the parent record is unique,
which is a requirement with foreign keys according to the SQL spec.


> I've only been working with MySQL for a little bit so this is just
> my first impressions. I'll be very happy to be told I'm wrong or
> that future updates (5.0 perhaps) will change some of the things
> I've mentioned.

They will eventually (not in 5). After all, if you read the todo list
carefully you will see that it says they strive to fully supporting
the SQL spec. Naturally this will break backwards compatibility in
many areas, so I am very curious how this will be implemented.


> Relying on clients for database integrity is a bad idea in my
> experience. --

Then you choose the wrong database.

Jochem




Thread
Gripe with MySQLStormblade20 Apr
  • Re: Gripe with MySQLMarc Slemko20 Apr
  • Re: Gripe with MySQLStormblade20 Apr
  • Re: Gripe with MySQLJochem van Dieten20 Apr
  • Re: Gripe with MySQLStormblade20 Apr
  • RE: Gripe with MySQLMichael McTernan20 Apr
    • RE: Gripe with MySQLDonny Simonton20 Apr
  • Re: Gripe with MySQLPeter Brawley20 Apr
  • Re: Gripe with MySQLStormblade20 Apr
RE: Gripe with MySQLMichael McTernan20 Apr
  • RE: Gripe with MySQLStormblade20 Apr
    • RE: Gripe with MySQLPeter J Milanese20 Apr
      • RE: Gripe with MySQLStormblade20 Apr
      • Re: Gripe with MySQLPeter Brawley21 Apr
      • RE: Gripe with MySQLJochem van Dieten21 Apr
RE: Gripe with MySQLStormblade20 Apr
RE: Gripe with MySQLDavid Brodbeck20 Apr