Avatar

For documentation about date default values 0000-00-00 (Bugs)

by Auge ⌂, Sunday, July 21, 2024, 09:07 (137 days ago) @ Nico Hoffmann

Hello

While working on an upgrade to a new version, which comes with a completely overhauled update script, I came across this thread again. When redoing the upgrade script I solved every issue that was mentioned in this and also in other threads with the exception of date, datetime and timestamp columns, which once contained 0000-00-00 respectively 0000-00-00-00:00:00 as their default values. I digged into the installation scripts of ancient versions and found definitions like column_name datetime NOT NULL DEFAULT '0000-00-00-00:00:00' in the install.sql of version 2.3.4 as the latest occurence.

With version 2.3.5 the installation script defines all date, datetime or timestamt fields with column_name datetime NULL DEFAULT NULL or column_name datetime NULL DEFAULT CURRENT_TIMESTAMP with one exception where we know, that a date will be given in the queries. That's good for forums, that was installed with version 2.3.5 or later.

In contrast we didn't remove the zero date values which are present in the database with the update script in any version step. That causes very old installations, initially installed with a version before 2.3.5, to possibly show the behaviour, that was reported by Nico because the old definitions and the now (with newer and stricter configured database server versions) broken values remained.

I identified the affected columns and will add queries to redefine these columns as well as set the zero values to NULL.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!


Complete thread:

 RSS Feed of thread