[TYPO3-dev] Why are timestamp fields NOT NULL?

Jigal van Hemert jigal at xs4all.nl
Wed Jan 5 11:37:11 CET 2011


Hi,

On 5-1-2011 11:14, Sebastian Michaelsen wrote:
>  From now and then I stumble upon something like this in TYPO3:
>
> 01-01-70 (-41 years)
>
> In most of the cases that's of course not correct because there's simply
> no date given, but TYPO3 can't distinguish between no date given and
> date = 0, because all the timestamp fields are NOT NULL (example:
> pages.starttime and pages.endtime).
>
> Is there a certain reason or should we change it to allow NULL in the
> database?

TYPO3 (at least the core) is capable of running on various DBMSs (using 
the DBAL system extension). Some of the supported systems (currently 
MySQL, Oracle, MSSQL and Postgress) have limited / strange / ... 
handling of NULL.

In the past 0 (zero) has been selected as the magic value for a date 
which is not set.

There are a few locations where this magic value was forgotten (and 
incorrectly the date 01-01-70 was displayed) and I've already seen some 
patches to fix this.

Note: not all extensions write DBAL compatible queries. So, don't expect 
that each extension will work on non-MySQL installations.

-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh




More information about the TYPO3-dev mailing list