Improved SQL error logging
This commit is contained in:
parent
2e2cecb6c7
commit
74ee3e9823
@ -373,7 +373,8 @@ class DoliDBMssql extends DoliDB
|
||||
$this->lasterror = $this->error();
|
||||
$this->lasterrno = $row["code"];
|
||||
|
||||
dol_syslog(get_class($this)."::query SQL error: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR);
|
||||
dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR);
|
||||
}
|
||||
$this->lastquery=$query;
|
||||
$this->_results = $ret;
|
||||
|
||||
@ -276,7 +276,8 @@ class DoliDBMysqli extends DoliDB
|
||||
$this->lasterror = $this->error();
|
||||
$this->lasterrno = $this->errno();
|
||||
|
||||
dol_syslog(get_class($this)."::query SQL error: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR);
|
||||
dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR);
|
||||
}
|
||||
$this->lastquery=$query;
|
||||
$this->_results = $ret;
|
||||
|
||||
@ -506,7 +506,10 @@ class DoliDBPgsql extends DoliDB
|
||||
$this->lasterror = $this->error();
|
||||
$this->lasterrno = $this->errno();
|
||||
}
|
||||
dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint." - ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR);
|
||||
|
||||
dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR);
|
||||
dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint, LOG_ERR);
|
||||
|
||||
if ($usesavepoint && $this->transaction_opened) // Warning, after that errno will be erased
|
||||
{
|
||||
|
||||
@ -410,7 +410,9 @@ class DoliDBSqlite extends DoliDB
|
||||
$this->lasterror = $this->error();
|
||||
$this->lasterrno = $this->errno();
|
||||
|
||||
$errormsg = get_class($this)."::query SQL error: ".$this->lasterror;
|
||||
dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR);
|
||||
|
||||
$errormsg = get_class($this)."::query SQL Error message: ".$this->lasterror;
|
||||
|
||||
if (preg_match('/[0-9]/',$this->lasterrno)) {
|
||||
$errormsg .= ' ('.$this->lasterrno.')';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user