diff --git a/lib/Varien/Db/Adapter/Interface.php b/lib/Varien/Db/Adapter/Interface.php index 62bf37775d9..ab8261acba4 100644 --- a/lib/Varien/Db/Adapter/Interface.php +++ b/lib/Varien/Db/Adapter/Interface.php @@ -50,6 +50,7 @@ interface Varien_Db_Adapter_Interface * Error message for DDL query in transactions */ public const ERROR_DDL_MESSAGE = 'DDL statements are not allowed in transactions'; + public const ERROR_TRANSACTION_NOT_COMMITTED = 'Some transactions have not been committed or rolled back'; /** * Begin new DB transaction for connection diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index 4777aac9f3e..4bd9fb1a6ab 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -464,7 +464,7 @@ protected function _checkDdlTransaction($sql) if (in_array($startSql, $this->_ddlRoutines) && (preg_match($this->_tempRoutines, $sql) !== 1) ) { - trigger_error(Varien_Db_Adapter_Interface::ERROR_DDL_MESSAGE, E_USER_ERROR); + throw new Varien_Db_Exception(Varien_Db_Adapter_Interface::ERROR_DDL_MESSAGE); } } } @@ -4094,7 +4094,7 @@ public function createTableFromSelect($tableName, Zend_Db_Select $select, $tempo public function __destruct() { if ($this->_transactionLevel > 0) { - trigger_error('Some transactions have not been committed or rolled back', E_USER_ERROR); + throw new RuntimeException(Varien_Db_Adapter_Interface::ERROR_TRANSACTION_NOT_COMMITTED); } } }