OCSInventory-Server
OCSInventory-Server copied to clipboard
Automerging doesn't work with TRACE_DELETED option on new servers
General informations
Operating system : FreeBSD 10.3-RELEASE-p11
Server informations
Perl version : v5.20.3 Mysql version : 5.7.15 with enabled an 'explicit-defaults-for-timestamp' option
OCS Inventory informations
Ocs server version : 2.3.1
Problem's description
An 'explicit-defaults-for-timestamp' MySQL option disables a nonstandard behaviors for TIMESTAMP data type column. The behaviors will be removed in a future MySQL release.
If the 'explicit-defaults-for-timestamp' option is enabled TRACE_DELETED option causes a fail of automerging in next code of Apache/Ocsinventory/Server/Duplicate.pm:270
:
# Trace duplicate if needed
if($ENV{'OCS_OPT_TRACE_DELETED'}){
unless( $dbh->do('INSERT INTO deleted_equiv(DATE,DELETED,EQUIVALENT) VALUES(NULL,?,?)', {} , $device,$DeviceID)){
&_unlock($device);
return(1);
}
$dbh->errstr returns Column 'DATE' cannot be null
.
P.S. Need an enhancement tag.