PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pdo_oci/tests/bug_73234.phpt ('OCI PDO Common: Bug #73234 (Emulated statements let value dictate parameter type)')

Script

1: <?php
2:
if (getenv('REDIR_TEST_DIR') === falseputenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
3: require_once 
getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4:
5:
$db PDOTest::factory();
6:
$db->setAttribute(PDO::ATTR_EMULATE_PREPAREStrue);
7:
$db->exec('CREATE TABLE test(id INT NULL)');
8:
9:
$stmt $db->prepare('INSERT INTO test VALUES(:value)');
10:
11:
$stmt->bindValue(':value'0PDO::PARAM_NULL);
12:
$stmt->execute();
13:
14:
$stmt->bindValue(':value'nullPDO::PARAM_NULL);
15:
$stmt->execute();
16:
17:
$stmt $db->query('SELECT * FROM test');
18:
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
19:
?>
20:

Expected

array(2) {
  [0]=>
  array(1) {
    ["id"]=>
    NULL
  }
  [1]=>
  array(1) {
    ["id"]=>
    NULL
  }
}

Output

array(2) {
  [0]=>
  array(1) {
    ["id"]=>
    string(1) "0"
  }
  [1]=>
  array(1) {
    ["id"]=>
    NULL
  }
}

Diff

# original source file: ext/pdo/tests/bug_73234.phpt
005+     string(1) "0"
005-     NULL

 

Generated at Sat, 09 Sep 2017 03:10:54 +0000 (12 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.