com php-src: Add special case for earlier versions of TDS: ext/pdo/tests/pdo_018.phpt

From: Date: Tue, 13 Sep 2016 21:01:51 +0000
Subject: com php-src: Add special case for earlier versions of TDS: ext/pdo/tests/pdo_018.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-94505@lists.php.net to get a copy of this message
Commit: bcee34c649c7a26bebf282ca94e08ef06b882017 Author: Adam Baratz <adambaratz@php.net> Tue, 13 Sep 2016 17:01:51 -0400 Parents: 0de333bd6279249096be4f040838e658b009da47 Branches: PHP-7.0 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bcee34c649c7a26bebf282ca94e08ef06b882017 Log: Add special case for earlier versions of TDS Changed paths: M ext/pdo/tests/pdo_018.phpt Diff: diff --git a/ext/pdo/tests/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt index d931a2c..80e3453 100644 --- a/ext/pdo/tests/pdo_018.phpt +++ b/ext/pdo/tests/pdo_018.phpt @@ -129,9 +129,20 @@ unset($stmt); echo "===DATA===\n"; $res = $db->query('SELECT test.val FROM test')->fetchAll(PDO::FETCH_COLUMN); -// For Oracle map NULL to empty string so the test doesn't diff -if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci' && $res[0] === null) { - $res[0] = ""; +switch ($db->getAttribute(PDO::ATTR_DRIVER_NAME)) { + case 'dblib': + // map whitespace (from early TDS versions) to empty string so the test doesn't diff + if ($res[0] === ' ') { + $res[0] = ''; + } + break; + + case 'oci': + // map NULL to empty string so the test doesn't diff + if ($res[0] === null) { + $res[0] = ''; + } + break; } var_dump($res);

« previous php.cvs (#94505) next »