tony2001 Thu May 18 13:21:45 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src NEWS
/php-src/ext/oci8 oci8.c
/php-src/ext/oci8/tests fetch_array.phpt field_funcs1.phpt
field_funcs.phpt lob_001.phpt lob_011.phpt
select_null.phpt
Log:
MFH: fix #37487 (oci_fetch_array() array-type should always default to
OCI_BOTH)
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.553&r2=1.2027.2.554&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.553 php-src/NEWS:1.2027.2.554
--- php-src/NEWS:1.2027.2.553 Fri May 12 09:43:07 2006
+++ php-src/NEWS Thu May 18 13:21:44 2006
@@ -1,6 +1,8 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2006, PHP 5.?.?
+- Fixed bug #37487 (oci_fetch_array() array-type should always default to
+ OCI_BOTH). (Tony)
- Fixed bug #37416 (iterator_to_array() hides exceptions thrown in rewind()
method). (Tony)
- Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.269.2.17&r2=1.269.2.18&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.269.2.17 php-src/ext/oci8/oci8.c:1.269.2.18
--- php-src/ext/oci8/oci8.c:1.269.2.17 Wed May 10 10:08:23 2006
+++ php-src/ext/oci8/oci8.c Thu May 18 13:21:45 2006
@@ -26,7 +26,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.269.2.17 2006/05/10 10:08:23 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.269.2.18 2006/05/18 13:21:45 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.269.2.17 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.18 $");
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.1.2.4&r2=1.1.2.5&diff_format=u
Index: php-src/ext/oci8/tests/fetch_array.phpt
diff -u php-src/ext/oci8/tests/fetch_array.phpt:1.1.2.4
php-src/ext/oci8/tests/fetch_array.phpt:1.1.2.5
--- php-src/ext/oci8/tests/fetch_array.phpt:1.1.2.4 Tue Mar 28 09:12:45 2006
+++ php-src/ext/oci8/tests/fetch_array.phpt Thu May 18 13:21:45 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.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/oci8/tests/field_funcs1.phpt
diff -u php-src/ext/oci8/tests/field_funcs1.phpt:1.1.2.1
php-src/ext/oci8/tests/field_funcs1.phpt:1.1.2.2
--- php-src/ext/oci8/tests/field_funcs1.phpt:1.1.2.1 Thu Dec 8 22:30:23 2005
+++ php-src/ext/oci8/tests/field_funcs1.phpt Thu May 18 13:21:45 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.1.2.4&r2=1.1.2.5&diff_format=u
Index: php-src/ext/oci8/tests/field_funcs.phpt
diff -u php-src/ext/oci8/tests/field_funcs.phpt:1.1.2.4
php-src/ext/oci8/tests/field_funcs.phpt:1.1.2.5
--- php-src/ext/oci8/tests/field_funcs.phpt:1.1.2.4 Tue Mar 28 09:12:45 2006
+++ php-src/ext/oci8/tests/field_funcs.phpt Thu May 18 13:21:45 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_001.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u
Index: php-src/ext/oci8/tests/lob_001.phpt
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/tests/lob_011.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u
Index: php-src/ext/oci8/tests/lob_011.phpt
diff -u php-src/ext/oci8/tests/lob_011.phpt:1.1.2.3
php-src/ext/oci8/tests/lob_011.phpt:1.1.2.4
--- php-src/ext/oci8/tests/lob_011.phpt:1.1.2.3 Tue Dec 6 19:28:25 2005
+++ php-src/ext/oci8/tests/lob_011.phpt Thu May 18 13:21:45 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.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/oci8/tests/select_null.phpt
diff -u php-src/ext/oci8/tests/select_null.phpt:1.1.2.1
php-src/ext/oci8/tests/select_null.phpt:1.1.2.2
--- php-src/ext/oci8/tests/select_null.phpt:1.1.2.1 Thu Dec 8 22:30:23 2005
+++ php-src/ext/oci8/tests/select_null.phpt Thu May 18 13:21:45 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