Invalid SQL dates used by Wordpress
|Reported by:||undid||Owned by:|
|Severity:||critical||Keywords:||date, sql, invalid|
It seems that Wordpress is using invalid SQL dates sometimes.
For example, in the file wp-includes/post.php, line 2233 :
$post_date_gmt = '0000-00-00 00:00:00';
Depending on the SGBD it won't work because it is an invalid SQL date (this date cannot exist in the DATETIME format). The minimum date we can use is '1753-01-01 00:00:00', or 1970-01-01 depending on the implementation.
If we use for example MariaDB 5.1, equivalent to MySQL 5.1 (but without the MySQL bugs), with wordpress, this will lead to an error.
I think there is another files where such a value for datetime is used.