diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/pdo/tests/pdo_018.phpt | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ext/pdo/tests/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt index d931a2c1c0..80e3453287 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); |