diff options
Diffstat (limited to 'ext/pdo_mysql/tests/bug_44454.phpt')
-rw-r--r-- | ext/pdo_mysql/tests/bug_44454.phpt | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/ext/pdo_mysql/tests/bug_44454.phpt b/ext/pdo_mysql/tests/bug_44454.phpt index d21cf3a4e2..e95904dda1 100644 --- a/ext/pdo_mysql/tests/bug_44454.phpt +++ b/ext/pdo_mysql/tests/bug_44454.phpt @@ -15,43 +15,43 @@ $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); function bug_44454($db) { - try { + try { - $db->exec('DROP TABLE IF EXISTS test'); - $db->exec('CREATE TABLE test(a INT, b INT, UNIQUE KEY idx_ab (a, b))'); - $db->exec('INSERT INTO test(a, b) VALUES (1, 1)'); + $db->exec('DROP TABLE IF EXISTS test'); + $db->exec('CREATE TABLE test(a INT, b INT, UNIQUE KEY idx_ab (a, b))'); + $db->exec('INSERT INTO test(a, b) VALUES (1, 1)'); - $stmt = $db->query('SELECT a, b FROM test'); - printf("... SELECT has returned %d row...\n", $stmt->rowCount()); - while ($row = $stmt->fetch()) { - try { - printf("... INSERT should fail...\n"); - $db->exec('INSERT INTO test(a, b) VALUES (1, 1)'); - } catch (Exception $e) { - printf("... STMT - %s\n", var_export($stmt->errorCode(), true)); - printf("... PDO - %s\n", var_export($db->errorInfo(), true)); - } - } + $stmt = $db->query('SELECT a, b FROM test'); + printf("... SELECT has returned %d row...\n", $stmt->rowCount()); + while ($row = $stmt->fetch()) { + try { + printf("... INSERT should fail...\n"); + $db->exec('INSERT INTO test(a, b) VALUES (1, 1)'); + } catch (Exception $e) { + printf("... STMT - %s\n", var_export($stmt->errorCode(), true)); + printf("... PDO - %s\n", var_export($db->errorInfo(), true)); + } + } - $db->exec('DROP TABLE IF EXISTS test'); - $db->exec('CREATE TABLE test(a INT, b INT, UNIQUE KEY idx_ab (a, b))'); - $db->exec('INSERT INTO test(a, b) VALUES (1, 1)'); + $db->exec('DROP TABLE IF EXISTS test'); + $db->exec('CREATE TABLE test(a INT, b INT, UNIQUE KEY idx_ab (a, b))'); + $db->exec('INSERT INTO test(a, b) VALUES (1, 1)'); - } catch (Exception $e) { - printf("... While error %s\n", $e->getMessage()); ; - } + } catch (Exception $e) { + printf("... While error %s\n", $e->getMessage()); ; + } - $stmt = $db->query('SELECT a, b FROM test'); - printf("... SELECT has returned %d row...\n", $stmt->rowCount()); - foreach ($stmt as $row) { - try { - printf("... INSERT should fail...\n"); - $db->exec('INSERT INTO test(a, b) VALUES (1, 1)'); - } catch (Exception $e) { - printf("... STMT - %s\n", var_export($stmt->errorCode(), true)); - printf("... PDO - %s\n", var_export($db->errorInfo(), true)); - } - } + $stmt = $db->query('SELECT a, b FROM test'); + printf("... SELECT has returned %d row...\n", $stmt->rowCount()); + foreach ($stmt as $row) { + try { + printf("... INSERT should fail...\n"); + $db->exec('INSERT INTO test(a, b) VALUES (1, 1)'); + } catch (Exception $e) { + printf("... STMT - %s\n", var_export($stmt->errorCode(), true)); + printf("... PDO - %s\n", var_export($db->errorInfo(), true)); + } + } } |