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/bug72524.phpt ('Bug #72524 (Binding null values triggers ORA-24816 error)')

Script

1:
2: <?php
3:
4:
require(dirname(__FILE__).'/connect.inc');
5:
6:
// Initialize
7:
8:
$stmtarray = array(
9:          
"CREATE TABLE mytable (clob_col CLOB DEFAULT NULL, varchar2_col VARCHAR2(255) DEFAULT NULL)"
10:
);
11:
12:
oci8_test_sql_execute($c$stmtarray);
13:
14:
// Run test
15:
16:
$sql "INSERT INTO mytable VALUES (:clob_col, :varchar2_col)";
17:
18: echo 
"Test 1 - P1 Value: NULL  P1 Length: Default  P1 Type: Default  P2 Value: NULL P2 Length: Default  P2 Type: Default\n";
19:
$stmt oci_parse($c$sql);
20:
21:
$clob NULL;
22:
$varchar2 NULL;
23:
oci_bind_by_name($stmt':clob_col'$clob);
24:
oci_bind_by_name($stmt':varchar2_col'$varchar2);
25:
26:
var_dump(oci_execute($stmt));
27:
28: echo 
"Test 2 - P1 Value: ''    P1 Length: Default  P1 Type: Default  P2 Value: ''   P2 Length: Default  P2 Type: Default\n";
29:
30:
$clob '';
31:
$varchar2 '';
32:
oci_bind_by_name($stmt':clob_col'$clob);
33:
oci_bind_by_name($stmt':varchar2_col'$varchar2);
34:
35:
var_dump(oci_execute($stmt));
36:
37: echo 
"Test 3 - P1 Value: 'abc' P1 Length: 0        P1 Type: Default  P2 Value: ''   P2 Length: 0        P2 Type: Default\n";
38:
$clob 'abc';
39:
$varchar2 'abc';
40:
oci_bind_by_name($stmt':clob_col'$clob0);
41:
oci_bind_by_name($stmt':varchar2_col'$varchar20);
42:
43:
var_dump(oci_execute($stmt));
44:
45: echo 
"Test 4 - P1 Value: NULL  P1 Length: -1       P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1       P2 Type:Default\n";
46:
$clob NULL;
47:
$varchar2 NULL;
48:
oci_bind_by_name($stmt':clob_col'$clob, -1SQLT_LNG);
49:
oci_bind_by_name($stmt':varchar2_col'$varchar2, -1SQLT_LNG);
50:
51:
var_dump(oci_execute($stmt));
52:
53: echo 
"Test 5 - P1 Value: NULL  P1 Length: 0        P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0        P2 Type:Default\n";
54:
$clob NULL;
55:
$varchar2 NULL;
56:
oci_bind_by_name($stmt':clob_col'$clob0SQLT_LNG);
57:
oci_bind_by_name($stmt':varchar2_col'$varchar20SQLT_LNG);
58:
59:
60:
var_dump(oci_execute($stmt));
61:
62:
// Cleanup
63:
64:
$stmtarray = array(
65:     
"DROP TABLE mytable"
66:
);
67:
68:
oci8_test_sql_execute($c$stmtarray);
69:
70:
?>
71:
===DONE===
72:

Expected

Test 1 - P1 Value: NULL  P1 Length: Default  P1 Type: Default  P2 Value: NULL P2 Length: Default  P2 Type: Default
bool(true)
Test 2 - P1 Value: ''    P1 Length: Default  P1 Type: Default  P2 Value: ''   P2 Length: Default  P2 Type: Default
bool(true)
Test 3 - P1 Value: 'abc' P1 Length: 0        P1 Type: Default  P2 Value: ''   P2 Length: 0        P2 Type: Default
bool(true)
Test 4 - P1 Value: NULL  P1 Length: -1       P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1       P2 Type:Default

Warning: oci_execute(): ORA-24816: %s in %s on line %d
bool(false)
Test 5 - P1 Value: NULL  P1 Length: 0        P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0        P2 Type:Default

Warning: oci_execute(): ORA-24816: %s in %s on line %d
bool(false)
===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 05:08:35
  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)))
001- Test 1 - P1 Value: NULL  P1 Length: Default  P1 Type: Default  P2 Value: NULL P2 Length: Default  P2 Type: Default
002- bool(true)
003- Test 2 - P1 Value: ''    P1 Length: Default  P1 Type: Default  P2 Value: ''   P2 Length: Default  P2 Type: Default
004- bool(true)
005- Test 3 - P1 Value: 'abc' P1 Length: 0        P1 Type: Default  P2 Value: ''   P2 Length: 0        P2 Type: Default
006- bool(true)
007- Test 4 - P1 Value: NULL  P1 Length: -1       P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1       P2 Type:Default
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 05:08:35
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
009- Warning: oci_execute(): ORA-24816: %s in %s on line %d
010- bool(false)
011- Test 5 - P1 Value: NULL  P1 Length: 0        P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0        P2 Type:Default
013- Warning: oci_execute(): ORA-24816: %s in %s on line %d
014- bool(false)
015- ===DONE===
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

 

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

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