mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 14:22:54 +09:00
Fix for Sqlite - "Transaction already started" PDOException. Added unit tests for delete and update Sqlite syntax.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9651 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
ce6496e247
commit
2160ca2833
8 changed files with 108 additions and 3 deletions
|
|
@ -74,7 +74,7 @@
|
|||
$db_info = Context::getDBInfo();
|
||||
$this->database = $db_info->master_db["db_database"];
|
||||
$this->prefix = $db_info->master_db["db_table_prefix"];
|
||||
if(!substr($this->prefix,-1)!='_') $this->prefix .= '_';
|
||||
//if(!substr($this->prefix,-1)!='_') $this->prefix .= '_';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -130,7 +130,13 @@
|
|||
**/
|
||||
function commit($force = false) {
|
||||
if(!$force && (!$this->is_connected || !$this->transaction_started)) return;
|
||||
$this->handler->commit();
|
||||
try {
|
||||
$this->handler->commit();
|
||||
}
|
||||
catch(PDOException $e){
|
||||
// There was no transaction started, so just continue.
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
$this->transaction_started = false;
|
||||
}
|
||||
|
||||
|
|
@ -403,6 +409,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
function _getConnection($type = null){
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief insertAct
|
||||
* */
|
||||
|
|
@ -457,6 +467,7 @@
|
|||
|
||||
$this->_prepare($query);
|
||||
$data = $this->_execute();
|
||||
// TODO isError is called twice
|
||||
if ($this->isError())
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue