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/pdo_010.phpt ('OCI PDO Common: PDO::FETCH_CLASSTYPE and GROUP/UNIQUE')

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:
$db PDOTest::factory();
5:
6:
$db->exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name VARCHAR(10) NOT NULL UNIQUE)');
7:
$db->exec('INSERT INTO classtypes VALUES(0, \'stdClass\')'); 
8:
$db->exec('INSERT INTO classtypes VALUES(1, \'Test1\')'); 
9:
$db->exec('INSERT INTO classtypes VALUES(2, \'Test2\')'); 
10:
$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(10), grp VARCHAR(10))');
11:
$db->exec('INSERT INTO test VALUES(1, 0, \'A\', \'Group1\')'); 
12:
$db->exec('INSERT INTO test VALUES(2, 1, \'B\', \'Group1\')'); 
13:
$db->exec('INSERT INTO test VALUES(3, 2, \'C\', \'Group2\')'); 
14:
$db->exec('INSERT INTO test VALUES(4, 3, \'D\', \'Group2\')'); 
15:
16:
$stmt $db->prepare('SELECT classtypes.name, test.grp AS grp, test.id AS id, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id');
17:
18: class 
Test1
19:
{
20:     public function 
__construct()
21:     {
22:         echo 
__METHOD__ "()\n";
23:     }
24: }
25:
26: class 
Test2
27:
{
28:     public function 
__construct()
29:     {
30:         echo 
__METHOD__ "()\n";
31:     }
32: }
33:
34: class 
Test3
35:
{
36:     public function 
__construct()
37:     {
38:         echo 
__METHOD__ "()\n";
39:     }
40: }
41:
42:
43:
$stmt->execute();
44:
var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE|PDO::FETCH_GROUP'Test3'));
45:
46:
$stmt->execute();
47:
var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE|PDO::FETCH_UNIQUE'Test3'));
48:
49:
?>
50:

Expected

Test1::__construct()
Test2::__construct()
Test3::__construct()
array(2) {
  ["Group1"]=>
  array(2) {
    [0]=>
    object(stdClass)#%d (2) {
      ["id"]=>
      string(1) "1"
      ["val"]=>
      string(1) "A"
    }
    [1]=>
    object(Test1)#%d (2) {
      ["id"]=>
      string(1) "2"
      ["val"]=>
      string(1) "B"
    }
  }
  ["Group2"]=>
  array(2) {
    [0]=>
    object(Test2)#%d (2) {
      ["id"]=>
      string(1) "3"
      ["val"]=>
      string(1) "C"
    }
    [1]=>
    object(Test3)#%d (2) {
      ["id"]=>
      string(1) "4"
      ["val"]=>
      string(1) "D"
    }
  }
}
Test1::__construct()
Test2::__construct()
Test3::__construct()
array(2) {
  ["Group1"]=>
  object(Test1)#%d (2) {
    ["id"]=>
    string(1) "2"
    ["val"]=>
    string(1) "B"
  }
  ["Group2"]=>
  object(Test3)#%d (2) {
    ["id"]=>
    string(1) "4"
    ["val"]=>
    string(1) "D"
  }
}

Output

***********************************************************************
Fatal NI connect error 12541, connecting to:
 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))

  VERSION INFORMATION:
	TNS for Linux: Version 11.2.0.2.0 - Beta
	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
  Time: 17-JUN-2018 09:43:32
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12541
    TNS-12541: TNS:no listener
    ns secondary err code: 12560
    nt main err code: 511
    TNS-00511: No listener

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: pdo_oci_handle_factory: ORA-12541: TNS:no listener
 (/var/php_gcov/PHP_HEAD/ext/pdo_oci/oci_driver.c:634) in /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc:35
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc(35): PDO->__construct('oci:dbname=//lo...', 'system', 'oracle', NULL)
#1 /var/php_gcov/PHP_HEAD/ext/pdo_oci/tests/pdo_010.php(4): PDOTest::factory()
#2 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc on line 35
    nt secondary err code: 111
    nt OS err code: 0

Diff

# original source file: ext/pdo/tests/pdo_010.phpt
001+ ***********************************************************************
002+ Fatal NI connect error 12541, connecting to:
003+  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
004+ 
005+   VERSION INFORMATION:
006+ 	TNS for Linux: Version 11.2.0.2.0 - Beta
007+ 	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
008+   Time: 17-JUN-2018 09:43:32
009+   Tracing not turned on.
010+   Tns error struct:
011+     ns main err code: 12541
012+     TNS-12541: TNS:no listener
013+     ns secondary err code: 12560
014+     nt main err code: 511
015+     TNS-00511: No listener
016+ 
017+ Fatal error: Uncaught PDOException: SQLSTATE[HY000]: pdo_oci_handle_factory: ORA-12541: TNS:no listener
018+  (/var/php_gcov/PHP_HEAD/ext/pdo_oci/oci_driver.c:634) in /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc:35
019+ Stack trace:
020+ #0 /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc(35): PDO->__construct('oci:dbname=//lo...', 'system', 'oracle', NULL)
021+ #1 /var/php_gcov/PHP_HEAD/ext/pdo_oci/tests/pdo_010.php(4): PDOTest::factory()
022+ #2 {main}
023+   thrown in /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc on line 35
024+     nt secondary err code: 111
025+     nt OS err code: 0
001- Test1::__construct()
002- Test2::__construct()
003- Test3::__construct()
004- array(2) {
005-   ["Group1"]=>
006-   array(2) {
007-     [0]=>
008-     object(stdClass)#%d (2) {
009-       ["id"]=>
010-       string(1) "1"
011-       ["val"]=>
012-       string(1) "A"
013-     }
014-     [1]=>
015-     object(Test1)#%d (2) {
016-       ["id"]=>
017-       string(1) "2"
018-       ["val"]=>
019-       string(1) "B"
020-     }
021-   }
022-   ["Group2"]=>
023-   array(2) {
024-     [0]=>
025-     object(Test2)#%d (2) {
026-       ["id"]=>
027-       string(1) "3"
028-       ["val"]=>
029-       string(1) "C"
030-     }
031-     [1]=>
032-     object(Test3)#%d (2) {
033-       ["id"]=>
034-       string(1) "4"
035-       ["val"]=>
036-       string(1) "D"
037-     }
038-   }
039- }
040- Test1::__construct()
041- Test2::__construct()
042- Test3::__construct()
043- array(2) {
044-   ["Group1"]=>
045-   object(Test1)#%d (2) {
046-     ["id"]=>
047-     string(1) "2"
048-     ["val"]=>
049-     string(1) "B"
050-   }
051-   ["Group2"]=>
052-   object(Test3)#%d (2) {
053-     ["id"]=>
054-     string(1) "4"
055-     ["val"]=>
056-     string(1) "D"
057-   }
058- }

 

Generated at Mon, 18 Jun 2018 17:33:50 +0000 (5 days ago)

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