Skip to content

Commit

Permalink
Merge pull request #319 from ufundo/patch-1
Browse files Browse the repository at this point in the history
dev/core#2558 Insert blank MYSQLTIMESTAMP fields as NULL rather than 0
  • Loading branch information
seamuslee001 authored Apr 28, 2021
2 parents 5a63c46 + 8fa9637 commit d9afb8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DB/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -1183,9 +1183,9 @@ function insert()
// CRM-14986 ends

// DATE is empty... on a col. that can be null..
// note: this may be usefull for time as well..
// Also useful for MYSQLTIMESTAMP to stop NO_ZERO_DATE errors
if (!$this->$k &&
(($v & DB_DATAOBJECT_DATE) || ($v & DB_DATAOBJECT_TIME)) &&
(($v & DB_DATAOBJECT_DATE) || (($v & DB_DATAOBJECT_TIME) || ($v & DB_DATAOBJECT_MYSQLTIMESTAMP))) &&
!($v & DB_DATAOBJECT_NOTNULL)) {

$rightq .= " NULL ";
Expand Down

0 comments on commit d9afb8a

Please sign in to comment.