mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 02:36:38 +02:00
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
This commit is contained in:
@@ -94,7 +94,7 @@ class sql_db
|
||||
{
|
||||
$this->num_queries++;
|
||||
|
||||
if( $transaction == BEGIN_TRANSACTION )
|
||||
if( $transaction == BEGIN_TRANSACTION && !$this->in_transaction )
|
||||
{
|
||||
if( !odbc_autocommit($this->db_connect_id, false) )
|
||||
{
|
||||
@@ -195,16 +195,35 @@ class sql_db
|
||||
|
||||
if( $transaction == END_TRANSACTION && $this->in_transaction )
|
||||
{
|
||||
odbc_commit($this->db_connect_id);
|
||||
odbc_autocommit($this->db_connect_id, true);
|
||||
$this->in_transaction = FALSE;
|
||||
|
||||
if ( !@odbc_commit($this->db_connect_id) )
|
||||
{
|
||||
odbc_rollback($this->db_connect_id);
|
||||
odbc_autocommit($this->db_connect_id, true);
|
||||
return false;
|
||||
}
|
||||
odbc_autocommit($this->db_connect_id, true);
|
||||
}
|
||||
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
if( $transaction == END_TRANSACTION && $this->in_transaction )
|
||||
{
|
||||
$this->in_transaction = FALSE;
|
||||
|
||||
if ( !@odbc_commit($this->db_connect_id) )
|
||||
{
|
||||
odbc_rollback($this->db_connect_id);
|
||||
odbc_autocommit($this->db_connect_id, true);
|
||||
return false;
|
||||
}
|
||||
odbc_autocommit($this->db_connect_id, true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user