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_sqltafc.phpt ('Bind tests with SQLT_AFC')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table bind_sqltafc_tab",
9:     
"create table bind_sqltafc_tab (id number, char_t char(1), char_t10 char(10), varchar2_t10 varchar2(10), number_t number)",
10:     
"insert into bind_sqltafc_tab values (0, 'a', 'abcd', 'efghij', 1.1)"
11:
);
12:
13:
oci8_test_sql_execute($c$stmtarray);
14:
15:
// Run Test
16:
17:
function q($c$id)
18: {
19:     
$s oci_parse($c"select * from bind_sqltafc_tab where id = $id");
20:     
oci_execute($s);
21:     
oci_fetch_all($s$r);
22:     
var_dump($r);
23: }
24:
25: echo 
"Test 0 - base table creation without binds\n";
26:
27:
q($c0);
28:
29: echo 
"\nTest 1 - successful insert\n";
30:
31:
$s oci_parse($c"INSERT INTO bind_sqltafc_tab (id, char_t, char_t10, varchar2_t10, number_t) VALUES (1, :c2, :c3, :c4, :c5)");
32:
$c2 "H";
33:
$c3 "AAAAAAAAAA";  // max length allowed in column
34:
$c4 "BBBBBBBBBB";  // max length allowed in column
35:
$c5 "123.45";
36:
oci_bind_by_name($s":c2"$c2, -1SQLT_AFC);
37:
oci_bind_by_name($s":c3"$c3, -1SQLT_AFC);
38:
oci_bind_by_name($s":c4"$c4, -1SQLT_AFC);
39:
oci_bind_by_name($s":c5"$c5, -1SQLT_AFC);
40:
oci_execute($s);
41:
42:
q($c1);
43:
44: echo 
"\nTest 2 - Empty Strings\n";
45:
46:
$s oci_parse($c"INSERT INTO bind_sqltafc_tab (id, char_t, char_t10, varchar2_t10, number_t) VALUES (5, :c2, :c3, :c4, :c5)");
47:
$c2 "";
48:
$c3 "";
49:
$c4 "";
50:
$c5 "";
51:
oci_bind_by_name($s":c2"$c2, -1SQLT_AFC);
52:
oci_bind_by_name($s":c3"$c3, -1SQLT_AFC);
53:
oci_bind_by_name($s":c4"$c4, -1SQLT_AFC);
54:
oci_bind_by_name($s":c5"$c5, -1SQLT_AFC);
55:
oci_execute($s);
56:
57:
q($c5);
58:
59: echo 
"\nTest 3 - NULLs\n";
60:
61:
$s oci_parse($c"INSERT INTO bind_sqltafc_tab (id, char_t, char_t10, varchar2_t10, number_t) VALUES (6, :c2, :c3, :c4, :c5)");
62:
$c2 null;
63:
$c3 null;
64:
$c4 null;
65:
$c5 null;
66:
oci_bind_by_name($s":c2"$c2, -1SQLT_AFC);
67:
oci_bind_by_name($s":c3"$c3, -1SQLT_AFC);
68:
oci_bind_by_name($s":c4"$c4, -1SQLT_AFC);
69:
oci_bind_by_name($s":c5"$c5, -1SQLT_AFC);
70:
oci_execute($s);
71:
72:
q($c6);
73:
74:
// Clean up
75:
76:
$stmtarray = array(
77:     
"drop table bind_sqltafc_tab"
78:
);
79:
80:
oci8_test_sql_execute($c$stmtarray);
81:
82:
oci_close($c);
83:
84:
?>
85:
===DONE===
86:

Expected

Test 0 - base table creation without binds
array(5) {
  ["ID"]=>
  array(1) {
    [0]=>
    string(1) "0"
  }
  ["CHAR_T"]=>
  array(1) {
    [0]=>
    string(1) "a"
  }
  ["CHAR_T10"]=>
  array(1) {
    [0]=>
    string(10) "abcd      "
  }
  ["VARCHAR2_T10"]=>
  array(1) {
    [0]=>
    string(6) "efghij"
  }
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    string(3) "1.1"
  }
}

Test 1 - successful insert
array(5) {
  ["ID"]=>
  array(1) {
    [0]=>
    string(1) "1"
  }
  ["CHAR_T"]=>
  array(1) {
    [0]=>
    string(1) "H"
  }
  ["CHAR_T10"]=>
  array(1) {
    [0]=>
    string(10) "AAAAAAAAAA"
  }
  ["VARCHAR2_T10"]=>
  array(1) {
    [0]=>
    string(10) "BBBBBBBBBB"
  }
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    string(6) "123.45"
  }
}

Test 2 - Empty Strings
array(5) {
  ["ID"]=>
  array(1) {
    [0]=>
    string(1) "5"
  }
  ["CHAR_T"]=>
  array(1) {
    [0]=>
    NULL
  }
  ["CHAR_T10"]=>
  array(1) {
    [0]=>
    NULL
  }
  ["VARCHAR2_T10"]=>
  array(1) {
    [0]=>
    NULL
  }
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    NULL
  }
}

Test 3 - NULLs
array(5) {
  ["ID"]=>
  array(1) {
    [0]=>
    string(1) "6"
  }
  ["CHAR_T"]=>
  array(1) {
    [0]=>
    NULL
  }
  ["CHAR_T10"]=>
  array(1) {
    [0]=>
    NULL
  }
  ["VARCHAR2_T10"]=>
  array(1) {
    [0]=>
    NULL
  }
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    NULL
  }
}
===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:55:41
  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:55:41
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 0 - base table creation without binds
002- array(5) {
003-   ["ID"]=>
004-   array(1) {
005-     [0]=>
006-     string(1) "0"
007-   }
008-   ["CHAR_T"]=>
009-   array(1) {
010-     [0]=>
011-     string(1) "a"
012-   }
013-   ["CHAR_T10"]=>
014-   array(1) {
015-     [0]=>
016-     string(10) "abcd      "
017-   }
018-   ["VARCHAR2_T10"]=>
019-   array(1) {
020-     [0]=>
021-     string(6) "efghij"
022-   }
023-   ["NUMBER_T"]=>
024-   array(1) {
025-     [0]=>
026-     string(3) "1.1"
027-   }
028- }
029- 
030- Test 1 - successful insert
031- array(5) {
032-   ["ID"]=>
033-   array(1) {
034-     [0]=>
035-     string(1) "1"
036-   }
037-   ["CHAR_T"]=>
038-   array(1) {
039-     [0]=>
040-     string(1) "H"
041-   }
042-   ["CHAR_T10"]=>
043-   array(1) {
044-     [0]=>
045-     string(10) "AAAAAAAAAA"
046-   }
047-   ["VARCHAR2_T10"]=>
048-   array(1) {
049-     [0]=>
050-     string(10) "BBBBBBBBBB"
051-   }
052-   ["NUMBER_T"]=>
053-   array(1) {
054-     [0]=>
055-     string(6) "123.45"
056-   }
057- }
058- 
059- Test 2 - Empty Strings
060- array(5) {
061-   ["ID"]=>
062-   array(1) {
063-     [0]=>
064-     string(1) "5"
065-   }
066-   ["CHAR_T"]=>
067-   array(1) {
068-     [0]=>
069-     NULL
070-   }
071-   ["CHAR_T10"]=>
072-   array(1) {
073-     [0]=>
074-     NULL
075-   }
076-   ["VARCHAR2_T10"]=>
077-   array(1) {
078-     [0]=>
079-     NULL
080-   }
081-   ["NUMBER_T"]=>
082-   array(1) {
083-     [0]=>
084-     NULL
085-   }
086- }
087- 
088- Test 3 - NULLs
089- array(5) {
090-   ["ID"]=>
091-   array(1) {
092-     [0]=>
093-     string(1) "6"
094-   }
095-   ["CHAR_T"]=>
096-   array(1) {
097-     [0]=>
098-     NULL
099-   }
100-   ["CHAR_T10"]=>
101-   array(1) {
102-     [0]=>
103-     NULL
104-   }
105-   ["VARCHAR2_T10"]=>
106-   array(1) {
107-     [0]=>
108-     NULL
109-   }
110-   ["NUMBER_T"]=>
111-   array(1) {
112-     [0]=>
113-     NULL
114-   }
115- }
116- ===DONE===

 

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

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