Details
-
Type:
Bug
-
Status: Confirmed
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 10.0.17, 5.5.41, 10.1, 10.0, 5.5
-
Component/s: Data Manipulation - Update
-
Labels:None
-
Environment:Debian Squeeze x64
Description
INSERT INTO ... SELECT ... GREATEST( COALESCE(`inspection`.`ts`, 0), COALESCE(`inspection_details`.`ts`, 0), COALESCE(`open_time_reason`.`ts`, 0) ) AS `changed_at` ON DUPLICATE KEY UPDATE ... `changed_at` = VALUES(`changed_at`)
In MySQL the changed_at will be the expected value from the greatest function, but in MariaDB it will be '0000-00-00 00:00:00'
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
The workaround for me is to add a CONVERT:
CONVERT(
GREATEST( COALESCE(`inspection`.`ts`, 0), COALESCE(`inspection_details`.`ts`, 0), COALESCE(`open_time_reason`.`ts`, 0)
), datetime
) AS `changed_at`