Ticket #1485923 (closed Bugs: fixed)

Opened 9 months ago

Last modified 9 months ago

Database does not accept empty date field

Reported by: feyp Owned by:
Priority: 5 Milestone: 0.3-stable
Component: Database Version: 0.2.2
Severity: normal Keywords: db,date,
Cc:

Description

I got this error repeatedly in logs/errors:

DB Error: MDB2 Error: null value violates not-null constraint Query: _doQuery: [Error message: Could not execute statement] [Last executed query: EXECUTE mdb2_statement_mysql_75e76fac0264369fdf0648322175c5d9bc34781177 USING @0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10] [Native code: 1048] [Native message: Feld 'date' darf nicht NULL sein]  in /var/www/rc/roundcubemail-0.2.2/program/include/rcube_mdb2.php on line 539 (POST /?_task=mail&_action=moveto?_task=&_action=)

I guess this is because some messages do not contain "Date" headers.

ALTER TABLE `messages` MODIFY `date` DATETIME NULL DEFAULT '1000-01-01 00:00:00';

solved the issue.

Change History

Changed 9 months ago by alec

  • milestone changed from later to 0.3-stable

Changed 9 months ago by alec

  • status changed from new to closed
  • resolution set to fixed

Mysql's from_unixtime() returns NULL when timestamp is negative. It'll happens when there's a date header but has wrong format. I've added code which should prevent from such cases. Fixed in r2671.

Note: See TracTickets for help on using tickets.