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_oci_stream_1.phpt ('PDO_OCI: stream_get_contents length & offset test')

Script

1: <?php
2:
3:
require(dirname(__FILE__) . '/../../pdo/tests/pdo_test.inc');
4:
5:
$dbh PDOTest::factory();
6:
7:
$dbh->setAttribute(PDO::ATTR_STRINGIFY_FETCHESfalse);
8:
9:
// Initialization
10:
@$dbh->exec("drop table pdo_oci_stream_1_tab");
11:
12:
$stmtarray = array(
13:     
"create table pdo_oci_stream_1_tab (id number, data clob)",
14: );
15:
16: foreach (
$stmtarray as $stmt) {
17:     
$dbh->exec($stmt);
18: }
19:
20:
$dbh->exec("
21:   declare
22:     lob1 clob := 'abc' || lpad('j',30000,'j') || 'xyz';
23:    begin
24:     insert into pdo_oci_stream_1_tab (id,data) values (1, 'abcdefghijklmnopqrstuvwxyz');
25:     insert into pdo_oci_stream_1_tab (id,data) values (2, lob1);
26:   end;"
);
27:
28: echo 
"Test 1\n";
29:
30:
$s $dbh->prepare("select data from pdo_oci_stream_1_tab where id = 1");
31:
$s->execute();
32:
$r $s->fetch();
33:
34:
// stream_get_contents ( resource $handle [, int $maxlength = -1 [, int $offset = -1 ]] )
35:
echo 'Read '.stream_get_contents($r['data'], 11)."$\n";  // b
36:
echo 'Read '.stream_get_contents($r['data'], 21)."$\n";  // cd
37:
echo 'Read '.stream_get_contents($r['data'], 20)."$\n";  // ab
38:
echo 'Read '.stream_get_contents($r['data'], 260)."$\n"// abcdefghijklmnopqrstuvwxyz
39:
echo 'Read '.stream_get_contents($r['data'], 270)."$\n"// abcdefghijklmnopqrstuvwxyz
40:
echo 'Read '.stream_get_contents($r['data'], 271)."$\n"// bcdefghijklmnopqrstuvwxyz
41:
echo 'Read '.stream_get_contents($r['data'], 120)."$\n"// u
42:
echo 'Read '.stream_get_contents($r['data'], 125)."$\n"// z
43:
echo 'Read '.stream_get_contents($r['data'], 126)."$\n"// <blank>
44:
echo 'Read '.stream_get_contents($r['data'], 10)."$\n";  // a
45:
46:
echo "\nTest 2\n";
47:
48:
$s $dbh->prepare("select data from pdo_oci_stream_1_tab where id = 2");
49:
$s->execute();
50:
$r $s->fetch();
51:
52: echo 
'Read '.stream_get_contents($r['data'], 50)."\n";           // abcjj
53:
echo 'Read '.stream_get_contents($r['data'], 52)."\n";           // cjjjj
54:
echo 'Read '.stream_get_contents($r['data'], 61)."\n";           // bcjjjj
55:
echo 'Read '.strlen(stream_get_contents($r['data'], -1,0))."\n";   // 30006
56:
echo 'Read '.strlen(stream_get_contents($r['data'], 0,0))."\n";    // 0
57:
echo 'Read '.strlen(stream_get_contents($r['data'], 0,1))."\n";    // 0
58:
echo 'Read '.strlen(stream_get_contents($r['data'], 10,100))."\n"// 10
59:
echo 'Read '.stream_get_contents($r['data'], 630000)."\n";       // jjjxyz
60:
echo 'Read '.stream_get_contents($r['data'], 730000)."\n";       // jjjxyz
61:
echo 'Read '.strlen(stream_get_contents($r['data']))."\n";         // 0
62:
echo 'Read '.strlen(stream_get_contents($r['data'], 0))."\n";      // 0
63:
echo 'Read '.strlen(stream_get_contents($r['data'], -1))."\n";     // 0
64:
echo 'Read '.stream_get_contents($r['data'], -130000)."\n";      // jjjxyz
65:
66: // Clean up
67:
68:
$stmtarray = array(
69:     
"drop table pdo_oci_stream_1_tab"
70:
);
71:
72: foreach (
$stmtarray as $stmt) {
73:     
$dbh->exec($stmt);
74: }
75:
76:
?>
77:

Expected

Test 1
Read b$
Read cd$
Read ab$
Read abcdefghijklmnopqrstuvwxyz$
Read abcdefghijklmnopqrstuvwxyz$
Read bcdefghijklmnopqrstuvwxyz$
Read u$
Read z$
Read $
Read a$

Test 2
Read abcjj
Read cjjjj
Read bcjjjj
Read 30006
Read 0
Read 0
Read 10
Read jjjxyz
Read jjjxyz
Read 0
Read 0
Read 0
Read jjjxyz

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:54:03
  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_oci_stream_1.php(5): 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

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:54:03
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
001- Test 1
002- Read b$
003- Read cd$
004- Read ab$
005- Read abcdefghijklmnopqrstuvwxyz$
006- Read abcdefghijklmnopqrstuvwxyz$
007- Read bcdefghijklmnopqrstuvwxyz$
008- Read u$
009- Read z$
010- Read $
011- Read a$
013- Test 2
014- Read abcjj
015- Read cjjjj
016- Read bcjjjj
017- Read 30006
018- Read 0
019- Read 0
020- Read 10
021- Read jjjxyz
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_oci_stream_1.php(5): 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
022- Read jjjxyz
023- Read 0
024- Read 0
025- Read 0
026- Read jjjxyz

 

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

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