From 1e4efb9e163b7166961c26cf23c3392f51051ddb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Feb 2012 21:19:03 +0100 Subject: [PATCH] Fix: Save error only if it's not error to say there is error. --- htdocs/core/db/pgsql.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index e0e3716473a..e340af866cc 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -556,9 +556,12 @@ class DoliDBPgsql { if (! $ret) { - $this->lastqueryerror = $query; - $this->lasterror = $this->error(); - $this->lasterrno = $this->errno(); + if ($this->errno() != 'DB_ERROR_25P02') + { + $this->lastqueryerror = $query; + $this->lasterror = $this->error(); + $this->lasterrno = $this->errno(); + } dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_WARNING); //print "\n>> ".$query."
\n"; //print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."
\n";