PHP  
 PHP_5_6
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:
    Oci_execute error ORA-1460 Exiting Query
Test 1.4: Type: AFC:  Length: strlen
  Querying:
    :1:
    :2008-04-20:
Test 1.5: Type: AFC.  Length: strlen-1
  Querying:
    Oci_execute error ORA-1460 Exiting Query
Test 1.6: Type: AFC.  Length: strlen+1
  Querying:
    :1:
    :2008-04-20:
Done

Output

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:
    Oci_execute error ORA-1460 Exiting Query
Test 1.4: Type: AFC:  Length: strlen
  Querying:
    :1:
    :2008-04-20:
Test 1.5: Type: AFC.  Length: strlen-1
  Querying:
    :1:
    :2008-04-20:
Test 1.6: Type: AFC.  Length: strlen+1
  Querying:
    :1:
    :2008-04-20:
Done

Diff

018+     :1:
019+     :2008-04-20:
018-     Oci_execute error ORA-1460 Exiting Query

 

Generated at Wed, 17 Sep 2014 20:05:55 +0000 (27 hours ago)

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