Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -1282,16 +1282,6 @@ |
1283 | 1283 | return pg_field_type( $res, $index ); |
1284 | 1284 | } |
1285 | 1285 | |
1286 | | - function begin( $fname = 'DatabasePostgres::begin' ) { |
1287 | | - $this->query( 'BEGIN', $fname ); |
1288 | | - $this->mTrxLevel = 1; |
1289 | | - } |
1290 | | - |
1291 | | - function commit( $fname = 'DatabasePostgres::commit' ) { |
1292 | | - $this->query( 'COMMIT', $fname ); |
1293 | | - $this->mTrxLevel = 0; |
1294 | | - } |
1295 | | - |
1296 | 1286 | /* Not even sure why this is used in the main codebase... */ |
1297 | 1287 | function limitResultForUpdate( $sql, $num ) { |
1298 | 1288 | return $sql; |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1982,8 +1982,10 @@ |
1983 | 1983 | * End a transaction |
1984 | 1984 | */ |
1985 | 1985 | function commit( $fname = 'Database::commit' ) { |
1986 | | - $this->query( 'COMMIT', $fname ); |
1987 | | - $this->mTrxLevel = 0; |
| 1986 | + if( $this->mTrxLevel ) { |
| 1987 | + $this->query( 'COMMIT', $fname ); |
| 1988 | + $this->mTrxLevel = 0; |
| 1989 | + } |
1988 | 1990 | } |
1989 | 1991 | |
1990 | 1992 | /** |
— | — | @@ -1991,8 +1993,10 @@ |
1992 | 1994 | * No-op on non-transactional databases. |
1993 | 1995 | */ |
1994 | 1996 | function rollback( $fname = 'Database::rollback' ) { |
1995 | | - $this->query( 'ROLLBACK', $fname, true ); |
1996 | | - $this->mTrxLevel = 0; |
| 1997 | + if( $this->mTrxLevel ) { |
| 1998 | + $this->query( 'ROLLBACK', $fname, true ); |
| 1999 | + $this->mTrxLevel = 0; |
| 2000 | + } |
1997 | 2001 | } |
1998 | 2002 | |
1999 | 2003 | /** |