Specifically in the savepoint part of the code, where a failed query inside the
savepoint gives a non-false reply to pg_last_error by the time we call it,
which then leads to us doing 'RELEASE' instead of 'ROLLBACK TO', and causes
all sorts of mayhem.
The whole system needs a little cleanup, but this is an important bandaid.
Change-Id: I0223a3599816db5650f45863400e6194468d4361
$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 {
$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 {
$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 {