cvs: php-src /ext/pdo_odbc/tests long_columns.phpt

From: Date: Tue, 19 Jul 2005 16:55:48 +0000
Subject: cvs: php-src /ext/pdo_odbc/tests long_columns.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-32992@lists.php.net to get a copy of this message
wez Tue Jul 19 12:55:48 2005 EDT Modified files: /php-src/ext/pdo_odbc/tests long_columns.phpt Log: try to make the test a bit more portable http://cvs.php.net/diff.php/php-src/ext/pdo_odbc/tests/long_columns.phpt?r1=1.1&r2=1.2&ty=u Index: php-src/ext/pdo_odbc/tests/long_columns.phpt diff -u php-src/ext/pdo_odbc/tests/long_columns.phpt:1.1 php-src/ext/pdo_odbc/tests/long_columns.phpt:1.2 --- php-src/ext/pdo_odbc/tests/long_columns.phpt:1.1 Tue Jul 19 11:26:16 2005 +++ php-src/ext/pdo_odbc/tests/long_columns.phpt Tue Jul 19 12:55:48 2005 @@ -8,8 +8,15 @@ <?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 @@ 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]);

« previous php.cvs (#32992) next »