mirror of
https://github.com/php/php-src.git
synced 2025-08-17 22:48:57 +02:00
Add special case for earlier versions of TDS
This commit is contained in:
parent
0de333bd62
commit
bcee34c649
1 changed files with 14 additions and 3 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue