Re: Re: [metabase-dev] MDB news (http://pear.php.net/package-info.php?package=MDB)

From: Date: Thu, 05 Sep 2002 22:39:32 +0000
Subject: Re: Re: [metabase-dev] MDB news (http://pear.php.net/package-info.php?package=MDB)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-8868@lists.php.net to get a copy of this message
Hello, On 09/04/2002 07:19 PM, Lukas Smith wrote:
From: Manuel Lemos [mailto:mlemos@acm.org] Sent: Wednesday, September 04, 2002 3:47 PM Anyway, I also noticed that you assume a default for dates that is not valid for most databases and even less is portable. 0000-00-00 is a
date
that never existed. The date count after Christ started in 0001-01-01
.
The year before 1 is -1, not 0. Still, even if you assumed 0001-01-01 as default, not all databases allow arbitrary ranges of 4 digit years . Some do not allow dates
before
1970 or 1900.
I will look into this issue after 1.0 more deeply. For now I guess its atleast a step in the right direction to rather use 0001-01-01. But it is only relevant for the reverse engineering really and people will have to manually edit the resulting xml schema file anyways until further advancements are made (like an interactive application etc).
This is really not that important. It was just an example of one thing that you are doing that will break with other databases because you were not aware of the valid ranges of dates. Anyway, 1) it should be up to the driver to assume defaults if really needed, 2) if needed, the drivers should assume defaults with safely dates like 2000-01-01 , 3) if you really want to be sure that all drivers return defaults for not null fields, throw an error in the manager class regarding that problem so it does not go unnoticed when a developer writes a new driver. -- Regards, Manuel Lemos

« previous php.pear.dev (#8868) next »