php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81088 error in regression test for oci_fetch_object() and oci_fetch_array()
Submitted: 2021-05-28 15:15 UTC Modified: 2021-05-28 21:15 UTC
From: mjetzer dot cdc at gmail dot com Assigned: cmb (profile)
Status: Closed Package: OCI8 related
PHP Version: 8.0.6 OS: Linux RHEL-8
Private report: No CVE-ID: None
 [2021-05-28 15:15 UTC] mjetzer dot cdc at gmail dot com
Description:
------------
ext/reflection/tests/internal_parameter_default_value/check_all.phpt fails with the following:
    oci_fetch_object: Undefined constant "PHP_OCI_ASSOC"
    oci_fetch_array: Undefined constant "PHP_OCI_BOTH"

I see that most of the oci_* functions in ext/oci8/oci8_arginfo.h with similar default arguments use the OCI_* version of the constant, rather than the PHP_OCI_* versions, but oci_fetch_object() and oci_fetch_array() use the PHP_OCI_* version of the constants.

Changing the oci8_arginfo.h declarations to use only the OCI_* version of the constants allows the regression test to run successfully.

We do not use any of the oci_* functions directly, only via ADOdb, which provides all necessary arguments and does not default any arguments, so we have no ready means of testing these functions (other than by running the regression tests).

These constants are declared using PHP_OCI_* in the current versions of the files in git.

Test script:
---------------
Run regression test as TEST_PHP_EXECUTABLE=/PATH/TO/sapi/cli/php sapi/cli/php -n -c tmp-php.ini run-tests.php --no-clean ext/reflection/tests/internal_parameter_default_value/check_all.phpt

Expected result:
----------------
Regression test runs successfully.

Actual result:
--------------
Regression test fails with errors described in the Description.

Patches

oci8_php_oci_fix (last revision 2021-05-28 15:15 UTC by mjetzer dot cdc at gmail dot com)

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-05-28 15:46 UTC] kocsismate@php.net
The following pull request has been associated:

Patch Name: Fix bug #81088 error in regression test for oci_fetch_object() and oci_fetch_array()
On GitHub:  https://github.com/php/php-src/pull/7072
Patch:      https://github.com/php/php-src/pull/7072.patch
 [2021-05-28 15:48 UTC] kocsismate@php.net
Thanks for the report and the patch! Finally, I've created a PR to fix the issue because the arginfo file is in fact generated from oci8.stub.php.
 [2021-05-28 16:00 UTC] git@php.net
Automatic comment on behalf of kocsismate
Revision: https://github.com/php/php-src/commit/a0af84bebd6e86d3c285ceb51b30fb649fff10ce
Log: Fixed bug #81088 error in regression test for oci_fetch_object() and oci_fetch_array()
 [2021-05-28 16:00 UTC] git@php.net
-Status: Open +Status: Closed
 [2021-05-28 16:03 UTC] cmb@php.net
-Status: Closed +Status: Verified
 [2021-05-28 16:03 UTC] cmb@php.net
Oh, indeed, the stubs[1] are wrong!

[1] <https://github.com/php/php-src/blob/PHP-8.0/ext/oci8/oci8.stub.php#L253>
 [2021-05-28 21:15 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-05-28 21:15 UTC] cmb@php.net
Oh, Máté was fast! :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC