Merge "Use pg_result_error, not pg_last_error, as the latter gives false negatives."
[lhc/web/wiklou.git] / includes / db / DatabasePostgres.php
index 87c977d..839d6a0 100644 (file)
@@ -838,7 +838,7 @@ __INDEXATTR__;
                                        $tempres = (bool)$this->query( $tempsql, $fname, $savepoint );
 
                                        if ( $savepoint ) {
-                                               $bar = pg_last_error();
+                                               $bar = pg_result_error( $this->mLastResult );
                                                if ( $bar != false ) {
                                                        $savepoint->rollback();
                                                } else {
@@ -863,7 +863,7 @@ __INDEXATTR__;
                        $sql .= '(' . $this->makeList( $args ) . ')';
                        $res = (bool)$this->query( $sql, $fname, $savepoint );
                        if ( $savepoint ) {
-                               $bar = pg_last_error();
+                               $bar = pg_result_error( $this->mLastResult );
                                if ( $bar != false ) {
                                        $savepoint->rollback();
                                } else {
@@ -946,7 +946,7 @@ __INDEXATTR__;
 
                $res = (bool)$this->query( $sql, $fname, $savepoint );
                if ( $savepoint ) {
-                       $bar = pg_last_error();
+                       $bar = pg_result_error( $this->mLastResult );
                        if ( $bar != false ) {
                                $savepoint->rollback();
                        } else {