summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/pdo_odbc/tests/long_columns.phpt12
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/pdo_odbc/tests/long_columns.phpt b/ext/pdo_odbc/tests/long_columns.phpt
index 9a5192ec3c..4533dce481 100644
--- a/ext/pdo_odbc/tests/long_columns.phpt
+++ b/ext/pdo_odbc/tests/long_columns.phpt
@@ -8,8 +8,15 @@ if (!extension_loaded('pdo_odbc')) print 'skip not loaded';
<?php
require 'ext/pdo/tests/pdo_test.inc';
$db = PDOTest::test_factory('ext/pdo_odbc/tests/common.phpt');
+$db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_SILENT);
-$db->exec('CREATE TABLE TEST (id INT NOT NULL PRIMARY KEY, data longtext)');
+if (false === $db->exec('CREATE TABLE TEST (id INT NOT NULL PRIMARY KEY, data CLOB)')) {
+ if (false === $db->exec('CREATE TABLE TEST (id INT NOT NULL PRIMARY KEY, data longtext)')) {
+ die("BORK: don't know how to create a long column here:\n" . implode(", ", $db->errorInfo()));
+ }
+}
+
+$db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_EXCEPTION);
$sizes = array(32, 64, 128, 253, 254, 255, 256, 257, 258, 512, 1024, 2048, 3998, 3999, 4000);
@@ -18,9 +25,8 @@ $insert = $db->prepare('INSERT INTO TEST VALUES (?, ?)');
foreach ($sizes as $num) {
$insert->execute(array($num, str_repeat('i', $num)));
}
-$db->Commit();
-
$insert = null;
+$db->commit();
foreach ($db->query('SELECT id, data from TEST') as $row) {
$expect = str_repeat('i', $row[0]);