diff options
Diffstat (limited to 'ext/pdo_mysql/tests/pdo_mysql_commit.phpt')
-rw-r--r-- | ext/pdo_mysql/tests/pdo_mysql_commit.phpt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt index 506be6475f..f88ae149fa 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt @@ -23,9 +23,14 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db)) // DDL will issue an implicit commit $db->exec(sprintf('DROP TABLE IF EXISTS test_commit')); $db->exec(sprintf('CREATE TABLE test_commit(id INT) ENGINE=%s', MySQLPDOTest::detect_transactional_mysql_engine($db))); - if (true !== ($tmp = $db->commit())) { - printf("[002] No commit allowed? [%s] %s\n", - $db->errorCode(), implode(' ', $db->errorInfo())); + try { + $db->commit(); + $failed = false; + } catch (PDOException $e) { + $failed = true; + } + if (!$failed) { + printf("[002] Commit should have failed\n"); } // pdo_transaction_transitions should check this as well... |