Hacker News new | ask | show | jobs
by regularfry 4732 days ago
In my experience, MySQL lets you get into a state where questions like "hang, on - what's the difference between a DATE of '0000-00-00' and NULL?" are commonplace. This makes porting from it... not simple.
2 comments

Although I have no experience with MySQL, this kind of problems have to be resolved by using LINQ to SQL since every db type is automatically mapped to its .NET counterpart. The DateTime .NET type then has only one representation of null.
Or what you're saying is that if you store a date of zero VALUE to MySQL it could be magically replaced by NULL internally? That would be really crazy.
I seem to recall it is actually the other way around, and storing a null results in a nonsense date.

Added bonus: some versions will segfault if you pass an un-formattable date value.