tony2001                Thu May 18 13:20:00 2006 UTC

  Modified files:              
    /php-src/ext/oci8   oci8.c 
    /php-src/ext/oci8/tests     fetch_array.phpt field_funcs1.phpt 
                                field_funcs.phpt lob_011.phpt 
                                select_null.phpt 
  Log:
  fix #37487 (oci_fetch_array() array-type should always default to OCI_BOTH)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.298&r2=1.299&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.298 php-src/ext/oci8/oci8.c:1.299
--- php-src/ext/oci8/oci8.c:1.298       Wed May 10 10:06:57 2006
+++ php-src/ext/oci8/oci8.c     Thu May 18 13:20:00 2006
@@ -26,7 +26,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8.c,v 1.298 2006/05/10 10:06:57 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.299 2006/05/18 13:20:00 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -647,7 +647,7 @@
 
        php_info_print_table_start();
        php_info_print_table_row(2, "OCI8 Support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.298 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.299 $");
 
        sprintf(buf, "%ld", OCI_G(num_persistent));
        php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -1643,6 +1643,16 @@
                fetch_mode = mode;
        }
 
+       if (!(fetch_mode & PHP_OCI_NUM) && !(fetch_mode & PHP_OCI_ASSOC)) {
+               /* none of the modes present, use the default one */
+               if (mode & PHP_OCI_ASSOC) {
+                       fetch_mode |= PHP_OCI_ASSOC;
+               } 
+               if (mode & PHP_OCI_NUM) {
+                       fetch_mode |= PHP_OCI_NUM;
+               }
+       }
+
        PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
 
        if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/tests/fetch_array.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/oci8/tests/fetch_array.phpt
diff -u php-src/ext/oci8/tests/fetch_array.phpt:1.4 
php-src/ext/oci8/tests/fetch_array.phpt:1.5
--- php-src/ext/oci8/tests/fetch_array.phpt:1.4 Tue Mar 28 09:13:35 2006
+++ php-src/ext/oci8/tests/fetch_array.phpt     Thu May 18 13:20:00 2006
@@ -209,58 +209,100 @@
   ["VALUE"]=>
   string(1) "1"
 }
-array(2) {
+array(4) {
   [0]=>
   string(1) "1"
+  ["ID"]=>
+  string(1) "1"
   [1]=>
   string(1) "1"
+  ["VALUE"]=>
+  string(1) "1"
 }
-array(2) {
+array(4) {
   [0]=>
   string(1) "1"
+  ["ID"]=>
+  string(1) "1"
   [1]=>
   string(1) "1"
+  ["VALUE"]=>
+  string(1) "1"
 }
-array(2) {
+array(4) {
   [0]=>
   string(1) "1"
+  ["ID"]=>
+  string(1) "1"
   [1]=>
   string(1) "1"
+  ["VALUE"]=>
+  string(1) "1"
 }
-array(5) {
+array(10) {
   [0]=>
   string(1) "1"
+  ["ID"]=>
+  string(1) "1"
   [1]=>
   string(1) "1"
+  ["VALUE"]=>
+  string(1) "1"
   [2]=>
   NULL
+  ["BLOB"]=>
+  NULL
   [3]=>
   NULL
+  ["CLOB"]=>
+  NULL
   [4]=>
   NULL
+  ["STRING"]=>
+  NULL
 }
-array(5) {
+array(10) {
   [0]=>
   string(1) "1"
+  ["ID"]=>
+  string(1) "1"
   [1]=>
   string(1) "1"
+  ["VALUE"]=>
+  string(1) "1"
   [2]=>
   NULL
+  ["BLOB"]=>
+  NULL
   [3]=>
   NULL
+  ["CLOB"]=>
+  NULL
   [4]=>
   NULL
+  ["STRING"]=>
+  NULL
 }
-array(5) {
+array(10) {
   [0]=>
   string(1) "1"
+  ["ID"]=>
+  string(1) "1"
   [1]=>
   string(1) "1"
+  ["VALUE"]=>
+  string(1) "1"
   [2]=>
   NULL
+  ["BLOB"]=>
+  NULL
   [3]=>
   NULL
+  ["CLOB"]=>
+  NULL
   [4]=>
   NULL
+  ["STRING"]=>
+  NULL
 }
 Done
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/tests/field_funcs1.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/oci8/tests/field_funcs1.phpt
diff -u php-src/ext/oci8/tests/field_funcs1.phpt:1.2 
php-src/ext/oci8/tests/field_funcs1.phpt:1.3
--- php-src/ext/oci8/tests/field_funcs1.phpt:1.2        Thu Dec  8 22:31:55 2005
+++ php-src/ext/oci8/tests/field_funcs1.phpt    Thu May 18 13:20:00 2006
@@ -34,7 +34,7 @@
        die("oci_execute(select) failed!\n");
 }
 
-$row = oci_fetch_array($s, OCI_RETURN_NULLS + OCI_RETURN_LOBS);
+$row = oci_fetch_array($s, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS);
 var_dump($row);
 
 var_dump(oci_field_is_null($s, -1));
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/tests/field_funcs.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/oci8/tests/field_funcs.phpt
diff -u php-src/ext/oci8/tests/field_funcs.phpt:1.4 
php-src/ext/oci8/tests/field_funcs.phpt:1.5
--- php-src/ext/oci8/tests/field_funcs.phpt:1.4 Tue Mar 28 09:13:35 2006
+++ php-src/ext/oci8/tests/field_funcs.phpt     Thu May 18 13:20:00 2006
@@ -34,7 +34,7 @@
        die("oci_execute(select) failed!\n");
 }
 
-$row = oci_fetch_array($s, OCI_RETURN_NULLS + OCI_RETURN_LOBS);
+$row = oci_fetch_array($s, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS);
 var_dump($row);
 
 foreach ($row as $num => $field) {
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/tests/lob_011.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/oci8/tests/lob_011.phpt
diff -u php-src/ext/oci8/tests/lob_011.phpt:1.3 
php-src/ext/oci8/tests/lob_011.phpt:1.4
--- php-src/ext/oci8/tests/lob_011.phpt:1.3     Tue Dec  6 19:26:57 2005
+++ php-src/ext/oci8/tests/lob_011.phpt Thu May 18 13:20:00 2006
@@ -69,8 +69,10 @@
 int(32)
 bool(true)
 string(32) "some string here. string, I said"
-array(1) {
+array(2) {
   [0]=>
   string(32) "some string here. string, I said"
+  ["BLOB"]=>
+  string(32) "some string here. string, I said"
 }
 Done
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/tests/select_null.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/oci8/tests/select_null.phpt
diff -u php-src/ext/oci8/tests/select_null.phpt:1.2 
php-src/ext/oci8/tests/select_null.phpt:1.3
--- php-src/ext/oci8/tests/select_null.phpt:1.2 Thu Dec  8 22:31:55 2005
+++ php-src/ext/oci8/tests/select_null.phpt     Thu May 18 13:20:00 2006
@@ -16,8 +16,10 @@
 echo "Done\n";
 ?>
 --EXPECT--     
-array(1) {
+array(2) {
   [0]=>
   NULL
+  ["NULL"]=>
+  NULL
 }
 Done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to