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/oci8/tests/bind_char_2_11gR1.phpt ('SELECT oci_bind_by_name with SQLT_AFC aka CHAR and dates')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"alter session set nls_date_format='YYYY-MM-DD'",
9:     
"drop table bind_char_tab",
10:     
"create table bind_char_tab (id number, c1 date)",
11:     
"insert into bind_char_tab values (1, '2008-04-20')",
12: );
13:                          
14:
oci8_test_sql_execute($c$stmtarray);
15:
16:
// Run Test
17:
18:
$bv1 '2008-04-20';
19:
20: echo 
"Test 1.1: Type: default.  Length: default\n";
21:
$s oci_parse($c"select * from bind_char_tab where c1 = :bv");
22:
$r oci_bind_by_name($s":bv"$bv1);
23: if (
$r)
24:    
do_e_q($s);
25:
26: echo 
"Test 1.2: Type: AFC.  Length: default\n";
27:
$r oci_bind_by_name($s":bv"$bv1, -1SQLT_AFC);
28: if (
$r)
29:        
do_e_q($s);
30:
31: echo 
"Test 1.3: Type: AFC:  Length: 0\n";
32:
$r oci_bind_by_name($s":bv"$bv10SQLT_AFC);
33: if (
$r)
34:     
do_e_q($s);
35:
36: echo 
"Test 1.4: Type: AFC:  Length: strlen\n";
37:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1), SQLT_AFC);
38: if (
$r)
39:     
do_e_q($s);
40:
41: echo 
"Test 1.5: Type: AFC.  Length: strlen-1\n";
42:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1)-1SQLT_AFC);
43: if (
$r)
44:     
do_e_q($s);
45:
46: echo 
"Test 1.6: Type: AFC.  Length: strlen+1\n";
47:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1)+1SQLT_AFC);
48: if (
$r)
49:     
do_e_q($s);
50:
51:
52: function 
do_e_q($s)
53: {
54:     echo 
"  Querying:\n";
55:
56:     
$r = @oci_execute($s);
57:     if (!
$r) {
58:         
$m oci_error($s);
59:         echo 
"    Oci_execute error ORA-".$m['code']." Exiting Query\n";
60:         return;
61:     }
62:     while (
$row oci_fetch_array($sOCI_ASSOC+OCI_RETURN_NULLS)) {
63:         foreach (
$row as $item) {
64:             echo 
"    :" $item ":\n";
65:         }
66:     }
67: }
68:
69:
// Cleanup
70:
$stmtarray = array(
71:     
"drop table bind_char_tab"
72:
);
73:                          
74:
oci8_test_sql_execute($c$stmtarray);
75:
76: echo 
"Done\n";
77:
78:
?>
79:

Expected

Test 1.1: Type: default.  Length: default
  Querying:
    :1:
    :2008-04-20:
Test 1.2: Type: AFC.  Length: default
  Querying:
    :1:
    :2008-04-20:
Test 1.3: Type: AFC:  Length: 0
  Querying:
    :1:
    :2008-04-20:
Test 1.4: Type: AFC:  Length: strlen
  Querying:
    :1:
    :2008-04-20:
Test 1.5: Type: AFC.  Length: strlen-1
  Querying:
Test 1.6: Type: AFC.  Length: strlen+1
  Querying:
    :1:
    :2008-04-20:
Done

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 04:51:57
  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: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
    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 04:51:57
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: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
018+     nt secondary err code: 111
019+     nt OS err code: 0
001- Test 1.1: Type: default.  Length: default
002-   Querying:
003-     :1:
004-     :2008-04-20:
005- Test 1.2: Type: AFC.  Length: default
006-   Querying:
007-     :1:
008-     :2008-04-20:
009- Test 1.3: Type: AFC:  Length: 0
010-   Querying:
011-     :1:
012-     :2008-04-20:
013- Test 1.4: Type: AFC:  Length: strlen
014-   Querying:
015-     :1:
016-     :2008-04-20:
017- Test 1.5: Type: AFC.  Length: strlen-1
018-   Querying:
019- Test 1.6: Type: AFC.  Length: strlen+1
020-   Querying:
021-     :1:
022-     :2008-04-20:
023- Done

 

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

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