diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-03-05 02:19:38 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-03-05 02:19:38 +0000 |
commit | 28b38f054786014f436eefa019308eb8658cb711 (patch) | |
tree | 4be0b2cbdc589b216f85aacc7950a4123aecf101 /phpBB/db/postgres7.php | |
parent | be2532588c3a0472d915bc378207883c350f1a0c (diff) | |
download | forums-28b38f054786014f436eefa019308eb8658cb711.tar forums-28b38f054786014f436eefa019308eb8658cb711.tar.gz forums-28b38f054786014f436eefa019308eb8658cb711.tar.bz2 forums-28b38f054786014f436eefa019308eb8658cb711.tar.xz forums-28b38f054786014f436eefa019308eb8658cb711.zip |
Fixed various transaction related issues and changed mssql-odbc name to ... mssql-odbc, hopefully this hasn't been (and won't be) responsible for any problems ...
git-svn-id: file:///svn/phpbb/trunk@2269 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/db/postgres7.php')
-rw-r--r-- | phpBB/db/postgres7.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/phpBB/db/postgres7.php b/phpBB/db/postgres7.php index 84b26c66b9..96a90fbb1a 100644 --- a/phpBB/db/postgres7.php +++ b/phpBB/db/postgres7.php @@ -109,7 +109,6 @@ class sql_db } } - // // Query method // @@ -125,14 +124,14 @@ class sql_db $query = preg_replace("/LIMIT ([0-9]+),([ 0-9]+)/", "LIMIT \\2 OFFSET \\1", $query); - if( $transaction == BEGIN_TRANSACTION ) + if( $transaction == BEGIN_TRANSACTION && !$this->in_transaction ) { - $result = @pg_exec($this->db_connect_id, "BEGIN"); - if( !$result ) + $this->in_transaction = TRUE; + + if( !@pg_exec($this->db_connect_id, "BEGIN") ) { return false; } - $this->in_transaction = TRUE; } $this->query_result = @pg_exec($this->db_connect_id, $query); @@ -140,13 +139,13 @@ class sql_db { if( $transaction == END_TRANSACTION ) { - $result = @pg_exec($this->db_connect_id, "COMMIT"); - if( !$result ) + $this->in_transaction = FALSE; + + if( !@pg_exec($this->db_connect_id, "COMMIT") ) { @pg_exec($this->db_connect_id, "ROLLBACK"); return false; } - $this->in_transaction = FALSE; } $this->last_query_text[$this->query_result] = $query; @@ -170,18 +169,18 @@ class sql_db } else { - if( $transaction == END_TRANSACTION ) + if( $transaction == END_TRANSACTION && $this->in_transaction ) { - $result = @pg_exec($this->db_connect_id, "COMMIT"); - if( !$result ) + $this->in_transaction = FALSE; + + if( !@pg_exec($this->db_connect_id, "COMMIT") ) { @pg_exec($this->db_connect_id, "ROLLBACK"); return false; } - $this->in_transaction = FALSE; } - return false; + return true; } } |