Closed natano closed 12 years ago
a little spec would be great so we can keep that can ensure that behaviour for both MRI and JRuby
Is there a way to spec this behavior? Also, shouldn't we check whether all fields are 0 separately? Isn't there a better way to verify whether this is NULL? Maybe through a mysql specific function?
What if we want to store the date -0002 - 01 - 01 (so 2 years BC). I know this is somewhat far fetched and MySQL doesn't support dates like that. Postgres for example does and this parser is a generic parser that needs to handle any valid date for different databases.
It's therefore necessary to check each component for 0 and not just add them all and check that.
taking your words then for postgres the date 0000-00-00 is also a valid date ?! but maybe we can live with one exceptional case.
No, 0000-00-00 isn't valid on Postgres. But dates before BC are valid in Postgres. -0002-01-01 there would be valid, so with the old fix that case would break.
This pull request fails (merged da230f34 into f3eec338).