mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
More info into log
This commit is contained in:
parent
c2654fa7e2
commit
285ea8da3f
|
|
@ -56,15 +56,16 @@ class DoliDBPgsql
|
|||
//! >=1 if a transaction is opened, 0 otherwise
|
||||
var $transaction_opened;
|
||||
var $lastquery;
|
||||
var $lastqueryerror; // Ajout d'une variable en cas d'erreur
|
||||
|
||||
// Saved last error
|
||||
var $lastqueryerror;
|
||||
var $lasterror;
|
||||
var $lasterrno;
|
||||
|
||||
var $unescapeslashquot=0; // By default we do not force the unescape of \'. This is used only to process sql with mysql escaped data.
|
||||
var $standard_conforming_strings=1; // Database has option standard_conforming_strings to on
|
||||
|
||||
var $ok;
|
||||
var $error;
|
||||
var $lasterror;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -583,17 +584,17 @@ class DoliDBPgsql
|
|||
{
|
||||
if (! $ret)
|
||||
{
|
||||
if ($this->errno() != 'DB_ERROR_25P02')
|
||||
if ($this->errno() != 'DB_ERROR_25P02') // Do not overwrite errors if this is a consecutive error
|
||||
{
|
||||
$this->lastqueryerror = $query;
|
||||
$this->lasterror = $this->error();
|
||||
$this->lasterrno = $this->errno();
|
||||
}
|
||||
dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint." - ".$query." - ".pg_last_error($this->db)." = ".$this->errno(), LOG_WARNING);
|
||||
dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint." - ".$query." - ".pg_last_error($this->db)." => ".$this->errno(), LOG_WARNING);
|
||||
//print "\n>> ".$query."<br>\n";
|
||||
//print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."<br>\n";
|
||||
|
||||
if ($usesavepoint && $this->transaction_opened)
|
||||
if ($usesavepoint && $this->transaction_opened) // Warning, after that errno will be erased
|
||||
{
|
||||
@pg_query($this->db, 'ROLLBACK TO SAVEPOINT mysavepoint');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -894,11 +894,12 @@ abstract class DolibarrModules
|
|||
if ($this->db->errno() != "DB_ERROR_RECORD_ALREADY_EXISTS")
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::insert_permissions error ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::insert_permissions errno = ".$this->db->errno()." error ".$this->error, LOG_ERR);
|
||||
$err++;
|
||||
break;
|
||||
}
|
||||
else dol_syslog(get_class($this)."::insert_permissions record already exists", LOG_INFO);
|
||||
|
||||
}
|
||||
$this->db->free($resqlinsert);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user