diff --git a/.circleci/config.yml b/.circleci/config.yml index 1455c3cd1c83..cd1139f43f3b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -149,8 +149,6 @@ jobs: --with-snmp \ `#--with-unixODBC` \ `#--with-pdo-odbc=unixODBC,/usr` \ - `#--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient` \ - `#--with-oci8=shared,instantclient,/opt/oracle/instantclient` \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ --with-pdo-firebird \ diff --git a/.github/actions/configure-x64/action.yml b/.github/actions/configure-x64/action.yml index f4bb7f2c1ac9..95cf656fa706 100644 --- a/.github/actions/configure-x64/action.yml +++ b/.github/actions/configure-x64/action.yml @@ -73,8 +73,6 @@ runs: ${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \ ${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \ ${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \ - $([ -d "/opt/oracle/instantclient" ] && echo '--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient') \ - $([ -d "/opt/oracle/instantclient" ] && echo '--with-oci8=shared,instantclient,/opt/oracle/instantclient') \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ ${{ inputs.skipSlow == 'false' && '--with-pdo-firebird' || '' }} \ diff --git a/.github/actions/setup-oracle/action.yml b/.github/actions/setup-oracle/action.yml deleted file mode 100644 index 1208e93a2489..000000000000 --- a/.github/actions/setup-oracle/action.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Create Oracle container -runs: - using: composite - steps: - - shell: bash - run: | - set -x - docker run \ - -e "ORACLE_PASSWORD=pass" \ - -p 1521:1521 \ - --name oracle \ - -h oracle \ - -d gvenzl/oracle-xe:slim - - mkdir /opt/oracle - wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip - unzip instantclient-basiclite-linuxx64.zip && rm instantclient-basiclite-linuxx64.zip - wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip - unzip instantclient-sdk-linuxx64.zip && rm instantclient-sdk-linuxx64.zip - mv instantclient_*_* /opt/oracle/instantclient - # interferes with libldap2 headers - rm /opt/oracle/instantclient/sdk/include/ldap.h - # fix debug build warning: zend_signal: handler was replaced for signal (2) after startup - echo DISABLE_INTERRUPT=on > /opt/oracle/instantclient/network/admin/sqlnet.ora - sudo sh -c 'echo /opt/oracle/instantclient >/etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig' - - sudo mkdir -p /etc/php.d - sudo chmod 777 /etc/php.d - echo extension=oci8.so > /etc/php.d/oci8.ini - echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini diff --git a/.github/labeler.yml b/.github/labeler.yml index 56fe6111262e..6dbb25327724 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -95,9 +95,6 @@ "Extension: mysqlnd": - ext/mysqlnd/**/* -"Extension: oci8": -- ext/oci8/**/* - "Extension: odbc": - ext/odbc/**/* @@ -125,9 +122,6 @@ "Extension: pdo_mysql": - ext/pdo_mysql/**/* -"Extension: pdo_oci": -- ext/pdo_oci/**/* - "Extension: pdo_odbc": - ext/pdo_odbc/**/* diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e55f5d9bb16f..e35baf822431 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -78,8 +78,6 @@ jobs: ref: ${{ matrix.branch.ref }} - name: Create MSSQL container uses: ./.github/actions/setup-mssql - - name: Create Oracle container - uses: ./.github/actions/setup-oracle - name: apt uses: ./.github/actions/apt-x64 - name: System info diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ff162c7bcfb0..743e59f08238 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -102,9 +102,6 @@ jobs: - name: Create MSSQL container if: ${{ !matrix.asan }} uses: ./.github/actions/setup-mssql - - name: Create Oracle container - if: ${{ !matrix.asan }} - uses: ./.github/actions/setup-oracle - name: Setup Caddy server uses: ./.github/actions/setup-caddy - name: ccache diff --git a/.gitignore b/.gitignore index 3ea5b3bfb074..52cfc5793668 100644 --- a/.gitignore +++ b/.gitignore @@ -277,8 +277,6 @@ tmp-php.ini # ------------------------------------------------------------------------------ # Generated by `./configure --enable-dtrace` for using DTrace framework # ------------------------------------------------------------------------------ -/ext/oci8/oci8_dtrace_gen.h -/ext/oci8/oci8_dtrace_gen.h.bak /Zend/zend_dtrace_gen.h /Zend/zend_dtrace_gen.h.bak diff --git a/EXTENSIONS b/EXTENSIONS index 8e711788384a..b073a4a72b5e 100644 --- a/EXTENSIONS +++ b/EXTENSIONS @@ -93,12 +93,6 @@ MAINTENANCE: Maintained STATUS: Working SINCE: 5.3 ------------------------------------------------------------------------------- -EXTENSION: oci8 -PRIMARY MAINTAINER: Christopher Jones (2007 - 2017) - Antony Dovgal (2003 - 2009) -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- EXTENSION: odbc PRIMARY MAINTAINER: Daniel R. Kalowsky (2000 - 2004) MAINTENANCE: Maintained @@ -139,12 +133,6 @@ MAINTENANCE: Odd fixes STATUS: Working SINCE: 5.1 ------------------------------------------------------------------------------- -EXTENSION: pdo_oci -PRIMARY MAINTAINER: Christopher Jones (2007 - 2017) -MAINTENANCE: Odd fixes -STATUS: Working -SINCE: 5.1 -------------------------------------------------------------------------------- EXTENSION: pdo_pgsql PRIMARY MAINTAINER: Ilia Alshanetsky (2004 - 2011) MAINTENANCE: Odd fixes diff --git a/Zend/Optimizer/zend_func_infos.h b/Zend/Optimizer/zend_func_infos.h index dbe4c21eb55e..902a3269c9d3 100644 --- a/Zend/Optimizer/zend_func_infos.h +++ b/Zend/Optimizer/zend_func_infos.h @@ -308,14 +308,6 @@ static const func_info_t func_infos[] = { F1("mysqli_stat", MAY_BE_STRING|MAY_BE_FALSE), F1("mysqli_store_result", MAY_BE_OBJECT|MAY_BE_FALSE), F1("mysqli_use_result", MAY_BE_OBJECT|MAY_BE_FALSE), - FN("oci_new_connect", MAY_BE_RESOURCE|MAY_BE_FALSE), - FN("oci_connect", MAY_BE_RESOURCE|MAY_BE_FALSE), - FN("oci_pconnect", MAY_BE_RESOURCE|MAY_BE_FALSE), - F1("oci_error", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE), - FN("oci_parse", MAY_BE_RESOURCE|MAY_BE_FALSE), - FN("oci_get_implicit_resultset", MAY_BE_RESOURCE|MAY_BE_FALSE), - FN("oci_password_change", MAY_BE_RESOURCE|MAY_BE_BOOL), - FN("oci_new_cursor", MAY_BE_RESOURCE|MAY_BE_FALSE), FN("odbc_prepare", MAY_BE_RESOURCE|MAY_BE_FALSE), FN("odbc_exec", MAY_BE_RESOURCE|MAY_BE_FALSE), FN("odbc_connect", MAY_BE_RESOURCE|MAY_BE_FALSE), diff --git a/build/Makefile.global b/build/Makefile.global index d79528ba23cd..fe7d6a2cb0a5 100644 --- a/build/Makefile.global +++ b/build/Makefile.global @@ -128,7 +128,7 @@ clean: distclean: clean rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h rm -f main/build-defs.h scripts/phpize - rm -f ext/date/lib/timelib_config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak + rm -f ext/date/lib/timelib_config.h ext/mbstring/libmbfl/config.h rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 sapi/phpdbg/phpdbg.1 ext/phar/phar.1 ext/phar/phar.phar.1 rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html rm -f ext/phar/phar.phar ext/phar/phar.php diff --git a/configure.ac b/configure.ac index 8792c80b3053..b02802a24a36 100644 --- a/configure.ac +++ b/configure.ac @@ -1842,24 +1842,6 @@ X fi fi - dnl Warn about Apache if oci8 extension is enabled on Linux. - if test "$PHP_OCI8" != "no"; then - if test "$PHP_SIGCHILD" != "yes"; then - if test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then -cat < processes when using a local Oracle | -| database, set the value BEQUEATH_DETACH=YES in Oracle Net's | -| sqlnet.ora file on the PHP host, or set the environment variable | -| BEQUEATH_DETACH to YES before starting Apache. If the problem | -| still occurs, then recompile PHP and specify --enable-sigchild | -| when configuring. | -X - fi - fi - fi - fi ]) AC_OUTPUT diff --git a/ext/oci8/CREDITS b/ext/oci8/CREDITS deleted file mode 100644 index 4c1e0d05b7f4..000000000000 --- a/ext/oci8/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -OCI8 -Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky, Harald Radi, Antony Dovgal, Andi Gutmans, Wez Furlong, Christopher Jones, Oracle Corporation diff --git a/ext/oci8/LICENSE b/ext/oci8/LICENSE deleted file mode 100644 index 0815d7eb7911..000000000000 --- a/ext/oci8/LICENSE +++ /dev/null @@ -1,68 +0,0 @@ --------------------------------------------------------------------- - The PHP License, version 3.01 -Copyright (c) 1999 - 2024 The PHP Group. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. The name "PHP" must not be used to endorse or promote products - derived from this software without prior written permission. For - written permission, please contact group@php.net. - - 4. Products derived from this software may not be called "PHP", nor - may "PHP" appear in their name, without prior written permission - from group@php.net. You may indicate that your software works in - conjunction with PHP by saying "Foo for PHP" instead of calling - it "PHP Foo" or "phpfoo" - - 5. The PHP Group may publish revised and/or new versions of the - license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the terms - of that version. You may also choose to use such covered code - under the terms of any subsequent version of the license - published by the PHP Group. No one other than the PHP Group has - the right to modify the terms applicable to covered code created - under this License. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes PHP software, freely available from - ". - -THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND -ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP -DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------- - -This software consists of voluntary contributions made by many -individuals on behalf of the PHP Group. - -The PHP Group can be contacted via Email at group@php.net. - -For more information on the PHP Group and the PHP project, -please see . - -PHP includes the Zend Engine, freely available at -. diff --git a/ext/oci8/README.md b/ext/oci8/README.md deleted file mode 100644 index d0c0c3be0960..000000000000 --- a/ext/oci8/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# The OCI8 Extension - -Use the OCI8 extension to access Oracle Database. - -Documentation is at https://www.php.net/oci8 - -Use `pecl install oci8` to install for PHP 8.2. - -Use `pecl install oci8-3.2.1` to install for PHP 8.1. - -Use `pecl install oci8-3.0.1` to install for PHP 8.0. - -Use `pecl install oci8-2.2.0` to install for PHP 7. - -The OCI8 extension can be linked with Oracle client libraries from Oracle -Database 11.2 or later. These libraries are found in your database -installation, or in the free Oracle Instant Client from -https://www.oracle.com/database/technologies/instant-client.html -Install the 'Basic' or 'Basic Light' Instant Client package. If building from -source, then also install the SDK package. - -Oracle's standard cross-version connectivity applies. For example, PHP OCI8 -linked with Instant Client 19c can connect to Oracle Database 11.2 onward. See -Oracle's note "Oracle Client / Server Interoperability Support" (ID 207303.1) -for details. diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4 deleted file mode 100644 index 5aa7e17bf58b..000000000000 --- a/ext/oci8/config.m4 +++ /dev/null @@ -1,434 +0,0 @@ -if test -z "$SED"; then - PHP_OCI8_SED="sed"; -else - PHP_OCI8_SED="$SED"; -fi - -PHP_OCI8_TAIL1=`echo a | tail -n1 2>/dev/null` -if test "$PHP_OCI8_TAIL1" = "a"; then - PHP_OCI8_TAIL1="tail -n1" -else - PHP_OCI8_TAIL1="tail -1" -fi - -AC_DEFUN([AC_OCI8_CHECK_LIB_DIR],[ - AC_MSG_CHECKING([ORACLE_HOME library validity]) - if test ! -d "$OCI8_DIR"; then - AC_MSG_ERROR([${OCI8_DIR} is not a directory]) - fi - if test -d "$OCI8_DIR/lib" && test ! -d "$OCI8_DIR/lib32"; then - OCI8_LIB_DIR=lib - elif test ! -d "$OCI8_DIR/lib" && test -d "$OCI8_DIR/lib32"; then - OCI8_LIB_DIR=lib32 - elif test -d "$OCI8_DIR/lib" && test -d "$OCI8_DIR/lib32"; then - OCI8_LIB_DIR=$PHP_OCI8_OH_LIBDIR - else - dnl This isn't an ORACLE_HOME. Try heuristic examination of the dir to help - dnl the user. - if test -f "$OCI8_DIR/libociei.$SHLIB_SUFFIX_NAME"; then - AC_MSG_ERROR([Expected an ORACLE_HOME top level directory but ${OCI8_DIR} appears to be an Instant Client directory. Try --with-oci8=instantclient,${OCI8_DIR}]) - else - AC_MSG_ERROR([Oracle library directory not found in ${OCI8_DIR}]) - fi - fi - AC_MSG_RESULT($OCI8_LIB_DIR) -]) - -AC_DEFUN([AC_OCI8IC_VERSION],[ - AC_MSG_CHECKING([Oracle Instant Client library version compatibility]) - OCI8_LCS_BASE=$PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME - dnl Oracle 10g, 11g etc - OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | $PHP_OCI8_TAIL1` - OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | $PHP_OCI8_TAIL1` - if test -f "$OCI8_NNZ" && test -f "$OCI8_LCS"; then - if test ! -f "$OCI8_LCS_BASE"; then - AC_MSG_ERROR([Link from $OCI8_LCS_BASE to $OCI8_LCS_BASE.*.1 not found]) - fi - OCI8_ORACLE_VERSION=`echo $OCI8_LCS | $PHP_OCI8_SED -e 's/.*\.\(.*\)\.1$/\1.1/'` - else - AC_MSG_ERROR([Oracle Instant Client libraries libnnz.$SHLIB_SUFFIX_NAME and libclntsh.$SHLIB_SUFFIX_NAME not found]) - fi - AC_MSG_RESULT([$OCI8_ORACLE_VERSION]) -]) - -AC_DEFUN([AC_OCI8_ORACLE_VERSION],[ - AC_MSG_CHECKING([Oracle library version compatibility]) - OCI8_LCS_BASE=$OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME - dnl Oracle 10g, 11g etc - OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | $PHP_OCI8_TAIL1` - if test -s "$OCI8_DIR/orainst/unix.rgs"; then - OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4` - test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3 - elif test -f "$OCI8_LCS"; then - dnl Oracle 10g, 11g etc. The x.2 version libraries are named x.1 for drop in - dnl compatibility - OCI8_ORACLE_VERSION=`echo $OCI8_LCS | $PHP_OCI8_SED -e 's/.*\.\(.*\)\.1$/\1.1/'` - elif test -f $OCI8_LCS_BASE.9.0; then - dnl There is no case for Oracle 9.2. Oracle 9.2 libraries have a 9.0 suffix - dnl for drop-in compatibility with Oracle 9.0 - OCI8_ORACLE_VERSION=9.0 - elif test -f $OCI8_LCS_BASE.8.0; then - OCI8_ORACLE_VERSION=8.1 - elif test -f $OCI8_LCS_BASE.1.0; then - OCI8_ORACLE_VERSION=8.0 - elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.a; then - if test -f $OCI8_DIR/$OCI8_LIB_DIR/libcore4.a; then - OCI8_ORACLE_VERSION=8.0 - else - OCI8_ORACLE_VERSION=8.1 - fi - else - AC_MSG_ERROR(Oracle libclntsh.$SHLIB_SUFFIX_NAME client library not found) - fi - AC_MSG_RESULT($OCI8_ORACLE_VERSION) -]) - -dnl -dnl OCI8_INIT_DTRACE(providerdesc, header-file, sources) -dnl This mimics PHP_INIT_DTRACE from build/php.m4. It is necessarily different -dnl from PHP_INIT_DTRACE which doesn't currently support DTrace for extensions. -dnl Creating OCI8_INIT_DTRACE independently instead of using a refactored -dnl PHP_INIT_DTRACE allows OCI8 to be DTraced on versions of PHP where core PHP -dnl DTrace support isn't available. -dnl -AC_DEFUN([OCI8_INIT_DTRACE],[ - ac_srcdir=[]PHP_EXT_SRCDIR([oci8])/ - ac_bdir=[]PHP_EXT_BUILDDIR([oci8])/ - -dnl providerdesc - ac_provsrc=$1 - -dnl header-file - ac_hdrobj=$2 - -dnl DTrace objects - old_IFS=[$]IFS - for ac_src in $3; do - IFS=. - set $ac_src - ac_obj=[$]1 - IFS=$old_IFS - - OCI8_DTRACE_OBJS="[$]OCI8_DTRACE_OBJS [$]ac_bdir[$]ac_obj.lo" - done; - - for ac_lo in $OCI8_DTRACE_OBJS; do - dtrace_oci8_objs="[$]dtrace_oci8_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" - done; - -dnl Generate Makefile.objects entry. The empty $ac_provsrc command stops an -dnl implicit circular dependency in GNU Make which causes the .d file to be -dnl overwritten (Bug 61268). - cat>>Makefile.objects< \$[]@ - -\$(OCI8_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj - -EOF - - case $host_alias in - *solaris*|*linux*) - dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o" - dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs" - dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o" - dtrace_nolib_objs='$(OCI8_DTRACE_OBJS:.lo=.o)' - for ac_lo in $OCI8_DTRACE_OBJS; do - dtrace_oci8_lib_objs="[$]dtrace_oci8_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" - done; - - dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692) - cat>>Makefile.objects< \$[]@ - @test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir - if CC="\$(CC)" CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $ac_srcdir[$]ac_provsrc $dtrace_oci8_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\] - echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\] - else [\\] - echo "pic_object='none'" >> \$[]@ [;\\] - fi - if CC="\$(CC)" CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $ac_srcdir[$]ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\] - echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\] - else [\\] - echo "non_pic_object='none'" >> \$[]@ [;\\] - fi - -EOF - ;; - *) - AC_MSG_WARN([OCI8 extension: OCI8 DTrace support is not confirmed on this platform]) -cat>>Makefile.objects</dev/null|head -n 1|$PHP_OCI8_SED -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'` - else - php_version=`echo "$tmp_version"|$PHP_OCI8_SED -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'` - fi - - if test -z "$php_version"; then - AC_MSG_ERROR([failed to detect PHP version, please report]) - fi - - ac_IFS=$IFS - IFS="." - set $php_version - IFS=$ac_IFS - oci8_php_version=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` - - if test "$oci8_php_version" -lt "5002000"; then - AC_MSG_ERROR([You need at least PHP 8.1.0 to be able to use this version of OCI8. Use OCI8 1.4 for PHP $php_version]) - elif test "$oci8_php_version" -lt "7000000"; then - AC_MSG_ERROR([You need at least PHP 8.1.0 to be able to use this version of OCI8. Use OCI8 2.0 for PHP $php_version]) - elif test "$oci8_php_version" -lt "8000000"; then - AC_MSG_ERROR([You need at least PHP 8.1.0 to be able to use this version of OCI8. Use OCI8 2.2 for PHP $php_version]) - elif test "$oci8_php_version" -lt "8001000"; then - AC_MSG_ERROR([You need at least PHP 8.1.0 to be able to use this version of OCI8. Use OCI8 3.0 for PHP $php_version]) - else - AC_MSG_RESULT([$php_version, ok]) - fi - - dnl Check whether --enable-dtrace was set. To use DTrace with a PECL install, - dnl extract the OCI8 archive, phpize it, and set PHP_DTRACE=yes before running - dnl configure. - AC_MSG_CHECKING([OCI8 DTrace support]) - oci8_do_dtrace="`echo $PHP_OCI8 | cut -d, -f3`" - if test "$PHP_DTRACE" = "yes" -o "$oci8_do_dtrace" = "dtrace" ; then - AC_MSG_RESULT([yes]) - if test "$ext_shared" = "no"; then - AC_MSG_ERROR([For DTrace support OCI8 must be configured as a shared extension]) - else - AC_CHECK_HEADERS([sys/sdt.h], [ - OCI8_INIT_DTRACE([oci8_dtrace.d],[oci8_dtrace_gen.h],[oci8.c oci8_statement.c]) - - ], [ - AC_MSG_ERROR( - [Cannot find sys/sdt.h which is required for DTrace support]) - ]) - PHP_SUBST(OCI8_DTRACE_OBJS) - AC_DEFINE(HAVE_OCI8_DTRACE,1,[Defined to 1 if PHP OCI8 DTrace support was enabled during configuration]) - dnl Developer warning: hard coded extension is OK for the known supported - dnl environments. - shared_objects_oci8="$shared_objects_oci8 PHP_EXT_BUILDDIR(oci8)/oci8_dtrace.d.lo" - fi - else - AC_MSG_RESULT([no]) - fi - - dnl Set some port specific directory components for use later. - AC_CHECK_SIZEOF([long]) - AC_MSG_CHECKING([if we're at 64-bit platform]) - AS_IF([test "$ac_cv_sizeof_long" -eq 4],[ - AC_MSG_RESULT([no]) - PHP_OCI8_OH_LIBDIR=lib32 - PHP_OCI8_IC_LIBDIR_SUFFIX="" - ],[ - AC_MSG_RESULT([yes]) - PHP_OCI8_OH_LIBDIR=lib - PHP_OCI8_IC_LIBDIR_SUFFIX=64 - ]) - - dnl Determine if the user wants to use Oracle Instant Client libraries. - - PHP_OCI8_INSTANT_CLIENT="no" - - dnl PECL Bug 14268 (Allow "pecl install oci8" command to "autodetect" an - dnl Instant Client RPM install). This also has a benefit for non - dnl "pecl install" builds: if the user does --with-oci8 or --with-oci8=shared - dnl but the ORACLE_HOME environment variable is not actually set, the install - dnl tries to locate the Instant Client RPM. - if test "$PHP_OCI8" = "yes" && test -z "$ORACLE_HOME"; then - AC_MSG_WARN([OCI8 extension: ORACLE_HOME is not set, looking for default Oracle Instant Client instead]) - PHP_OCI8=instantclient - fi - - if test "`echo $PHP_OCI8`" = "instantclient"; then - PHP_OCI8_INSTANT_CLIENT="yes" - elif test "`echo $PHP_OCI8 | cut -d, -f2`" = "instantclient"; then - PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f3`" - PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f1,4`" - if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then - PHP_OCI8_INSTANT_CLIENT="yes" - fi - if test -z "$PHP_OCI8"; then - PHP_OCI8=yes - fi - elif test "`echo $PHP_OCI8 | cut -d, -f1`" = "instantclient"; then - PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f2`" - PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f3,4`" - if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then - PHP_OCI8_INSTANT_CLIENT="yes" - fi - if test -z "$PHP_OCI8"; then - PHP_OCI8=yes - fi - fi - - if test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then - dnl *************************************** - dnl Branch for using an ORACLE_HOME install - dnl *************************************** - - AC_MSG_CHECKING([Oracle ORACLE_HOME install directory]) - - if test "$PHP_OCI8" = "yes"; then - OCI8_DIR=$ORACLE_HOME - else - OCI8_DIR=$PHP_OCI8 - fi - AC_MSG_RESULT($OCI8_DIR) - - AC_OCI8_CHECK_LIB_DIR($OCI8_DIR) - - if test -d "$OCI8_DIR/rdbms/public"; then - PHP_ADD_INCLUDE($OCI8_DIR/rdbms/public) - OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/public" - fi - if test -d "$OCI8_DIR/rdbms/demo"; then - PHP_ADD_INCLUDE($OCI8_DIR/rdbms/demo) - OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/demo" - fi - if test -d "$OCI8_DIR/network/public"; then - PHP_ADD_INCLUDE($OCI8_DIR/network/public) - OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/network/public" - fi - if test -d "$OCI8_DIR/plsql/public"; then - PHP_ADD_INCLUDE($OCI8_DIR/plsql/public) - OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/plsql/public" - fi - - if test -f "$OCI8_DIR/$OCI8_LIB_DIR/sysliblist"; then - PHP_EVAL_LIBLINE(`cat $OCI8_DIR/$OCI8_LIB_DIR/sysliblist`, OCI8_SYSLIB) - elif test -f "$OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist"; then - PHP_EVAL_LIBLINE(`cat $OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist`, OCI8_SYSLIB) - fi - - AC_OCI8_ORACLE_VERSION($OCI8_DIR) - - case $OCI8_ORACLE_VERSION in - 7.3|8.0|8.1|9.0|10.1) - AC_MSG_ERROR([Oracle Client libraries < 11.2 are not supported]) - ;; - esac - - PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) - PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD) - PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c, $ext_shared) - AC_DEFINE(HAVE_OCI8,1,[Defined to 1 if the PHP OCI8 extension for Oracle Database is configured]) - - PHP_SUBST_OLD(OCI8_SHARED_LIBADD) - PHP_SUBST_OLD(OCI8_DIR) - PHP_SUBST_OLD(OCI8_ORACLE_VERSION) - - dnl Fix Bug #46623 - AC_DEFINE_UNQUOTED(PHP_OCI8_DEF_DIR, "$OCI8_DIR", [ ]) - AC_DEFINE_UNQUOTED(PHP_OCI8_DEF_SHARED_LIBADD, "$OCI8_SHARED_LIBADD", [ ]) - - else - dnl *************************************************** - dnl Branch for using an Oracle Instant Client directory - dnl *************************************************** - - AC_MSG_CHECKING([Oracle Instant Client directory]) - - if test "$PHP_OCI8_INSTANT_CLIENT" = "yes"; then - dnl Find the directory if user specified "instantclient" but did not give - dnl a dir. Generally the Instant Client can be anywhere so the user must - dnl pass in the library directory. But on Linux we default to the most - dnl recent version in /usr/lib which is where the Oracle Instant Client - dnl RPM gets installed. - PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | $PHP_OCI8_TAIL1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'` - if test -z "$PHP_OCI8_INSTANT_CLIENT"; then - AC_MSG_ERROR([Oracle Instant Client directory /usr/lib/oracle/.../client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib libraries not found. Try --with-oci8=instantclient,DIR]) - fi - fi - AC_MSG_RESULT($PHP_OCI8_INSTANT_CLIENT) - - OCI8_DIR=$PHP_OCI8_INSTANT_CLIENT - - AC_MSG_CHECKING([Oracle Instant Client SDK header directory]) - - dnl Header directory for Instant Client SDK RPM install - OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!^/usr/lib/oracle/\(.*\)/client\('${PHP_OCI8_IC_LIBDIR_SUFFIX}'\)*/lib[/]*$!/usr/include/oracle/\1/client\2!'` - - dnl Header directory for Instant Client SDK zip file install - OCISDKZIPINC=$PHP_OCI8_INSTANT_CLIENT/sdk/include - - dnl Header directory for manual installation - OCISDKMANINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!\(.*\)/lib[/]*$!\1/include!'` - - if test -f "$OCISDKRPMINC/oci.h"; then - AC_MSG_RESULT($OCISDKRPMINC) - PHP_ADD_INCLUDE($OCISDKRPMINC) - OCI8INCDIR=$OCISDKRPMINC - elif test -f "$OCISDKZIPINC/oci.h"; then - AC_MSG_RESULT($OCISDKZIPINC) - PHP_ADD_INCLUDE($OCISDKZIPINC) - OCI8INCDIR=$OCISDKZIPINC - elif test -f "$OCISDKMANINC/oci.h"; then - AC_MSG_RESULT($OCISDKMANINC) - PHP_ADD_INCLUDE($OCISDKMANINC) - OCI8INCDIR=$OCISDKMANINC - else - AC_MSG_ERROR([Oracle Instant Client SDK header files not found]) - fi - - OCISYSLIBLIST=`echo "$OCI8INCDIR" | $PHP_OCI8_SED -e 's!\(.*\)/include$!\1/demo/sysliblist!'` - if test -f "$OCISYSLIBLIST"; then - PHP_EVAL_LIBLINE(`cat $OCISYSLIBLIST`, OCI8_SYSLIB) - fi - - AC_OCI8IC_VERSION($PHP_OCI8_INSTANT_CLIENT) - case $OCI8_ORACLE_VERSION in - 10.1) - AC_MSG_ERROR([Oracle Client libraries < 11.2 are not supported]) - ;; - esac - PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) - PHP_ADD_LIBPATH($PHP_OCI8_INSTANT_CLIENT, OCI8_SHARED_LIBADD) - - AC_DEFINE(HAVE_OCI_INSTANT_CLIENT,1,[Defined to 1 if OCI8 configuration located Oracle's Instant Client libraries]) - - PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c, $ext_shared) - AC_DEFINE(HAVE_OCI8,1,[Defined to 1 if the PHP OCI8 extension for Oracle Database is configured]) - - PHP_SUBST_OLD(OCI8_SHARED_LIBADD) - PHP_SUBST_OLD(OCI8_DIR) - PHP_SUBST_OLD(OCI8_ORACLE_VERSION) - - fi -fi diff --git a/ext/oci8/config.w32 b/ext/oci8/config.w32 deleted file mode 100644 index 8d17878c7764..000000000000 --- a/ext/oci8/config.w32 +++ /dev/null @@ -1,125 +0,0 @@ -// vim:ft=javascript - -if (PHP_OCI8_11G != "no" && PHP_OCI8_12C != "no") { - if (!PHP_OCI8_11G_SHARED && !PHP_OCI8_12C_SHARED) { - WARNING("oci8-11g and oci8-12c provide the same extension and cannot both be built statically"); - PHP_OCI8_11G = "no" - } -} - -if (PHP_OCI8_11G != "no" && PHP_OCI8_19 != "no") { - if (!PHP_OCI8_11G_SHARED && !PHP_OCI8_19_SHARED) { - WARNING("oci8-11g and oci8-19 provide the same extension and cannot both be built statically"); - PHP_OCI8_11G = "no" - } -} - -if (PHP_OCI8_12C != "no" && PHP_OCI8_19 != "no") { - if (!PHP_OCI8_12C_SHARED && !PHP_OCI8_19_SHARED) { - WARNING("oci8-12c and oci8-19 provide the same extension and cannot both be built statically"); - PHP_OCI8_12C = "no" - } -} - -ARG_WITH("oci8-11g", "OCI8 support using Oracle 11g Instant Client", "no"); - -if (PHP_OCI8_11G != "no") { - - oci8_11g_dirs = new Array( - PHP_OCI8_11G - ); - - oci8_11g_lib_paths = ""; - oci8_11g_inc_paths = ""; - - // find the Oracle install - for (i = 0; i < oci8_11g_dirs.length; i++) { - oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib;"; - oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib\\msvc;"; - oci8_11g_inc_paths += oci8_11g_dirs[i] + "\\include;"; - } - - oci8_11g_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_11;" - oci8_11g_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_11;"; - - if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_11G", oci8_11g_inc_paths) && - CHECK_LIB("oci.lib", "oci8_11g", oci8_11g_lib_paths)) - { - EXTENSION('oci8_11g', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c', null, null, null, "ext\\oci8_11g") - - AC_DEFINE('HAVE_OCI8', 1); - AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1); - - } else { - WARNING("oci8-11g not enabled: Oracle Database client libraries or Oracle 11g Instant Client not found"); - PHP_OCI8_11G = "no" - } -} - -ARG_WITH("oci8-12c", "OCI8 support using Oracle Database 12c Instant Client", "no"); - -if (PHP_OCI8_12C != "no") { - - oci8_12c_dirs = new Array( - PHP_OCI8_12C - ); - - oci8_12c_lib_paths = ""; - oci8_12c_inc_paths = ""; - - // find the Oracle install - for (i = 0; i < oci8_12c_dirs.length; i++) { - oci8_12c_lib_paths += oci8_12c_dirs[i] + "\\lib;"; - oci8_12c_lib_paths += oci8_12c_dirs[i] + "\\lib\\msvc;"; - oci8_12c_inc_paths += oci8_12c_dirs[i] + "\\include;"; - } - - oci8_12c_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_12;" - oci8_12c_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_12;"; - - if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_12C", oci8_12c_inc_paths) && - CHECK_LIB("oci.lib", "oci8_12c", oci8_12c_lib_paths)) - { - EXTENSION('oci8_12c', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c', null, null, null, "ext\\oci8_12c") - - AC_DEFINE('HAVE_OCI8', 1); - AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1); - } else { - WARNING("oci8-12c not enabled: Oracle Database client libraries or Oracle Database 12c Instant Client not found"); - PHP_OCI8_12C = "no" - } -} - -ARG_WITH("oci8-19", "OCI8 support using Oracle Database 19 Instant Client", "no"); - -if (PHP_OCI8_19 != "no") { - - oci8_19_dirs = new Array( - PHP_OCI8_19 - ); - - oci8_19_lib_paths = ""; - oci8_19_inc_paths = ""; - - // find the Oracle install - for (i = 0; i < oci8_19_dirs.length; i++) { - oci8_19_lib_paths += oci8_19_dirs[i] + "\\lib;"; - oci8_19_lib_paths += oci8_19_dirs[i] + "\\lib\\msvc;"; - oci8_19_inc_paths += oci8_19_dirs[i] + "\\include;"; - } - - oci8_19_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_19;" - oci8_19_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_19;"; - - if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_19", oci8_19_inc_paths) && - CHECK_LIB("oci.lib", "oci8_19", oci8_19_lib_paths)) - { - EXTENSION('oci8_19', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c', null, null, null, "ext\\oci8_19") - - AC_DEFINE('HAVE_OCI8', 1); - AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1); - } else { - WARNING("oci8-19 not enabled: Oracle Database client libraries or Oracle Database 19 Instant Client not found"); - PHP_OCI8_19 = "no" - } -} diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c deleted file mode 100644 index 01cb1c8ad927..000000000000 --- a/ext/oci8/oci8.c +++ /dev/null @@ -1,2532 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | - | Thies C. Arntzen | - | Maxim Maletsky | - | | - | Collection support by Andy Sautins | - | Temporary LOB support by David Benson | - | ZTS per process OCIPLogon by Harald Radi | - | | - | Redesigned by: Antony Dovgal | - | Andi Gutmans | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" -#include "zend_attributes.h" -#include "zend_smart_str.h" - -#ifdef HAVE_OCI8 - -/* Note to maintainers: config.m4 should/does check the minimum PHP version so - * the below checks are obsolete - but are kept 'just in case'. Also bump the - * minimum version in package.xml, as appropriate. */ - -/* PHP 5.2 is the minimum supported version for OCI8 2.0 */ -#if PHP_MAJOR_VERSION < 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION <= 1) -#error Use PHP OCI8 1.4 for your version of PHP -#elif PHP_MAJOR_VERSION < 7 -/* PHP 7 is the minimum supported version for OCI8 2.1 */ -#error Use PHP OCI8 2.0 for your version of PHP -#elif PHP_MAJOR_VERSION < 8 -/* PHP 8 is the minimum supported version for OCI8 3 */ -#error Use PHP OCI8 2.2 for your version of PHP -#elif PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION < 1 -#error Use PHP OCI8 3.0 for your version of PHP -#elif PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION < 2 -#error Use PHP OCI8 3.2 for your version of PHP -#endif - -#include "php_oci8.h" -#include "php_oci8_int.h" -#include "zend_hash.h" - -ZEND_DECLARE_MODULE_GLOBALS(oci) -static PHP_GINIT_FUNCTION(oci); -static PHP_GSHUTDOWN_FUNCTION(oci); - -/* Allow PHP 5.3 branch to be used in PECL for 5.x compatible builds */ -#ifndef Z_ADDREF_P -#define Z_ADDREF_P(x) ZVAL_ADDREF(x) -#endif - -/* For a user friendly message about environment setup */ -#if defined(PHP_WIN32) -#define PHP_OCI8_LIB_PATH_MSG "PATH" -#elif defined(__APPLE__) -#define PHP_OCI8_LIB_PATH_MSG "DYLD_LIBRARY_PATH" -#elif defined(_AIX) -#define PHP_OCI8_LIB_PATH_MSG "LIBPATH" -#elif defined(__hpux) -#define PHP_OCI8_LIB_PATH_MSG "SHLIB_PATH" -#else -#define PHP_OCI8_LIB_PATH_MSG "LD_LIBRARY_PATH" -#endif - -/* True globals, no need for thread safety */ -int le_connection; -int le_pconnection; -int le_statement; -int le_descriptor; -int le_psessionpool; -int le_collection; - -zend_class_entry *oci_lob_class_entry_ptr; -zend_class_entry *oci_coll_class_entry_ptr; - -#ifndef SQLT_BFILEE -#define SQLT_BFILEE 114 -#endif -#ifndef SQLT_CFILEE -#define SQLT_CFILEE 115 -#endif - -#ifdef ZTS -#define PHP_OCI_INIT_MODE (OCI_DEFAULT | OCI_OBJECT | OCI_THREADED | OCI_NO_MUTEX) -#else -#define PHP_OCI_INIT_MODE (OCI_DEFAULT | OCI_OBJECT) -#endif - -/* {{{ static protos */ -static void php_oci_connection_list_dtor (zend_resource *); -static void php_oci_pconnection_list_dtor (zend_resource *); -static void php_oci_pconnection_list_np_dtor (zend_resource *); -static void php_oci_statement_list_dtor (zend_resource *); -static void php_oci_descriptor_list_dtor (zend_resource *); -static void php_oci_spool_list_dtor(zend_resource *entry); -static void php_oci_collection_list_dtor (zend_resource *); - -static int php_oci_persistent_helper(zval *zv); -static int php_oci_connection_ping(php_oci_connection *); -static int php_oci_connection_status(php_oci_connection *); -static int php_oci_connection_close(php_oci_connection *); -static void php_oci_spool_close(php_oci_spool *session_pool); - -static OCIEnv *php_oci_create_env(ub2 charsetid); -static int php_oci_create_session(php_oci_connection *connection, php_oci_spool *session_pool, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode); -static int php_oci_old_create_session(php_oci_connection *connection, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode); -static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, int charsetid); -static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid); -static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh); -/* }}} */ - -/* {{{ dynamically loadable module stuff */ -#if defined(COMPILE_DL_OCI8) || defined(COMPILE_DL_OCI8_11G) || defined(COMPILE_DL_OCI8_12C) || defined(COMPILE_DL_OCI8_19) -ZEND_GET_MODULE(oci8) -#endif /* COMPILE_DL */ -/* }}} */ - -#include "oci8_arginfo.h" - -static PHP_INI_MH(OnUpdateOldCloseSemantics) -{ - bool *p = (bool *) ZEND_INI_GET_ADDR(); - *p = zend_ini_parse_bool(new_value); - - if (*p) { - zend_error(E_DEPRECATED, "Directive oci8.old_oci_close_semantics is deprecated"); - } - - return SUCCESS; -} - -/* {{{ extension definition structures */ - -zend_module_entry oci8_module_entry = { - STANDARD_MODULE_HEADER, - "oci8", /* extension name */ - ext_functions, /* extension function list */ - PHP_MINIT(oci), /* extension-wide startup function */ - PHP_MSHUTDOWN(oci), /* extension-wide shutdown function */ - PHP_RINIT(oci), /* per-request startup function */ - PHP_RSHUTDOWN(oci), /* per-request shutdown function */ - PHP_MINFO(oci), /* information function */ - PHP_OCI8_VERSION, - PHP_MODULE_GLOBALS(oci), /* globals descriptor */ - PHP_GINIT(oci), /* globals ctor */ - PHP_GSHUTDOWN(oci), /* globals dtor */ - NULL, /* post deactivate */ - STANDARD_MODULE_PROPERTIES_EX -}; -/* }}} */ - -/* {{{ PHP_INI */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY( "oci8.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY( "oci8.persistent_timeout", "-1", PHP_INI_SYSTEM, OnUpdateLong, persistent_timeout, zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY( "oci8.ping_interval", "60", PHP_INI_SYSTEM, OnUpdateLong, ping_interval, zend_oci_globals, oci_globals) - STD_PHP_INI_BOOLEAN("oci8.privileged_connect", "0", PHP_INI_SYSTEM, OnUpdateBool, privileged_connect, zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY( "oci8.statement_cache_size", "20", PHP_INI_SYSTEM, OnUpdateLong, statement_cache_size, zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY( "oci8.default_prefetch", "100", PHP_INI_SYSTEM, OnUpdateLong, default_prefetch, zend_oci_globals, oci_globals) - STD_PHP_INI_BOOLEAN("oci8.old_oci_close_semantics", "0", PHP_INI_SYSTEM, OnUpdateOldCloseSemantics, old_oci_close_semantics,zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY( "oci8.connection_class", "", PHP_INI_ALL, OnUpdateString, connection_class, zend_oci_globals, oci_globals) - STD_PHP_INI_BOOLEAN("oci8.events", "0", PHP_INI_SYSTEM, OnUpdateBool, events, zend_oci_globals, oci_globals) - STD_PHP_INI_ENTRY( "oci8.prefetch_lob_size", "0", PHP_INI_SYSTEM, OnUpdateLong, prefetch_lob_size, zend_oci_globals, oci_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ startup, shutdown and info functions */ - -/* {{{ php_oci_init_global_handles() - * - * Initialize global handles only when they are needed - */ -static void php_oci_init_global_handles(void) -{ - sword errstatus; - sb4 ora_error_code = 0; - text tmp_buf[PHP_OCI_ERRBUF_LEN]; /* Use traditional smaller size: non-PL/SQL errors should fit and it keeps the stack smaller */ - - errstatus = OCIEnvNlsCreate(&OCI_G(env), PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, 0, 0); - - if (errstatus == OCI_ERROR) { -#ifdef HAVE_OCI_INSTANT_CLIENT - php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries"); -#else - php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories"); -#endif - if (OCI_G(env) - && OCIErrorGet(OCI_G(env), (ub4)1, NULL, &ora_error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ENV) == OCI_SUCCESS - && *tmp_buf) { - php_error_docref(NULL, E_WARNING, "%s", tmp_buf); - } - - OCI_G(env) = NULL; - OCI_G(err) = NULL; - return; - } - - errstatus = OCIHandleAlloc (OCI_G(env), (dvoid **)&OCI_G(err), OCI_HTYPE_ERROR, 0, NULL); - - if (errstatus != OCI_SUCCESS) { - OCIErrorGet(OCI_G(env), (ub4)1, NULL, &ora_error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ERROR); - - if (ora_error_code) { - int tmp_buf_len = (int) strlen((char *)tmp_buf); - - if (tmp_buf_len > 0 && tmp_buf[tmp_buf_len - 1] == '\n') { - tmp_buf[tmp_buf_len - 1] = '\0'; - } - - if (errstatus == OCI_SUCCESS_WITH_INFO) { - php_error_docref(NULL, E_WARNING, "Initialization error: OCI_SUCCESS_WITH_INFO: %s", tmp_buf); - } else { - php_error_docref(NULL, E_WARNING, "Initialization error: OCI_ERROR: %s", tmp_buf); - - OCIHandleFree((dvoid *) OCI_G(env), OCI_HTYPE_ENV); - - OCI_G(env) = NULL; - OCI_G(err) = NULL; - } - } - } -} -/* }}} */ - -/* {{{ PHP_GINIT_FUNCTION - * - * Zerofill globals during module init - */ -static PHP_GINIT_FUNCTION(oci) -{ - memset(oci_globals, 0, sizeof(zend_oci_globals)); -} -/* }}} */ - -/* {{{ PHP_GSHUTDOWN_FUNCTION - * - * Called for thread shutdown in ZTS, after module shutdown for non-ZTS - * Free global handles (if they were initialized before) - */ -static PHP_GSHUTDOWN_FUNCTION(oci) -{ - if (oci_globals->err) { - oci_globals->in_call = 1; - OCIHandleFree((dvoid *) oci_globals->err, OCI_HTYPE_ERROR); - oci_globals->in_call = 0; - oci_globals->err = NULL; - } - - if (oci_globals->env) { - oci_globals->in_call = 1; - OCIHandleFree((dvoid *) oci_globals->env, OCI_HTYPE_ENV); - oci_globals->in_call = 0; - oci_globals->env = NULL; - } -} -/* }}} */ - -PHP_MINIT_FUNCTION(oci) -{ - REGISTER_INI_ENTRIES(); - - le_statement = zend_register_list_destructors_ex(php_oci_statement_list_dtor, NULL, "oci8 statement", module_number); - le_connection = zend_register_list_destructors_ex(php_oci_connection_list_dtor, NULL, "oci8 connection", module_number); - le_pconnection = zend_register_list_destructors_ex(php_oci_pconnection_list_np_dtor, php_oci_pconnection_list_dtor, "oci8 persistent connection", module_number); - le_psessionpool = zend_register_list_destructors_ex(NULL, php_oci_spool_list_dtor, "oci8 persistent session pool", module_number); - le_descriptor = zend_register_list_destructors_ex(php_oci_descriptor_list_dtor, NULL, "oci8 descriptor", module_number); - le_collection = zend_register_list_destructors_ex(php_oci_collection_list_dtor, NULL, "oci8 collection", module_number); - - oci_lob_class_entry_ptr = register_class_OCILob(); - oci_coll_class_entry_ptr = register_class_OCICollection(); - - register_oci8_symbols(module_number); - - return SUCCESS; -} - -PHP_RINIT_FUNCTION(oci) -{ - OCI_G(num_links) = OCI_G(num_persistent); - OCI_G(errcode) = 0; - OCI_G(edition) = NULL; - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(oci) -{ - OCI_G(shutdown) = 1; - - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(oci) -{ - /* Check persistent connections and do the necessary actions if needed. If persistent_helper is - * unable to process a pconnection because of a refcount, the processing would happen from - * np-destructor which is called when refcount goes to zero - php_oci_pconnection_list_np_dtor - */ - zend_hash_apply(&EG(persistent_list), php_oci_persistent_helper); - - if (OCI_G(edition)) { - efree(OCI_G(edition)); - } - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(oci) -{ - char buf[32]; - char ver[256]; - - php_info_print_table_start(); - php_info_print_table_row(2, "OCI8 Support", "enabled"); -#if defined(HAVE_OCI8_DTRACE) - php_info_print_table_row(2, "OCI8 DTrace Support", "enabled"); -#else - php_info_print_table_row(2, "OCI8 DTrace Support", "disabled"); -#endif - php_info_print_table_row(2, "OCI8 Version", PHP_OCI8_VERSION); - - php_oci_client_get_version(ver, sizeof(ver)); - php_info_print_table_row(2, "Oracle Run-time Client Library Version", ver); - snprintf(buf, sizeof(buf), "%d.%d", OCI_MAJOR_VERSION, OCI_MINOR_VERSION); -#if defined(HAVE_OCI_INSTANT_CLIENT) - php_info_print_table_row(2, "Oracle Compile-time Instant Client Version", buf); -#else - php_info_print_table_row(2, "Oracle Compile-time Version", buf); -#endif - -#if !defined(PHP_WIN32) && !defined(HAVE_OCI_INSTANT_CLIENT) -#if defined(PHP_OCI8_DEF_DIR) - php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DEF_DIR); -#endif -#if defined(PHP_OCI8_DEF_SHARED_LIBADD) - php_info_print_table_row(2, "Libraries Used", PHP_OCI8_DEF_SHARED_LIBADD); -#endif -#endif - - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - - php_info_print_table_start(); - php_info_print_table_header(2, "Statistics", ""); - snprintf(buf, sizeof(buf), ZEND_LONG_FMT, OCI_G(num_persistent)); - php_info_print_table_row(2, "Active Persistent Connections", buf); - snprintf(buf, sizeof(buf), ZEND_LONG_FMT, OCI_G(num_links)); - php_info_print_table_row(2, "Active Connections", buf); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ list destructors */ - -/* {{{ php_oci_connection_list_dtor() - * - * Non-persistent connection destructor - */ -static void php_oci_connection_list_dtor(zend_resource *entry) -{ - php_oci_connection *connection = (php_oci_connection *)entry->ptr; - - if (connection) { - php_oci_connection_close(connection); - OCI_G(num_links)--; - } -} -/* }}} */ - -/* {{{ php_oci_pconnection_list_dtor() - * - * Persistent connection destructor - */ -static void php_oci_pconnection_list_dtor(zend_resource *entry) -{ - php_oci_connection *connection = (php_oci_connection *)entry->ptr; - - if (connection) { - php_oci_connection_close(connection); - OCI_G(num_persistent)--; - OCI_G(num_links)--; - } -} -/* }}} */ - -/* {{{ php_oci_pconnection_list_np_dtor() - * - * Non-Persistent destructor for persistent connection - This gets invoked when - * the refcount of this goes to zero in the regular list - */ -static void php_oci_pconnection_list_np_dtor(zend_resource *entry) -{ - php_oci_connection *connection = (php_oci_connection *)entry->ptr; - zval *zvp; - zend_resource *le; - - /* - * We cannot get connection as NULL or as a stub in this function. This is the function that - * turns a pconnection to a stub - * - * If oci_password_change() changed the password of a persistent connection, close the - * connection and remove it from the persistent connection cache. This means subsequent scripts - * will be prevented from being able to present the old (now invalid) password to a usable - * connection to the database; they must use the new password. - * - * Check for conditions that warrant removal of the hash entry - */ - - if (!connection->is_open || - connection->passwd_changed || - (PG(connection_status) & PHP_CONNECTION_TIMEOUT) || - OCI_G(in_call)) { - - /* Remove the hash entry if present */ - if (connection->hash_key) { - zvp = zend_hash_find(&EG(persistent_list), connection->hash_key); - le = zvp ? Z_RES_P(zvp) : NULL; - if (le != NULL && le->type == le_pconnection && le->ptr == connection) { - zend_hash_del(&EG(persistent_list), connection->hash_key); - } - else { - php_oci_connection_close(connection); - OCI_G(num_persistent)--; - } - } - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_P_DTOR_CLOSE_ENABLED()) { - DTRACE_OCI8_CONNECT_P_DTOR_CLOSE(connection); - } -#endif /* HAVE_OCI8_DTRACE */ - } else { - /* - * Release the connection to underlying pool. We do this unconditionally so that - * out-of-scope pconnects are now consistent with oci_close and out-of-scope new connect - * semantics. With the PECL OCI 1.3.x extensions, we release pconnections when oci_close - * takes the refcount to zero. - * - * If oci_old_close_semantics is set, we artificially bump up the refcount and decremented - * only at request shutdown. - */ - php_oci_connection_release(connection); - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_P_DTOR_RELEASE_ENABLED()) { - DTRACE_OCI8_CONNECT_P_DTOR_RELEASE(connection); - } -#endif /* HAVE_OCI8_DTRACE */ - } -} -/* }}} */ - -/* {{{ php_oci_statement_list_dtor() - * - * Statement destructor - */ -static void php_oci_statement_list_dtor(zend_resource *entry) -{ - php_oci_statement *statement = (php_oci_statement *)entry->ptr; - php_oci_statement_free(statement); -} -/* }}} */ - -/* {{{ php_oci_descriptor_list_dtor() - * - * Descriptor destructor - */ -static void php_oci_descriptor_list_dtor(zend_resource *entry) -{ - php_oci_descriptor *descriptor = (php_oci_descriptor *)entry->ptr; - php_oci_lob_free(descriptor); -} -/* }}} */ - -/* {{{ php_oci_collection_list_dtor() - * - * Collection destructor - */ -static void php_oci_collection_list_dtor(zend_resource *entry) -{ - php_oci_collection *collection = (php_oci_collection *)entry->ptr; - php_oci_collection_close(collection); -} -/* }}} */ - -/* }}} */ - -/* {{{ Hash Destructors */ - -/* {{{ php_oci_define_hash_dtor() - * - * Define hash destructor - */ -void php_oci_define_hash_dtor(zval *data) -{ - php_oci_define *define = (php_oci_define *) Z_PTR_P(data); - - if (define->name) { - efree(define->name); - define->name = NULL; - } - - zval_ptr_dtor(&define->val); - - efree(define); -} -/* }}} */ - -/* {{{ php_oci_bind_hash_dtor() - * - * Bind hash destructor - */ -void php_oci_bind_hash_dtor(zval *data) -{ - php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data); - - if (!Z_ISUNDEF(bind->val)) { - zval_ptr_dtor(&bind->val); - ZVAL_UNDEF(&bind->val); - } - - if (bind->array.elements) { - efree(bind->array.elements); - bind->array.elements = NULL; - } - - if (bind->array.element_lengths) { - efree(bind->array.element_lengths); - bind->array.element_lengths = NULL; - } - - if (bind->array.indicators) { - efree(bind->array.indicators); - bind->array.indicators = NULL; - } - - efree(bind); -} -/* }}} */ - -/* {{{ php_oci_column_hash_dtor() - * - * Column hash destructor - */ -void php_oci_column_hash_dtor(zval *data) -{ - php_oci_out_column *column = (php_oci_out_column *) Z_PTR_P(data); - - if (column->stmtid) { - zend_list_close(column->stmtid); - } - - if (column->descid) { - if (GC_REFCOUNT(column->descid) == 1) - zend_list_close(column->descid); - else { - GC_DELREF(column->descid); - } - } - - if (column->data) { - efree(column->data); - } - - if (column->name) { - efree(column->name); - } - - efree(column); -} -/* }}} */ - -/* {{{ php_oci_descriptor_flush_hash_dtor() - * - * Flush descriptors on commit - */ -void php_oci_descriptor_flush_hash_dtor(zval *data) -{ - php_oci_descriptor *descriptor = (php_oci_descriptor *) Z_PTR_P(data); - - if (descriptor && descriptor->buffering == PHP_OCI_LOB_BUFFER_USED && (descriptor->type == OCI_DTYPE_LOB || descriptor->type == OCI_DTYPE_FILE)) { - php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE); - descriptor->buffering = PHP_OCI_LOB_BUFFER_ENABLED; - } - data = NULL; -} -/* }}} */ - -/* }}} */ - -/* {{{ php_oci_connection_descriptors_free() - * - * Free descriptors for a connection - */ -void php_oci_connection_descriptors_free(php_oci_connection *connection) -{ - zend_hash_destroy(connection->descriptors); - efree(connection->descriptors); - connection->descriptors = NULL; - connection->descriptor_count = 0; -} -/* }}} */ - -/* {{{ php_oci_error() - * - * Fetch & print out error message if we get an error - * Returns an Oracle error number - */ -sb4 php_oci_error(OCIError *err_p, sword errstatus) -{ - text errbuf[PHP_OCI_ERRBUF_LEN]; - sb4 errcode = 0; /* Oracle error number */ - - switch (errstatus) { - case OCI_SUCCESS: - break; - case OCI_SUCCESS_WITH_INFO: - errcode = php_oci_fetch_errmsg(err_p, errbuf, sizeof(errbuf)); - if (errcode) { - php_error_docref(NULL, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", errbuf); - } else { - php_error_docref(NULL, E_WARNING, "OCI_SUCCESS_WITH_INFO: failed to fetch error message"); - } - break; - case OCI_NEED_DATA: - php_error_docref(NULL, E_WARNING, "OCI_NEED_DATA"); - break; - case OCI_NO_DATA: - errcode = php_oci_fetch_errmsg(err_p, errbuf, sizeof(errbuf)); - if (errcode) { - php_error_docref(NULL, E_WARNING, "%s", errbuf); - } else { - php_error_docref(NULL, E_WARNING, "OCI_NO_DATA: failed to fetch error message"); - } - break; - case OCI_ERROR: - errcode = php_oci_fetch_errmsg(err_p, errbuf, sizeof(errbuf)); - if (errcode) { - php_error_docref(NULL, E_WARNING, "%s", errbuf); - } else { - php_error_docref(NULL, E_WARNING, "Failed to fetch error message"); - } - break; - case OCI_INVALID_HANDLE: - php_error_docref(NULL, E_WARNING, "OCI_INVALID_HANDLE"); - break; - case OCI_STILL_EXECUTING: - php_error_docref(NULL, E_WARNING, "OCI_STILL_EXECUTING"); - break; - case OCI_CONTINUE: - php_error_docref(NULL, E_WARNING, "OCI_CONTINUE"); - break; - default: - php_error_docref(NULL, E_WARNING, "Unknown OCI error code: %d", errstatus); - break; - } - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_ERROR_ENABLED()) { - DTRACE_OCI8_ERROR((int)errstatus, (long)errcode); - } -#endif /* HAVE_OCI8_DTRACE */ - - return errcode; -} -/* }}} */ - -/* {{{ php_oci_fetch_errmsg() - * - * Fetch error message into the buffer from the error handle provided - */ -sb4 php_oci_fetch_errmsg(OCIError *error_handle, text *error_buf, size_t error_buf_size) -{ - sb4 error_code = 0; - - PHP_OCI_CALL(OCIErrorGet, (error_handle, (ub4)1, NULL, &error_code, error_buf, (ub4)error_buf_size, (ub4)OCI_HTYPE_ERROR)); - - if (error_code) { - int err_buf_len = (int) strlen((char *)error_buf); - - if (err_buf_len && error_buf[err_buf_len - 1] == '\n') { - error_buf[err_buf_len - 1] = '\0'; - } - } - return error_code; -} -/* }}} */ - -/* {{{ php_oci_fetch_sqltext_offset() - * - * Compute offset in the SQL statement - */ -int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset) -{ - sword errstatus; - - *sqltext = NULL; - *error_offset = 0; - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, statement->err)); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)error_offset, (ub4 *)0, OCI_ATTR_PARSE_ERROR_OFFSET, statement->err)); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - return 0; -} -/* }}} */ - -/* {{{ php_oci_do_connect() - * - * Connect wrapper - */ -void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclusive) -{ - php_oci_connection *connection; - char *username, *password; - char *dbname = NULL, *charset = NULL; - size_t username_len = 0, password_len = 0; - size_t dbname_len = 0, charset_len = 0; - zend_long session_mode = OCI_DEFAULT; - - /* if a fourth parameter is handed over, it is the charset identifier (but is only used in Oracle 9i+) */ - ZEND_PARSE_PARAMETERS_START(2, 5) - Z_PARAM_STRING(username, username_len) - Z_PARAM_STRING(password, password_len) - Z_PARAM_OPTIONAL - Z_PARAM_STRING_OR_NULL(dbname, dbname_len) - Z_PARAM_STRING(charset, charset_len) - Z_PARAM_LONG(session_mode) - ZEND_PARSE_PARAMETERS_END(); - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_ENTRY_ENABLED()) { - DTRACE_OCI8_CONNECT_ENTRY(username, dbname, charset, session_mode, persistent, exclusive); - } -#endif /* HAVE_OCI8_DTRACE */ - - if (!charset_len) { - charset = NULL; - } - - connection = php_oci_do_connect_ex(username, (int) username_len, password, (int) password_len, NULL, 0, dbname, (int) dbname_len, charset, session_mode, persistent, exclusive); - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_RETURN_ENABLED()) { - DTRACE_OCI8_CONNECT_RETURN(connection); - } -#endif /* HAVE_OCI8_DTRACE */ - - - if (!connection) { - RETURN_FALSE; - } - RETURN_RES(connection->id); - -} -/* }}} */ - -/* {{{ php_oci_do_connect_ex() - * - * The real connect function. Allocates all the resources needed, establishes the connection and - * returns the result handle (or NULL) - */ -php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive) -{ - zval *zvp; - zend_resource *le = NULL; - zend_resource new_le; - php_oci_connection *connection = NULL; - smart_str hashed_details = {0}; - time_t timestamp; - php_oci_spool *session_pool = NULL; - bool use_spool = 1; /* Default is to use client-side session pool */ - bool ping_done = 0; - - ub2 charsetid = 0; - ub2 charsetid_nls_lang = 0; - - if (session_mode & ~(OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) { - php_error_docref(NULL, E_WARNING, "Invalid session mode specified (" ZEND_LONG_FMT ")", session_mode); - return NULL; - } - if (session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) { - if ((session_mode & OCI_SYSOPER) && (session_mode & OCI_SYSDBA)) { - php_error_docref(NULL, E_WARNING, "OCI_SYSDBA and OCI_SYSOPER cannot be used together"); - return NULL; - } - if (session_mode & PHP_OCI_CRED_EXT) { -#ifdef PHP_WIN32 - /* Disable external authentication on Windows as Impersonation is not yet handled. - * TODO: Re-enable this once OCI provides capability. - */ - php_error_docref(NULL, E_WARNING, "External Authentication is not supported on Windows"); - return NULL; -#endif - if (username_len != 1 || username[0] != '/' || password_len != 0) { - php_error_docref(NULL, E_WARNING, "OCI_CRED_EXT can only be used with a username of \"/\" and a NULL password"); - return NULL; - } - } - if (session_mode & (OCI_SYSOPER | OCI_SYSDBA)) { - /* Increase security by not caching privileged oci_pconnect() connections. The - * connection becomes equivalent to oci_connect() or oci_new_connect(). - */ - persistent = 0; - if (!OCI_G(privileged_connect)) { - php_error_docref(NULL, E_WARNING, "Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA"); - return NULL; - } - } - } - - /* Initialize global handles if they weren't initialized before */ - if (OCI_G(env) == NULL) { - php_oci_init_global_handles(); - if (OCI_G(env) == NULL) { - return NULL; - } - } - - /* We cannot use the new session create logic (OCISessionGet from - * client-side session pool) when privileged connect or password - * change is attempted or OCI_CRED_EXT mode is specified. - * TODO: Re-enable this when OCI provides support. - */ - if ((session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) || (new_password_len)) { - use_spool = 0; - } - - smart_str_appendl_ex(&hashed_details, "oci8***", sizeof("oci8***") - 1, 0); - smart_str_appendl_ex(&hashed_details, username, username_len, 0); - smart_str_appendl_ex(&hashed_details, "**", sizeof("**") - 1, 0); - - /* DRCP: connection_class is an attribute of a connection */ - if (OCI_G(connection_class)){ - smart_str_appendl_ex(&hashed_details, OCI_G(connection_class), strlen(OCI_G(connection_class)), 0); - } - smart_str_appendl_ex(&hashed_details, "**", sizeof("**") - 1, 0); - - /* Add edition attribute to the hash */ - if (OCI_G(edition)){ - smart_str_appendl_ex(&hashed_details, OCI_G(edition), strlen(OCI_G(edition)), 0); - } - smart_str_appendl_ex(&hashed_details, "**", sizeof("**") - 1, 0); - - if (password_len) { - zend_ulong password_hash; - password_hash = zend_hash_func(password, password_len); - smart_str_append_unsigned_ex(&hashed_details, password_hash, 0); - } - smart_str_appendl_ex(&hashed_details, "**", sizeof("**") - 1, 0); - - if (dbname) { - smart_str_appendl_ex(&hashed_details, dbname, dbname_len, 0); - } - smart_str_appendl_ex(&hashed_details, "**", sizeof("**") - 1, 0); - - if (charset && *charset) { - PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, (OCI_G(env), (CONST oratext *)charset)); - if (!charsetid) { - php_error_docref(NULL, E_WARNING, "Invalid character set name: %s", charset); - } else { - smart_str_append_unsigned_ex(&hashed_details, charsetid, 0); - } - } - - /* use NLS_LANG if no or invalid charset specified */ - if (!charsetid) { - size_t rsize = 0; - sword result; - - PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize)); - if (result != OCI_SUCCESS) { - charsetid_nls_lang = 0; - } - smart_str_append_unsigned_ex(&hashed_details, charsetid_nls_lang, 0); - } - - timestamp = time(NULL); - - smart_str_append_unsigned_ex(&hashed_details, session_mode, 0); - if (persistent) { - smart_str_appendl_ex(&hashed_details, "pc", sizeof("pc") - 1, 0); - } - - smart_str_0(&hashed_details); - - /* make it lowercase */ - zend_str_tolower(ZSTR_VAL(hashed_details.s), ZSTR_LEN(hashed_details.s)); - - if (!exclusive && !new_password) { - bool found = 0; - - if (persistent && ((zvp = zend_hash_find(&EG(persistent_list), hashed_details.s))) != NULL) { - zend_resource *le = Z_RES_P(zvp); - - found = 1; - /* found */ - if (le->type == le_pconnection) { - connection = (php_oci_connection *)le->ptr; - } - } else if (!persistent && ((zvp = zend_hash_find(&EG(regular_list), hashed_details.s)) != NULL)) { - le = Z_RES_P(zvp); - found = 1; - if (le->type == le_index_ptr) { - zend_resource *ptr; - - ptr = (zend_resource *) le->ptr; - if (ptr && (ptr->type == le_connection)) { - connection = (php_oci_connection *)ptr->ptr; - } - } - } - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_LOOKUP_ENABLED()) { - DTRACE_OCI8_CONNECT_LOOKUP(connection, connection && connection->is_stub ? 1 : 0); - } -#endif /* HAVE_OCI8_DTRACE */ - - /* If we got a pconnection stub, then 'load'(OCISessionGet) the real connection from its - * private spool A connection is a stub if it is only a cached structure and the real - * connection is released to its underlying private session pool. We currently do not have - * stub support for non-persistent conns. - * - * TODO: put in negative code for non-persistent stubs - */ - if (connection && connection->is_persistent && connection->is_stub) { - if (php_oci_create_session(connection, NULL, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, (int) session_mode)) { - smart_str_free(&hashed_details); - zend_hash_del(&EG(persistent_list), connection->hash_key); - - return NULL; - } - /* We do the ping in php_oci_create_session, no need to ping again below */ - ping_done = 1; - } - - if (connection) { - if (connection->is_open) { - /* found an open connection. now ping it */ - if (connection->is_persistent) { - - /* Check connection liveness in the following order: - * 1) always check OCI_ATTR_SERVER_STATUS - * 2) see if it's time to ping it - * 3) ping it if needed - */ - if (php_oci_connection_status(connection)) { - /* Only ping if: - * - * 1) next_ping > 0, which means that ping_interval is not -1 (aka "Off") - * - * 2) current_timestamp > next_ping, which means "it's time to check if it's - * still alive" - */ - if (!ping_done && (*(connection->next_pingp) > 0) && (timestamp >= *(connection->next_pingp)) && !php_oci_connection_ping(connection)) { - /* server died */ - } else { - php_oci_connection *tmp = (php_oci_connection *) NULL; - zval *tmp_val = (zval *) NULL; - - /* okay, the connection is open and the server is still alive */ - connection->used_this_request = 1; - if (connection->id) { - tmp_val = zend_hash_index_find(&EG(regular_list), connection->id->handle); - if ((tmp_val != NULL) && (Z_TYPE_P(tmp_val) == IS_RESOURCE)) { - tmp = Z_RES_VAL_P(tmp_val); - } - - if ((tmp_val != NULL) && (tmp != NULL) && - zend_string_equals(tmp->hash_key, hashed_details.s)) { - connection = tmp; - GC_ADDREF(connection->id); - } - } else { - PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection); - /* Persistent connections: For old close semantics we artificially - * bump up the refcount to prevent the non-persistent destructor - * from getting called until request shutdown. The refcount is - * decremented in the persistent helper - */ - if (OCI_G(old_oci_close_semantics)) { - GC_ADDREF(connection->id); - } - } - smart_str_free(&hashed_details); - return connection; - } - } - /* server died */ - } else { - /* we do not ping non-persistent connections */ - smart_str_free(&hashed_details); - GC_ADDREF(connection->id); - return connection; - } - } /* is_open is true? */ - - /* Server died - connection not usable. The is_open=true can also fall through to here, - * if ping fails - */ - if (persistent){ - - connection->is_open = 0; - connection->used_this_request = 1; - - /* We have to do a hash_del but need to preserve the resource if there is a positive - * refcount. Set the data pointer in the list entry to NULL - */ - if (connection == connection->id->ptr && le) { - le->ptr = NULL; - } - - zend_hash_del(&EG(persistent_list), hashed_details.s); - } else { - /* We only remove the hash entry. The resource and the list entry with its pointer - * to the resource are still intact - */ - zend_hash_del(&EG(regular_list), hashed_details.s); - } - - connection = NULL; - } else if (found) { - /* found something, but it's not a connection, delete it */ - if (persistent) { - zend_hash_del(&EG(persistent_list), hashed_details.s); - } else { - zend_hash_del(&EG(regular_list), hashed_details.s); - } - } - } - - /* Check if we have reached max_persistent. If so, try to remove a few timed-out connections. As - * a last resort, return a non-persistent connection. - */ - if (persistent) { - bool alloc_non_persistent = 0; - - if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) { - /* try to find an idle connection and kill it */ - zend_hash_apply(&EG(persistent_list), php_oci_persistent_helper); - - if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) { - /* all persistent connactions are in use, fallback to non-persistent connection creation */ - php_error_docref(NULL, E_NOTICE, "Too many open persistent connections (" ZEND_LONG_FMT ")", OCI_G(num_persistent)); - alloc_non_persistent = 1; - } - } - - if (alloc_non_persistent) { - connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection)); - connection->hash_key = zend_string_dup(hashed_details.s, 0); - connection->is_persistent = 0; - ZVAL_UNDEF(&connection->taf_callback); -#ifdef HAVE_OCI8_DTRACE - connection->client_id = NULL; -#endif - } else { - connection = (php_oci_connection *) calloc(1, sizeof(php_oci_connection)); - if (connection == NULL) { - return NULL; - } - connection->hash_key = zend_string_dup(hashed_details.s, 1); - if (connection->hash_key == NULL) { - free(connection); - return NULL; - } - connection->is_persistent = 1; - ZVAL_UNDEF(&connection->taf_callback); -#ifdef HAVE_OCI8_DTRACE - connection->client_id = NULL; -#endif - } - } else { - connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection)); - connection->hash_key = zend_string_dup(hashed_details.s, 0); - connection->is_persistent = 0; - ZVAL_UNDEF(&connection->taf_callback); -#ifdef HAVE_OCI8_DTRACE - connection->client_id = NULL; -#endif - } - - /* {{{ Get the session pool that suits this connection request from the persistent list. This - * step is only for non-persistent connections as persistent connections have private session - * pools. Non-persistent conns use shared session pool to allow for optimizations such as - * caching the physical connection (for DRCP) even when the non-persistent php connection is - * destroyed. - * - * TODO: Unconditionally do this once OCI provides extended OCISessionGet capability - */ - if (use_spool && !connection->is_persistent) { - if ((session_pool = php_oci_get_spool(username, username_len, password, password_len, dbname, dbname_len, charsetid ? charsetid:charsetid_nls_lang))==NULL) - { - php_oci_connection_close(connection); - smart_str_free(&hashed_details); - return NULL; - } - } - /* }}} */ - - connection->idle_expiry = (OCI_G(persistent_timeout) > 0) ? (timestamp + OCI_G(persistent_timeout)) : 0; - - /* Mark password as unchanged by PHP during the duration of the database session */ - connection->passwd_changed = 0; - - smart_str_free(&hashed_details); - - if (charsetid) { - connection->charset = charsetid; - } else { - connection->charset = charsetid_nls_lang; - } - - /* Old session creation semantics when session pool cannot be used Eg: privileged - * connect/password change - */ - if (!use_spool) { - if (php_oci_old_create_session(connection, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, (int) session_mode)) { - php_oci_connection_close(connection); - return NULL; - } - } else { - /* create using the client-side session pool */ - if (php_oci_create_session(connection, session_pool, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, (int) session_mode)) { - php_oci_connection_close(connection); - return NULL; - } - } - - /* Mark it as open */ - connection->is_open = 1; - - /* add to the appropriate hash */ - if (connection->is_persistent) { - connection->used_this_request = 1; - PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection); - - /* Persistent connections: For old close semantics we artificially bump up the refcount to - * prevent the non-persistent destructor from getting called until request shutdown. The - * refcount is decremented in the persistent helper - */ - if (OCI_G(old_oci_close_semantics)) { - GC_ADDREF(connection->id); - } - zend_register_persistent_resource_ex(connection->hash_key, connection, le_pconnection); - OCI_G(num_persistent)++; - OCI_G(num_links)++; - } else if (!exclusive) { - PHP_OCI_REGISTER_RESOURCE(connection, le_connection); - new_le.ptr = connection->id; - new_le.type = le_index_ptr; - zend_hash_update_mem(&EG(regular_list), connection->hash_key, (void *)&new_le, sizeof(zend_resource)); - OCI_G(num_links)++; - } else { - PHP_OCI_REGISTER_RESOURCE(connection, le_connection); - OCI_G(num_links)++; - } - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_TYPE_ENABLED()) { - DTRACE_OCI8_CONNECT_TYPE(connection->is_persistent ? 1 : 0, exclusive ? 1 : 0, connection, OCI_G(num_persistent), OCI_G(num_links)); - } -#endif /* HAVE_OCI8_DTRACE */ - - return connection; -} -/* }}} */ - -/* {{{ php_oci_connection_ping() - * - * Ping connection. Uses OCIPing() or OCIServerVersion() depending on the Oracle Client version - */ -static int php_oci_connection_ping(php_oci_connection *connection) -{ - sword errstatus; - - OCI_G(errcode) = 0; /* assume ping is successful */ - - /* If OCIPing returns ORA-1010 (invalid OCI operation) such as from - * pre-10.1 servers, the error is still from the server and we would have - * successfully performed a roundtrip and validated the connection. - */ - PHP_OCI_CALL_RETURN(errstatus, OCIPing, (connection->svc, OCI_G(err), OCI_DEFAULT)); - - if (errstatus == OCI_SUCCESS) { - return 1; - } else { - sb4 error_code = 0; - text tmp_buf[PHP_OCI_ERRBUF_LEN]; - - /* Treat ORA-1010 as a successful Ping */ - OCIErrorGet(OCI_G(err), (ub4)1, NULL, &error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ERROR); - if (error_code == 1010) { - return 1; - } - OCI_G(errcode) = error_code; - } - - return 0; -} -/* }}} */ - -/* {{{ php_oci_connection_status() - * - * Check connection status (pre-ping check) - */ -static int php_oci_connection_status(php_oci_connection *connection) -{ - ub4 ss = OCI_SERVER_NOT_CONNECTED; - sword errstatus; - - /* get OCI_ATTR_SERVER_STATUS */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)connection->server, OCI_HTYPE_SERVER, (dvoid *)&ss, (ub4 *)0, OCI_ATTR_SERVER_STATUS, OCI_G(err))); - - if (errstatus == OCI_SUCCESS && ss == OCI_SERVER_NORMAL) { - return 1; - } - - /* ignore errors here, just return failure */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_connection_rollback() - * - * Rollback connection - */ -int php_oci_connection_rollback(php_oci_connection *connection) -{ - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCITransRollback, (connection->svc, connection->err, (ub4) 0)); - connection->rb_on_disconnect = 0; - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_connection_commit() - * - * Commit connection - */ -int php_oci_connection_commit(php_oci_connection *connection) -{ - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCITransCommit, (connection->svc, connection->err, (ub4) 0)); - connection->rb_on_disconnect = 0; - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_connection_close() - * - * Close the connection and free all its resources - */ -static int php_oci_connection_close(php_oci_connection *connection) -{ - int result = 0; - bool in_call_save = OCI_G(in_call); - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECTION_CLOSE_ENABLED()) { - DTRACE_OCI8_CONNECTION_CLOSE(connection); - } -#endif /* HAVE_OCI8_DTRACE */ - - if (!connection->is_stub) { - /* Release resources associated with connection */ - php_oci_connection_release(connection); - } - - if (!connection->using_spool && connection->svc) { - PHP_OCI_CALL(OCISessionEnd, (connection->svc, connection->err, connection->session, (ub4) 0)); - } - - if (connection->err) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->err, (ub4) OCI_HTYPE_ERROR)); - } - if (connection->authinfo) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->authinfo, (ub4) OCI_HTYPE_AUTHINFO)); - } - - /* No Handlefrees for session pool connections */ - if (!connection->using_spool) { - if (connection->session) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->session, OCI_HTYPE_SESSION)); - } - - if (connection->is_attached) { - PHP_OCI_CALL(OCIServerDetach, (connection->server, OCI_G(err), OCI_DEFAULT)); - } - - if (connection->svc) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX)); - } - - if (connection->server) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->server, (ub4) OCI_HTYPE_SERVER)); - } - - if (connection->env) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->env, OCI_HTYPE_ENV)); - } - } else if (connection->private_spool) { - /* Keep this as the last member to be freed, as there are dependencies - * (like env) on the session pool - */ - php_oci_spool_close(connection->private_spool); - connection->private_spool = NULL; - } - - if (GC_REFCOUNT(connection->hash_key) >= 2) { - zend_hash_del(&EG(regular_list), connection->hash_key); - } - - if (connection->hash_key) { - pefree(connection->hash_key, connection->is_persistent); - connection->hash_key = NULL; - } -#ifdef HAVE_OCI8_DTRACE - if (connection->client_id) { - pefree(connection->client_id, connection->is_persistent); - connection->client_id = NULL; - } -#endif /* HAVE_OCI8_DTRACE */ - - if (!Z_ISUNDEF(connection->taf_callback)) { - /* If it's NULL, then its value should be freed already */ - if (!Z_ISNULL(connection->taf_callback)) { - zval_ptr_dtor(&connection->taf_callback); - } - ZVAL_UNDEF(&connection->taf_callback); - } - - pefree(connection, connection->is_persistent); - connection = NULL; - OCI_G(in_call) = in_call_save; - return result; -} -/* }}} */ - -/* {{{ php_oci_connection_release() - * - * Release the connection's resources. This involves freeing descriptors and rolling back - * transactions, setting timeout-related parameters etc. For session-pool using connections, the - * underlying connection is released to its session pool. - */ -int php_oci_connection_release(php_oci_connection *connection) -{ - int result = 0; - bool in_call_save = OCI_G(in_call); - time_t timestamp = time(NULL); - - if (connection->is_stub) { - return 0; - } - - if (connection->descriptors) { - php_oci_connection_descriptors_free(connection); - } - - if (connection->svc) { - /* rollback outstanding transactions */ - if (connection->rb_on_disconnect) { - if (php_oci_connection_rollback(connection)) { - /* rollback failed */ - result = 1; - } - } - } - - if (OCI_G(persistent_timeout) > 0) { - connection->idle_expiry = timestamp + OCI_G(persistent_timeout); - } - - /* We may have half-cooked connections to clean up */ - if (connection->next_pingp) { - if (OCI_G(ping_interval) >= 0) { - *(connection->next_pingp) = timestamp + OCI_G(ping_interval); - } else { - /* ping_interval is -1 */ - *(connection->next_pingp) = 0; - } - } - - /* Release the session (stubs are filtered out at the beginning)*/ - if (connection->using_spool) { - ub4 rlsMode = OCI_DEFAULT; - - if (result) { - rlsMode |= OCI_SESSRLS_DROPSESS; - } - - if (connection->svc) { - PHP_OCI_CALL(OCISessionRelease, (connection->svc, connection->err, NULL, - 0, rlsMode)); - } - /* It no longer has relation with the database session. However authinfo and env are - * cached - */ - connection->svc = NULL; - connection->server = NULL; - connection->session = NULL; - - connection->is_attached = connection->is_open = connection->rb_on_disconnect = connection->used_this_request = 0; - connection->is_stub = 1; - - /* Cut the link between the connection structure and the time_t structure allocated within - * the OCI session - */ - connection->next_pingp = NULL; -#ifdef HAVE_OCI8_DTRACE - if (connection->client_id) { - pefree(connection->client_id, connection->is_persistent); - connection->client_id = NULL; - } -#endif /* HAVE_OCI8_DTRACE */ - } - - /* Always set id to null, so next time a new resource is being registered. */ - connection->id = NULL; - - OCI_G(in_call) = in_call_save; - return result; -} -/* }}} */ - -/* {{{ php_oci_password_change() - * - * Change password for the user with the username given - */ -int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len) -{ - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - connection->passwd_changed = 1; - return 0; -} -/* }}} */ - -/* {{{ php_oci_client_get_version() - * - * Get Oracle client library version - */ -void php_oci_client_get_version(char *version, size_t version_size) -{ - sword major_version = 0; - sword minor_version = 0; - sword update_num = 0; - sword patch_num = 0; - sword port_update_num = 0; - - PHP_OCI_CALL(OCIClientVersion, (&major_version, &minor_version, &update_num, &patch_num, &port_update_num)); - snprintf(version, version_size, "%d.%d.%d.%d.%d", major_version, minor_version, update_num, patch_num, port_update_num); -} -/* }}} */ - -/* {{{ php_oci_server_get_version() - * - * Get Oracle server version - */ -int php_oci_server_get_version(php_oci_connection *connection, char *version, size_t version_size) -{ - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCIServerVersion, (connection->svc, connection->err, (text *)version, (ub4) version_size, OCI_HTYPE_SVCCTX)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - return 0; -} -/* }}} */ - -/* {{{ php_oci_column_to_zval() - * - * Convert php_oci_out_column struct into zval - */ -int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode) -{ - php_oci_descriptor *descriptor; - ub4 lob_length; - int column_size; - char *lob_buffer = (char *)0; - int lob_fetch_status; - - if (column->indicator == -1) { /* column is NULL */ - ZVAL_NULL(value); - return 0; - } - - if (column->is_cursor) { /* REFCURSOR -> simply return the statement id */ - ZVAL_RES(value, column->stmtid); - GC_ADDREF(column->stmtid); - } else if (column->is_descr) { - - if (column->data_type != SQLT_RDD) { - - /* reset descriptor's length */ - descriptor = (php_oci_descriptor *) column->descid->ptr; - - if (!descriptor) { - php_error_docref(NULL, E_WARNING, "Unable to find LOB descriptor #" ZEND_LONG_FMT, column->descid->handle); - return 1; - } - - descriptor->lob_size = -1; - descriptor->lob_current_position = 0; - descriptor->buffering = 0; - } - - if (column->data_type != SQLT_RDD && (mode & PHP_OCI_RETURN_LOBS)) { - /* PHP_OCI_RETURN_LOBS means that we want the content of the LOB back instead of the locator */ - - if (column->chunk_size) - descriptor->chunk_size = column->chunk_size; - lob_fetch_status = php_oci_lob_read(descriptor, -1, 0, &lob_buffer, &lob_length); - if (descriptor->chunk_size) /* Cache the chunk_size to avoid recalling OCILobGetChunkSize */ - column->chunk_size = descriptor->chunk_size; - php_oci_temp_lob_close(descriptor); - if (lob_fetch_status) { - ZVAL_FALSE(value); - return 1; - } else { - if (lob_length > 0) { - ZVAL_STRINGL(value, lob_buffer, lob_length); - } else { - ZVAL_EMPTY_STRING(value); - } - if (lob_buffer) - efree(lob_buffer); - return 0; - } - } else { - /* return the locator */ - object_init_ex(value, oci_lob_class_entry_ptr); - add_property_resource(value, "descriptor", column->descid); - GC_ADDREF(column->descid); - } - } else { - switch (column->retcode) { - case 0: - /* intact value */ - if (column->piecewise) { - column_size = column->retlen4; - } else { - column_size = column->retlen; - } - break; - - default: - ZVAL_FALSE(value); - return 0; - } - - ZVAL_STRINGL(value, column->data, column_size); - } - return 0; -} -/* }}} */ - - -/* {{{ php_oci_fetch_row() - * - * Fetch the next row from the given statement - * Has logic for Oracle 12c Implicit Result Sets - */ -void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_args) -{ - zval *z_statement, *array; - zval *placeholder = (zval*) NULL; -/* zend_array *temp_array = (zend_array *) NULL;*/ - php_oci_statement *statement; /* statement that will be fetched from */ -#if (OCI_MAJOR_VERSION >= 12) - php_oci_statement *invokedstatement; /* statement this function was invoked with */ -#endif /* OCI_MAJOR_VERSION */ - php_oci_out_column *column; - ub4 nrows = 1; - int i; - zend_long fetch_mode = 0; - - if (expected_args > 2) { - /* only for ocifetchinto BC */ - - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_RESOURCE(z_statement) - Z_PARAM_ZVAL(array) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(fetch_mode) - ZEND_PARSE_PARAMETERS_END(); - - if (ZEND_NUM_ARGS() == 2) { - fetch_mode = mode; - } - - if (Z_ISREF_P(array)) - placeholder = Z_REFVAL_P(array); - else - placeholder = array; - - } else if (expected_args == 2) { - /* only for oci_fetch_array() */ - - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_RESOURCE(z_statement) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(fetch_mode) - ZEND_PARSE_PARAMETERS_END(); - - if (ZEND_NUM_ARGS() == 1) { - fetch_mode = mode; - } - } else { - /* for all oci_fetch_*() */ - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_statement) - ZEND_PARSE_PARAMETERS_END(); - - 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; - } - } - -#if (OCI_MAJOR_VERSION < 12) - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_fetch(statement, nrows)) { - RETURN_FALSE; /* end of fetch */ - } -#else /* OCI_MAJOR_VERSION */ - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, invokedstatement); - - if (invokedstatement->impres_flag == PHP_OCI_IMPRES_NO_CHILDREN || - invokedstatement->impres_flag == PHP_OCI_IMPRES_IS_CHILD) { - /* Already know there are no Implicit Result Sets */ - statement = invokedstatement; - } else if (invokedstatement->impres_flag == PHP_OCI_IMPRES_HAS_CHILDREN) { - /* Previously saw an Implicit Result Set in an earlier invocation of php_oci_fetch_row */ - statement = (php_oci_statement *)invokedstatement->impres_child_stmt; - } else { - sword errstatus; - - /* Check for an Implicit Result Set on this statement handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)invokedstatement->stmt, OCI_HTYPE_STMT, - (dvoid *) &invokedstatement->impres_count, - (ub4 *)NULL, OCI_ATTR_IMPLICIT_RESULT_COUNT, invokedstatement->err)); - if (errstatus) { - RETURN_FALSE; - } - if (invokedstatement->impres_count > 0) { - /* Make it so the fetch occurs on the first Implicit Result Set */ - statement = php_oci_get_implicit_resultset(invokedstatement); - if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT)) - RETURN_FALSE; - invokedstatement->impres_count--; - invokedstatement->impres_child_stmt = (struct php_oci_statement *)statement; - invokedstatement->impres_flag = PHP_OCI_IMPRES_HAS_CHILDREN; - } else { - statement = invokedstatement; /* didn't find Implicit Result Sets */ - invokedstatement->impres_flag = PHP_OCI_IMPRES_NO_CHILDREN; /* Don't bother checking again */ - } - } - - if (php_oci_statement_fetch(statement, nrows)) { - /* End of fetch */ - if (invokedstatement->impres_count > 0) { - /* Check next Implicit Result Set */ - statement = php_oci_get_implicit_resultset(invokedstatement); - if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT)) - RETURN_FALSE; - invokedstatement->impres_count--; - invokedstatement->impres_child_stmt = (struct php_oci_statement *)statement; - if (php_oci_statement_fetch(statement, nrows)) { - /* End of all fetches */ - RETURN_FALSE; - } - } else { - RETURN_FALSE; - } - } -#endif /* OCI_MAJOR_VERSION */ - - if (placeholder == NULL) { - placeholder = return_value; - } else { - zval_ptr_dtor(placeholder); - } - - array_init(placeholder); - - for (i = 0; i < statement->ncolumns; i++) { - - column = php_oci_statement_get_column(statement, i + 1, NULL, 0); - - if (column == NULL) { - continue; - } - if ((column->indicator == -1) && ((fetch_mode & PHP_OCI_RETURN_NULLS) == 0)) { - continue; - } - - if (!(column->indicator == -1)) { - zval element; - - php_oci_column_to_zval(column, &element, (int) fetch_mode); - - if (fetch_mode & PHP_OCI_NUM || !(fetch_mode & PHP_OCI_ASSOC)) { - add_index_zval(placeholder, i, &element); - } - if (fetch_mode & PHP_OCI_ASSOC) { - if (fetch_mode & PHP_OCI_NUM) { - Z_TRY_ADDREF_P(&element); - } - add_assoc_zval(placeholder, column->name, &element); - } - - } else { - if (fetch_mode & PHP_OCI_NUM || !(fetch_mode & PHP_OCI_ASSOC)) { - add_index_null(placeholder, i); - } - if (fetch_mode & PHP_OCI_ASSOC) { - add_assoc_null(placeholder, column->name); - } - } - } - - if (expected_args > 2) { - RETURN_LONG(statement->ncolumns); - } -} -/* }}} */ - -/* {{{ php_oci_persistent_helper() - * - * Helper function to close/rollback persistent connections at the end of request. A return value of - * 1 indicates that the connection is to be destroyed - */ -static int php_oci_persistent_helper(zval *zv) -{ - zend_resource *le = Z_RES_P(zv); - time_t timestamp; - php_oci_connection *connection; - - timestamp = time(NULL); - - /* Persistent connection stubs are also counted as they have private session pools */ - if (le->type == le_pconnection) { - connection = (php_oci_connection *)le->ptr; - - /* Remove TAF callback function as it's bound to current request */ - if (connection->used_this_request && !Z_ISUNDEF(connection->taf_callback) && !Z_ISNULL(connection->taf_callback)) { - php_oci_unregister_taf_callback(connection); - } - - if (!connection->used_this_request && OCI_G(persistent_timeout) != -1) { -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_EXPIRY_ENABLED()) { - DTRACE_OCI8_CONNECT_EXPIRY(connection, connection->is_stub ? 1 : 0, (long)connection->idle_expiry, (long)timestamp); - } -#endif /* HAVE_OCI8_DTRACE */ - if (connection->idle_expiry < timestamp) { - /* connection has timed out */ - return ZEND_HASH_APPLY_REMOVE; - } - } - } - return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ - -/* {{{ php_oci_create_spool() - * - * Create(alloc + Init) Session pool for the given dbname and charsetid - */ -static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid) -{ - php_oci_spool *session_pool = NULL; - bool iserror = 0; - ub4 poolmode = OCI_DEFAULT; /* Mode to be passed to OCISessionPoolCreate */ - OCIAuthInfo *spoolAuth = NULL; - sword errstatus; - - /* Allocate sessionpool out of persistent memory */ - session_pool = (php_oci_spool *) calloc(1, sizeof(php_oci_spool)); - if (session_pool == NULL) { - iserror = 1; - goto exit_create_spool; - } - - /* Populate key if passed */ - if (hash_key && (ZSTR_LEN(hash_key) > 0)) { - session_pool->spool_hash_key = zend_string_dup(hash_key, 1); - if (session_pool->spool_hash_key == NULL) { - iserror = 1; - goto exit_create_spool; - } - } - - /* Create the session pool's env */ - if (!(session_pool->env = php_oci_create_env(charsetid))) { - iserror = 1; - goto exit_create_spool; - } - - /* Allocate the pool handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (session_pool->env, (dvoid **) &session_pool->poolh, OCI_HTYPE_SPOOL, (size_t) 0, (dvoid **) 0)); - - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus); - iserror = 1; - goto exit_create_spool; - } - - /* Allocate the session pool error handle - This only for use in the destructor, as there is a - * generic bug which can free up the OCI_G(err) variable before destroying connections. We - * cannot use this for other roundtrip calls as there is no way the user can access this error - */ - PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, ((dvoid *) session_pool->env, (dvoid **)&(session_pool->err), (ub4) OCI_HTYPE_ERROR,(size_t) 0, (dvoid **) 0)); - - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus); - iserror = 1; - goto exit_create_spool; - } - -/* Disable RLB as we mostly have single-connection pools */ - poolmode = OCI_SPC_NO_RLB | OCI_SPC_HOMOGENEOUS; - - /* {{{ Allocate auth handle for session pool */ - PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (session_pool->env, (dvoid **)&(spoolAuth), OCI_HTYPE_AUTHINFO, 0, NULL)); - - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus); - iserror = 1; - goto exit_create_spool; - } - /* }}} */ - - /* {{{ Set the edition attribute on the auth handle */ - if (OCI_G(edition)) { - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) OCI_G(edition), (ub4)(strlen(OCI_G(edition))), (ub4)OCI_ATTR_EDITION, OCI_G(err))); - - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus); - iserror = 1; - goto exit_create_spool; - } - } - /* }}} */ - - /* {{{ Set the driver name attribute on the auth handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err))); - - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus); - iserror = 1; - goto exit_create_spool; - } - /* }}} */ - - /* {{{ Set the auth handle on the session pool */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) (session_pool->poolh),(ub4) OCI_HTYPE_SPOOL, (dvoid *) spoolAuth, (ub4)0, (ub4)OCI_ATTR_SPOOL_AUTH, OCI_G(err))); - - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus); - iserror = 1; - goto exit_create_spool; - } - /* }}} */ - - /* Create the homogeneous session pool - We have different session pools for every different - * username, password, charset and dbname. - */ - PHP_OCI_CALL_RETURN(errstatus, OCISessionPoolCreate,(session_pool->env, OCI_G(err), session_pool->poolh, (OraText **)&session_pool->poolname, &session_pool->poolname_len, (OraText *)dbname, (ub4)dbname_len, 0, UB4MAXVAL, 1,(OraText *)username, (ub4)username_len, (OraText *)password,(ub4)password_len, poolmode)); - - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus); - iserror = 1; - } - -exit_create_spool: - if (iserror && session_pool) { - php_oci_spool_close(session_pool); - session_pool = NULL; - } - - if (spoolAuth) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO)); - } - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_SESSPOOL_CREATE_ENABLED()) { - DTRACE_OCI8_SESSPOOL_CREATE(session_pool); - } -#endif /* HAVE_OCI8_DTRACE */ - - return session_pool; -} -/* }}} */ - -/* {{{ php_oci_get_spool() - * - * Get Session pool for the given dbname and charsetid from the persistent list. Function called for - * non-persistent connections. - */ -static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, int charsetid) -{ - smart_str spool_hashed_details = {0}; - php_oci_spool *session_pool = NULL; - zend_resource *spool_out_le = NULL; - bool iserror = 0; - zval *spool_out_zv = NULL; - - /* {{{ Create the spool hash key */ - smart_str_appendl_ex(&spool_hashed_details, "oci8spool***", sizeof("oci8spool***") - 1, 0); - smart_str_appendl_ex(&spool_hashed_details, username, username_len, 0); - smart_str_appendl_ex(&spool_hashed_details, "**", sizeof("**") - 1, 0); - /* Add edition attribute to the hash */ - if (OCI_G(edition)){ - smart_str_appendl_ex(&spool_hashed_details, OCI_G(edition), strlen(OCI_G(edition)), 0); - } - smart_str_appendl_ex(&spool_hashed_details, "**", sizeof("**") - 1, 0); - if (password_len) { - zend_ulong password_hash; - password_hash = zend_hash_func(password, password_len); - smart_str_append_unsigned_ex(&spool_hashed_details, password_hash, 0); - } - smart_str_appendl_ex(&spool_hashed_details, "**", sizeof("**") - 1, 0); - - if (dbname_len) { - smart_str_appendl_ex(&spool_hashed_details, dbname, dbname_len, 0); - } - smart_str_appendl_ex(&spool_hashed_details, "**", sizeof("**") - 1, 0); - - smart_str_append_unsigned_ex(&spool_hashed_details, charsetid, 0); - - /* Session Pool Hash Key : oci8spool***username**edition**hashedpassword**dbname**charset */ - - smart_str_0(&spool_hashed_details); - zend_str_tolower(ZSTR_VAL(spool_hashed_details.s), ZSTR_LEN(spool_hashed_details.s)); - /* }}} */ - - spool_out_zv = zend_hash_find(&EG(persistent_list), spool_hashed_details.s); - if (spool_out_zv != NULL) { - spool_out_le = Z_RES_P(spool_out_zv); - } - - if (spool_out_le == NULL) { - - session_pool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, spool_hashed_details.s, charsetid); - - if (session_pool == NULL) { - iserror = 1; - goto exit_get_spool; - } - zend_register_persistent_resource_ex(session_pool->spool_hash_key, session_pool, le_psessionpool); - } else if (spool_out_le->type == le_psessionpool && - zend_string_equals(((php_oci_spool *)(spool_out_le->ptr))->spool_hash_key, spool_hashed_details.s)) { - /* retrieve the cached session pool */ - session_pool = (php_oci_spool *)(spool_out_le->ptr); - } - -exit_get_spool: - smart_str_free(&spool_hashed_details); - if (iserror && session_pool) { - php_oci_spool_close(session_pool); - session_pool = NULL; - } - - return session_pool; - -} -/* }}} */ - -/* {{{ php_oci_create_env() - * - * Create the OCI environment choosing the correct function for the OCI version - */ -static OCIEnv *php_oci_create_env(ub2 charsetid) -{ - OCIEnv *retenv = NULL; - - /* create an environment using the character set id */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvNlsCreate, (&retenv, OCI_G(events) ? PHP_OCI_INIT_MODE | OCI_EVENTS : PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, charsetid, charsetid)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - sb4 ora_error_code = 0; - text ora_msg_buf[PHP_OCI_ERRBUF_LEN]; /* Use traditional smaller size: non-PL/SQL errors should fit and it keeps the stack smaller */ - -#ifdef HAVE_OCI_INSTANT_CLIENT - php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries"); -#else - php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories"); -#endif - if (retenv - && OCIErrorGet(retenv, (ub4)1, NULL, &ora_error_code, ora_msg_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ENV) == OCI_SUCCESS - && *ora_msg_buf) { - php_error_docref(NULL, E_WARNING, "%s", ora_msg_buf); - } - - return NULL; - } - return retenv; -} -/* }}} */ - -/* {{{ php_oci_old_create_session() - * - * This function is to be deprecated in future in favour of OCISessionGet which is used in - * php_oci_do_connect_ex - */ -static int php_oci_old_create_session(php_oci_connection *connection, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode) -{ - ub4 statement_cache_size = 0; - - if (OCI_G(statement_cache_size) > 0) { - if (OCI_G(statement_cache_size) > SB4MAXVAL) - statement_cache_size = (ub4) SB4MAXVAL; - else - statement_cache_size = (ub4) OCI_G(statement_cache_size); - } - - /* Create the OCI environment separate for each connection */ - if (!(connection->env = php_oci_create_env(connection->charset))) { - return 1; - } - - /* {{{ Allocate our server handle */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->server), OCI_HTYPE_SERVER, 0, NULL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - /* }}} */ - - /* {{{ Attach to the server */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerAttach, (connection->server, OCI_G(err), (text *)dbname, dbname_len, (ub4) OCI_DEFAULT)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - /* }}} */ - connection->is_attached = 1; - - /* {{{ Allocate our session handle */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->session), OCI_HTYPE_SESSION, 0, NULL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - /* }}} */ - - /* {{{ Allocate our private error-handle */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->err), OCI_HTYPE_ERROR, 0, NULL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - /* }}} */ - - /* {{{ Allocate our service-context */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->svc), OCI_HTYPE_SVCCTX, 0, NULL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - /* }}} */ - - /* {{{ Set the username */ - if (username) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username, (ub4) username_len, (ub4) OCI_ATTR_USERNAME, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - } - /* }}} */ - - /* {{{ Set the password */ - if (password) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password, (ub4) password_len, (ub4) OCI_ATTR_PASSWORD, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - } - /* }}} */ - - /* {{{ Set the edition attribute on the session handle */ - if (OCI_G(edition)) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(edition), (ub4) (strlen(OCI_G(edition))), (ub4) OCI_ATTR_EDITION, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - } -/* }}} */ - - /* {{{ Set the driver name attribute on the session handle */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } -/* }}} */ - - /* {{{ Set the server handle in the service handle */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, (connection->svc, OCI_HTYPE_SVCCTX, connection->server, 0, OCI_ATTR_SERVER, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - /* }}} */ - - /* {{{ Set the authentication handle in the service handle */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, (connection->svc, OCI_HTYPE_SVCCTX, connection->session, 0, OCI_ATTR_SESSION, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - /* }}} */ - - if (new_password) { - /* {{{ Try to change password if new one was provided */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPasswordChange, (connection->svc, OCI_G(err), (text *)username, username_len, (text *)password, password_len, (text *)new_password, new_password_len, OCI_AUTH)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->session), (ub4 *)0, OCI_ATTR_SESSION, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - /* }}} */ - } else { - /* {{{ start the session */ - ub4 cred_type = OCI_CRED_RDBMS; - - /* Extract the overloaded session_mode parameter into valid Oracle credential and session mode values */ - if (session_mode & PHP_OCI_CRED_EXT) { - cred_type = OCI_CRED_EXT; - session_mode ^= PHP_OCI_CRED_EXT; - } - - session_mode |= OCI_STMT_CACHE; - - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) cred_type, (ub4) session_mode)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - /* OCISessionBegin returns OCI_SUCCESS_WITH_INFO when - * user's password has expired, but is still usable. - */ - if (OCI_G(errcode) != OCI_SUCCESS_WITH_INFO) { - return 1; - } - } - /* }}} */ - } - - /* Brand new connection: Init and update the next_ping in the connection */ - if (php_oci_ping_init(connection, OCI_G(err)) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0, (ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - - /* Successfully created session */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_create_session() - * - * Create session using client-side session pool - new norm - */ -static int php_oci_create_session(php_oci_connection *connection, php_oci_spool *session_pool, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode) -{ - php_oci_spool *actual_spool = NULL; - ub4 purity = -2; /* Illegal value to initialize */ - time_t timestamp = time(NULL); - ub4 statement_cache_size = 0; - - if (OCI_G(statement_cache_size) > 0) { - if (OCI_G(statement_cache_size) > SB4MAXVAL) - statement_cache_size = (ub4) SB4MAXVAL; - else - statement_cache_size = (ub4) OCI_G(statement_cache_size); - } - - /* Persistent connections have private session pools */ - if (connection->is_persistent && !connection->private_spool && - !(connection->private_spool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, NULL, connection->charset))) { - return 1; - } - actual_spool = (connection->is_persistent) ? (connection->private_spool) : (session_pool); - - connection->env = actual_spool->env; - - /* Do this upfront so that connection close on an error would know that this is a session pool - * connection. Failure to do this would result in crashes in error scenarios - */ - if (!connection->using_spool) { - connection->using_spool = 1; - } - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_SESSPOOL_TYPE_ENABLED()) { - DTRACE_OCI8_SESSPOOL_TYPE(session_pool ? 1 : 0, session_pool ? session_pool : connection->private_spool); - } -#endif /* HAVE_OCI8_DTRACE */ - - /* The passed in "connection" can be a cached stub from plist or freshly created. In the former - * case, we do not have to allocate any handles - */ - - if (!connection->err) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->err), OCI_HTYPE_ERROR, 0, NULL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - } - - /* {{{ Allocate and initialize the connection-private authinfo handle if not allocated yet */ - if (!connection->authinfo) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->authinfo), OCI_HTYPE_AUTHINFO, 0, NULL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - - /* Set the Connection class and purity if OCI client version >= 11g */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->authinfo,(ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(connection_class), (ub4)(strlen(OCI_G(connection_class))), (ub4)OCI_ATTR_CONNECTION_CLASS, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - - if (connection->is_persistent) - purity = OCI_ATTR_PURITY_SELF; - else - purity = OCI_ATTR_PURITY_NEW; - - PHP_OCI_CALL_RETURN(OCI_G(errcode),OCIAttrSet, ((dvoid *) connection->authinfo,(ub4) OCI_HTYPE_AUTHINFO, (dvoid *) &purity, (ub4)0, (ub4)OCI_ATTR_PURITY, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - } - /* }}} */ - - /* {{{ Debug statements */ -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_SESSPOOL_STATS_ENABLED()) { - ub4 numfree = 0, numbusy = 0, numopen = 0; - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)actual_spool->poolh, OCI_HTYPE_SPOOL, (dvoid *)&numopen, (ub4 *)0, OCI_ATTR_SPOOL_OPEN_COUNT, OCI_G(err))); - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)actual_spool->poolh, OCI_HTYPE_SPOOL, (dvoid *)&numbusy, (ub4 *)0, OCI_ATTR_SPOOL_BUSY_COUNT, OCI_G(err))); - numfree = numopen - numbusy; /* number of free connections in the pool */ - DTRACE_OCI8_SESSPOOL_STATS(numfree, numbusy, numopen); - } -#endif /* HAVE_OCI8_DTRACE */ - /* }}} */ - - /* Ping loop: Ping and loop till we get a good connection. When a database instance goes - * down, it can leave several bad connections that need to be flushed out before getting a - * good one. In non-RAC, we always get a brand new connection at the end of the loop and in - * RAC, we can get a good connection from a different instance before flushing out all bad - * ones. We do not need to ping brand new connections. - */ - do { - /* Continue to use the global error handle as the connection is closed when an error occurs */ - PHP_OCI_CALL_RETURN(OCI_G(errcode),OCISessionGet, (connection->env, OCI_G(err), &(connection->svc), (OCIAuthInfo *)connection->authinfo, (OraText *)actual_spool->poolname, (ub4)actual_spool->poolname_len, NULL, 0, NULL, NULL, NULL, OCI_SESSGET_SPOOL)); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - - /* Session creation returns OCI_SUCCESS_WITH_INFO when user's password has expired, but - * is still usable. - */ - - if (OCI_G(errcode) != OCI_SUCCESS_WITH_INFO) { - return 1; - } - } - - /* {{{ Populate the session and server fields of the connection */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->server), (ub4 *)0, OCI_ATTR_SERVER, OCI_G(err))); - - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->session), (ub4 *)0, OCI_ATTR_SESSION, OCI_G(err))); - /* }}} */ - - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIContextGetValue, (connection->session, OCI_G(err), (ub1 *)"NEXT_PING", (ub1)sizeof("NEXT_PING"), (void **)&(connection->next_pingp))); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - - if (!(connection->next_pingp)){ - /* This is a brand new connection, we need not ping, but have to initialize ping */ - if (php_oci_ping_init(connection, OCI_G(err)) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - } else if ((*(connection->next_pingp) > 0) && (timestamp >= *(connection->next_pingp))) { - if (php_oci_connection_ping(connection)) { - /* Got a good connection - update next_ping and get out of ping loop */ - *(connection->next_pingp) = timestamp + OCI_G(ping_interval); - } else { - /* Bad connection - remove from pool */ - PHP_OCI_CALL(OCISessionRelease, (connection->svc, connection->err, NULL,0, (ub4) OCI_SESSRLS_DROPSESS)); - connection->svc = NULL; - connection->server = NULL; - connection->session = NULL; - } - } /* If ping applicable */ - } while (!(connection->svc)); - - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0, (ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - return 1; - } - - /* Session is now taken from the session pool and attached and open */ - connection->is_stub = 0; - connection->is_attached = connection->is_open = 1; - - return 0; -} -/* }}} */ - -/* {{{ php_oci_spool_list_dtor() - * - * Session pool destructor function - */ -static void php_oci_spool_list_dtor(zend_resource *entry) -{ - php_oci_spool *session_pool = (php_oci_spool *)entry->ptr; - - if (session_pool) { - php_oci_spool_close(session_pool); - } - - return; -} -/* }}} */ - -/* {{{ php_oci_spool_close() - * - * Destroys the OCI Session Pool - */ -static void php_oci_spool_close(php_oci_spool *session_pool) -{ - if (session_pool->poolname_len) { - PHP_OCI_CALL(OCISessionPoolDestroy, ((dvoid *) session_pool->poolh, - (dvoid *) session_pool->err, OCI_SPD_FORCE)); - } - - if (session_pool->poolh) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) session_pool->poolh, OCI_HTYPE_SPOOL)); - } - - if (session_pool->err) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) session_pool->err, OCI_HTYPE_ERROR)); - } - - if (session_pool->env) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) session_pool->env, OCI_HTYPE_ENV)); - } - - if (session_pool->spool_hash_key) { - free(session_pool->spool_hash_key); - } - - free(session_pool); -} -/* }}} */ - -/* {{{ php_oci_ping_init() - * - * Initializes the next_ping time as a context value in the connection. We now use - * OCIContext{Get,Set}Value to store the next_ping because we need to support ping for - * non-persistent DRCP connections - */ -static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh) -{ - time_t *next_pingp = NULL; - - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIContextGetValue, (connection->session, errh, (ub1 *)"NEXT_PING", (ub1)sizeof("NEXT_PING"), (void **)&next_pingp)); - if (OCI_G(errcode) != OCI_SUCCESS) { - return OCI_G(errcode); - } - - /* This must be a brand-new connection. Allocate memory for the ping */ - if (!next_pingp) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIMemoryAlloc, (connection->session, errh, (void **)&next_pingp, OCI_DURATION_SESSION, sizeof(time_t), OCI_MEMORY_CLEARED)); - if (OCI_G(errcode) != OCI_SUCCESS) { - return OCI_G(errcode); - } - } - - if (OCI_G(ping_interval) >= 0) { - time_t timestamp = time(NULL); - *next_pingp = timestamp + OCI_G(ping_interval); - } else { - *next_pingp = 0; - } - - /* Set the new ping value into the connection */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIContextSetValue, (connection->session, errh, OCI_DURATION_SESSION, (ub1 *)"NEXT_PING", (ub1)sizeof("NEXT_PING"), next_pingp)); - if (OCI_G(errcode) != OCI_SUCCESS) { - OCIMemoryFree(connection->session, errh, next_pingp); - return OCI_G(errcode); - } - - /* Cache the pointer so we do not have to do OCIContextGetValue repeatedly */ - connection->next_pingp = next_pingp; - - return OCI_SUCCESS; -} -/* }}} */ - -/* {{{ php_oci_dtrace_check_connection() - * - * DTrace output for connections that may have become invalid and marked for reopening - */ -void php_oci_dtrace_check_connection(php_oci_connection *connection, sb4 errcode, ub4 serverStatus) -{ -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CHECK_CONNECTION_ENABLED()) { - DTRACE_OCI8_CHECK_CONNECTION(connection, connection->client_id, connection->is_open ? 1 : 0, (long)errcode, (unsigned long)serverStatus); - } -#endif /* HAVE_OCI8_DTRACE */ -} -/* }}} */ - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php deleted file mode 100644 index 8fc39bd378d5..000000000000 --- a/ext/oci8/oci8.stub.php +++ /dev/null @@ -1,1132 +0,0 @@ -seek() */ - -/** - * @var int - * @cvalue PHP_OCI_SEEK_SET - */ -const OCI_SEEK_SET = UNKNOWN; -/** - * @var int - * @cvalue PHP_OCI_SEEK_CUR - */ -const OCI_SEEK_CUR = UNKNOWN; -/** - * @var int - * @cvalue PHP_OCI_SEEK_END - */ -const OCI_SEEK_END = UNKNOWN; - -/* for $LOB->flush() */ - -/** - * @var int - * @cvalue OCI_LOB_BUFFER_FREE - */ -const OCI_LOB_BUFFER_FREE = UNKNOWN; - -/* for OCIBindByName (real "oci" names + short "php" names */ - -/** - * @var int - * @cvalue SQLT_BFILEE - */ -const SQLT_BFILEE = UNKNOWN; -/** - * @var int - * @cvalue SQLT_CFILEE - */ -const SQLT_CFILEE = UNKNOWN; -/** - * @var int - * @cvalue SQLT_CLOB - */ -const SQLT_CLOB = UNKNOWN; -/** - * @var int - * @cvalue SQLT_BLOB - */ -const SQLT_BLOB = UNKNOWN; -/** - * @var int - * @cvalue SQLT_RDD - */ -const SQLT_RDD = UNKNOWN; -/** - * @var int - * @cvalue SQLT_INT - */ -const SQLT_INT = UNKNOWN; -/** - * @var int - * @cvalue SQLT_NUM - */ -const SQLT_NUM = UNKNOWN; -/** - * @var int - * @cvalue SQLT_RSET - */ -const SQLT_RSET = UNKNOWN; -/** - * @var int - * @cvalue SQLT_AFC - */ -const SQLT_AFC = UNKNOWN; -/** - * @var int - * @cvalue SQLT_CHR - */ -const SQLT_CHR = UNKNOWN; -/** - * @var int - * @cvalue SQLT_VCS - */ -const SQLT_VCS = UNKNOWN; -/** - * @var int - * @cvalue SQLT_AVC - */ -const SQLT_AVC = UNKNOWN; -/** - * @var int - * @cvalue SQLT_STR - */ -const SQLT_STR = UNKNOWN; -/** - * @var int - * @cvalue SQLT_LVC - */ -const SQLT_LVC = UNKNOWN; -/** - * @var int - * @cvalue SQLT_FLT - */ -const SQLT_FLT = UNKNOWN; -/** - * @var int - * @cvalue SQLT_UIN - */ -const SQLT_UIN = UNKNOWN; -/** - * @var int - * @cvalue SQLT_LNG - */ -const SQLT_LNG = UNKNOWN; -/** - * @var int - * @cvalue SQLT_LBI - */ -const SQLT_LBI = UNKNOWN; -/** - * @var int - * @cvalue SQLT_BIN - */ -const SQLT_BIN = UNKNOWN; -/** - * @var int - * @cvalue SQLT_ODT - */ -const SQLT_ODT = UNKNOWN; -/** - * @var int - * @cvalue SQLT_BDOUBLE - */ -const SQLT_BDOUBLE = UNKNOWN; -/** - * @var int - * @cvalue SQLT_BFLOAT - */ -const SQLT_BFLOAT = UNKNOWN; -#if OCI_MAJOR_VERSION >= 12 -/** - * @var int - * @cvalue SQLT_BOL - */ -const SQLT_BOL = UNKNOWN; -#endif - -/** - * @var int - * @cvalue SQLT_NTY - */ -const OCI_B_NTY = UNKNOWN; -/** - * @var int - * @cvalue SQLT_NTY - */ -const SQLT_NTY = UNKNOWN; - -/** @var string */ -const OCI_SYSDATE = "SYSDATE"; - -/** - * @var int - * @cvalue SQLT_BFILEE - */ -const OCI_B_BFILE = UNKNOWN; -/** - * @var int - * @cvalue SQLT_CFILEE - */ -const OCI_B_CFILEE = UNKNOWN; -/** - * @var int - * @cvalue SQLT_CLOB - */ -const OCI_B_CLOB = UNKNOWN; -/** - * @var int - * @cvalue SQLT_BLOB - */ -const OCI_B_BLOB = UNKNOWN; -/** - * @var int - * @cvalue SQLT_RDD - */ -const OCI_B_ROWID = UNKNOWN; -/** - * @var int - * @cvalue SQLT_RSET - */ -const OCI_B_CURSOR = UNKNOWN; -/** - * @var int - * @cvalue SQLT_BIN - */ -const OCI_B_BIN = UNKNOWN; -/** - * @var int - * @cvalue SQLT_INT - */ -const OCI_B_INT = UNKNOWN; -/** - * @var int - * @cvalue SQLT_NUM - */ -const OCI_B_NUM = UNKNOWN; -#if OCI_MAJOR_VERSION >= 12 -/** - * @var int - * @cvalue SQLT_BOL - */ -const OCI_B_BOL = UNKNOWN; -#endif - -/* for OCIFetchStatement */ - -/** - * @var int - * @cvalue PHP_OCI_FETCHSTATEMENT_BY_COLUMN - */ -const OCI_FETCHSTATEMENT_BY_COLUMN = UNKNOWN; -/** - * @var int - * @cvalue PHP_OCI_FETCHSTATEMENT_BY_ROW - */ -const OCI_FETCHSTATEMENT_BY_ROW = UNKNOWN; - -/* for OCIFetchInto & OCIResult */ - -/** - * @var int - * @cvalue PHP_OCI_ASSOC - */ -const OCI_ASSOC = UNKNOWN; -/** - * @var int - * @cvalue PHP_OCI_NUM - */ -const OCI_NUM = UNKNOWN; -/** - * @var int - * @cvalue PHP_OCI_BOTH - */ -const OCI_BOTH = UNKNOWN; -/** - * @var int - * @cvalue PHP_OCI_RETURN_NULLS - */ -const OCI_RETURN_NULLS = UNKNOWN; -/** - * @var int - * @cvalue PHP_OCI_RETURN_LOBS - */ -const OCI_RETURN_LOBS = UNKNOWN; - -/* for OCINewDescriptor (real "oci" names + short "php" names */ - -/** - * @var int - * @cvalue OCI_DTYPE_FILE - */ -const OCI_DTYPE_FILE = UNKNOWN; -/** - * @var int - * @cvalue OCI_DTYPE_LOB - */ -const OCI_DTYPE_LOB = UNKNOWN; -/** - * @var int - * @cvalue OCI_DTYPE_ROWID - */ -const OCI_DTYPE_ROWID = UNKNOWN; - -/** - * @var int - * @cvalue OCI_DTYPE_FILE - */ -const OCI_D_FILE = UNKNOWN; -/** - * @var int - * @cvalue OCI_DTYPE_LOB - */ -const OCI_D_LOB = UNKNOWN; -/** - * @var int - * @cvalue OCI_DTYPE_ROWID - */ -const OCI_D_ROWID = UNKNOWN; - -/* for OCIWriteTemporaryLob */ - -/** - * @var int - * @cvalue OCI_TEMP_CLOB - */ -const OCI_TEMP_CLOB = UNKNOWN; -/** - * @var int - * @cvalue OCI_TEMP_BLOB - */ -const OCI_TEMP_BLOB = UNKNOWN; - -/* for Transparent Application Failover */ - -/** - * @var int - * @cvalue OCI_FO_END - */ -const OCI_FO_END = UNKNOWN; -/** - * @var int - * @cvalue OCI_FO_ABORT - */ -const OCI_FO_ABORT = UNKNOWN; -/** - * @var int - * @cvalue OCI_FO_REAUTH - */ -const OCI_FO_REAUTH = UNKNOWN; -/** - * @var int - * @cvalue OCI_FO_BEGIN - */ -const OCI_FO_BEGIN = UNKNOWN; -/** - * @var int - * @cvalue OCI_FO_ERROR - */ -const OCI_FO_ERROR = UNKNOWN; - -/** - * @var int - * @cvalue OCI_FO_NONE - */ -const OCI_FO_NONE = UNKNOWN; -/** - * @var int - * @cvalue OCI_FO_SESSION - */ -const OCI_FO_SESSION = UNKNOWN; -/** - * @var int - * @cvalue OCI_FO_SELECT - */ -const OCI_FO_SELECT = UNKNOWN; -/** - * @var int - * @cvalue OCI_FO_TXNAL - */ -const OCI_FO_TXNAL = UNKNOWN; - -/** - * @var int - * @cvalue OCI_FO_RETRY - */ -const OCI_FO_RETRY = UNKNOWN; - -/** @param resource $statement */ -function oci_define_by_name($statement, string $column, mixed &$var, int $type = 0): bool {} - -/** - * @param resource $statement - * @alias oci_define_by_name - * @deprecated - */ -function ocidefinebyname($statement, string $column, mixed &$var, int $type = 0): bool {} - -/** @param resource $statement */ -function oci_bind_by_name($statement, string $param, mixed &$var, int $max_length = -1, int $type = 0): bool {} - -/** - * @param resource $statement - * @alias oci_bind_by_name - * @deprecated - */ -function ocibindbyname($statement, string $param, mixed &$var, int $max_length = -1, int $type = 0): bool {} - -/** - * @param resource $statement - * @param array $var - */ -function oci_bind_array_by_name($statement, string $param, &$var, int $max_array_length, int $max_item_length = -1, int $type = SQLT_AFC): bool {} - -function oci_free_descriptor(OCILob $lob): bool {} - -/** - * @alias oci_free_descriptor - * @deprecated - */ -function ocifreedesc(OCILob $lob): bool {} - -function oci_lob_save(OCILob $lob, string $data, int $offset = 0): bool {} - -/** - * @alias oci_lob_save - * @deprecated - */ -function ocisavelob(OCILob $lob, string $data, int $offset = 0): bool {} - -function oci_lob_import(OCILob $lob, string $filename): bool {} - -/** - * @alias oci_lob_import - * @deprecated - */ -function ocisavelobfile(OCILob $lob, string $filename): bool {} - -function oci_lob_load(OCILob $lob): string|false {} - -/** - * @alias oci_lob_load - * @deprecated - */ -function ociloadlob(OCILob $lob): string|false {} - -function oci_lob_read(OCILob $lob, int $length): string|false {} - -function oci_lob_eof(OCILob $lob): bool {} - -function oci_lob_tell(OCILob $lob): int|false {} - -function oci_lob_rewind(OCILob $lob): bool {} - -function oci_lob_seek(OCILob $lob, int $offset, int $whence = OCI_SEEK_SET): bool {} - -function oci_lob_size(OCILob $lob): int|false {} - -function oci_lob_write(OCILob $lob, string $data, ?int $length = null): int|false {} - -function oci_lob_append(OCILob $to, OCILob $from): bool {} - -function oci_lob_truncate(OCILob $lob, int $length = 0): bool {} - -function oci_lob_erase(OCILob $lob, ?int $offset = null, ?int $length = null): int|false {} - -function oci_lob_flush(OCILob $lob, int $flag = 0): bool {} - -function ocisetbufferinglob(OCILob $lob, bool $mode): bool {} - -function ocigetbufferinglob(OCILob $lob): bool {} - -function oci_lob_copy(OCILob $to, OCILob $from, ?int $length = null): bool {} - -function oci_lob_is_equal(OCILob $lob1, OCILob $lob2): bool {} - -function oci_lob_export(OCILob $lob, string $filename, ?int $offset = null, ?int $length = null): bool {} - -/** - * @alias oci_lob_export - * @deprecated - */ -function ociwritelobtofile(OCILob $lob, string $filename, ?int $offset = null, ?int $length = null): bool {} - -/** @param resource $connection */ -function oci_new_descriptor($connection, int $type = OCI_DTYPE_LOB): ?OCILob {} - -/** - * @param resource $connection - * @alias oci_new_descriptor - * @deprecated - */ -function ocinewdescriptor($connection, int $type = OCI_DTYPE_LOB): ?OCILob {} - -/** @param resource $connection */ -function oci_rollback($connection): bool {} - -/** - * @param resource $connection - * @alias oci_rollback - * @deprecated - */ -function ocirollback($connection): bool {} - -/** @param resource $connection */ -function oci_commit($connection): bool {} - -/** - * @param resource $connection - * @alias oci_commit - * @deprecated - */ -function ocicommit($connection): bool {} - -/** @param resource $statement */ -function oci_field_name($statement, string|int $column): string|false {} - -/** - * @param resource $statement - * @alias oci_field_name - * @deprecated - */ -function ocicolumnname($statement, string|int $column): string|false {} - -/** @param resource $statement */ -function oci_field_size($statement, string|int $column): int|false {} - -/** - * @param resource $statement - * @alias oci_field_size - * @deprecated - */ -function ocicolumnsize($statement, string|int $column): int|false {} - -/** @param resource $statement */ -function oci_field_scale($statement, string|int $column): int|false {} - -/** - * @param resource $statement - * @alias oci_field_scale - * @deprecated - */ -function ocicolumnscale($statement, string|int $column): int|false {} - -/** @param resource $statement */ -function oci_field_precision($statement, string|int $column): int|false {} - -/** - * @param resource $statement - * @alias oci_field_precision - * @deprecated - */ -function ocicolumnprecision($statement, string|int $column): int|false {} - -/** @param resource $statement */ -function oci_field_type($statement, string|int $column): string|int|false {} - -/** - * @param resource $statement - * @alias oci_field_type - * @deprecated - */ -function ocicolumntype($statement, string|int $column): string|int|false {} - -/** @param resource $statement */ -function oci_field_type_raw($statement, string|int $column): int|false {} - -/** - * @param resource $statement - * @alias oci_field_type_raw - * @deprecated - */ -function ocicolumntyperaw($statement, string|int $column): int|false {} - -/** @param resource $statement */ -function oci_field_is_null($statement, string|int $column): bool {} - -/** - * @param resource $statement - * @alias oci_field_is_null - * @deprecated - */ -function ocicolumnisnull($statement, string|int $column): bool {} - -/** @param resource $statement */ -function oci_execute($statement, int $mode = OCI_COMMIT_ON_SUCCESS): bool {} - -/** - * @param resource $statement - * @alias oci_execute - * @deprecated - */ -function ociexecute($statement, int $mode = OCI_COMMIT_ON_SUCCESS): bool {} - -/** @param resource $statement */ -function oci_cancel($statement): bool {} - -/** - * @param resource $statement - * @alias oci_cancel - * @deprecated - */ -function ocicancel($statement): bool {} - -/** @param resource $statement */ -function oci_fetch($statement): bool {} - -/** - * @param resource $statement - * @alias oci_fetch - * @deprecated - */ -function ocifetch($statement): bool {} - -/** - * @param resource $statement - * @param array $result - * @deprecated - */ -function ocifetchinto($statement, &$result, int $mode = OCI_NUM): int|false {} - -/** - * @param resource $statement - * @param array $output - */ -function oci_fetch_all($statement, &$output, int $offset = 0, int $limit = -1, int $flags = OCI_FETCHSTATEMENT_BY_COLUMN | OCI_ASSOC): int {} - -/** - * @param resource $statement - * @param array $output - * @alias oci_fetch_all - * @deprecated - */ -function ocifetchstatement($statement, &$output, int $offset = 0, int $limit = -1, int $flags = OCI_FETCHSTATEMENT_BY_COLUMN | OCI_ASSOC): int {} - -/** @param resource $statement */ -function oci_fetch_object($statement, int $mode = OCI_ASSOC | OCI_RETURN_NULLS): stdClass|false {} - -/** @param resource $statement */ -function oci_fetch_row($statement): array|false {} - -/** @param resource $statement */ -function oci_fetch_assoc($statement): array|false {} - -/** @param resource $statement */ -function oci_fetch_array($statement, int $mode = OCI_BOTH | OCI_RETURN_NULLS): array|false {} - -/** @param resource $statement */ -function oci_free_statement($statement): bool {} - -/** - * @param resource $statement - * @alias oci_free_statement - * @deprecated - */ -function ocifreestatement($statement): bool {} - -/** - * @param resource $statement - * @alias oci_free_statement - */ -function oci_free_cursor($statement): bool {} - -/** - * @param resource $statement - * @alias oci_free_statement - * @deprecated - */ -function ocifreecursor($statement): bool {} - -/** @param resource $connection */ -function oci_close($connection): ?bool {} - -/** - * @param resource $connection - * @alias oci_close - * @deprecated - */ -function ocilogoff($connection): ?bool {} - -/** - * @return resource|false - */ -function oci_new_connect(string $username, #[\SensitiveParameter] string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {} - -/** - * @return resource|false - * @alias oci_new_connect - * @deprecated - */ -function ocinlogon(string $username, #[\SensitiveParameter] string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {} - -/** - * @return resource|false - */ -function oci_connect(string $username, #[\SensitiveParameter] string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {} - -/** - * @return resource|false - * @alias oci_connect - * @deprecated - */ -function ocilogon(string $username, #[\SensitiveParameter] string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {} - -/** - * @return resource|false - */ -function oci_pconnect(string $username, #[\SensitiveParameter] string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {} - -/** - * @return resource|false - * @alias oci_pconnect - * @deprecated - */ -function ociplogon(string $username, #[\SensitiveParameter] string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {} - -/** - * @param resource|null $connection_or_statement - * @return array|false - * @refcount 1 - */ -function oci_error($connection_or_statement = null): array|false {} - -/** - * @param resource|null $connection_or_statement - * @return array|false - * @alias oci_error - * @deprecated - */ -function ocierror($connection_or_statement = null): array|false {} - -/** @param resource $statement */ -function oci_num_fields($statement): int {} - -/** - * @param resource $statement - * @alias oci_num_fields - * @deprecated - */ -function ocinumcols($statement): int {} - -/** - * @param resource $connection - * @return resource|false - */ -function oci_parse($connection, string $sql) {} - -/** - * @param resource $connection - * @return resource|false - * @alias oci_parse - * @deprecated - */ -function ociparse($connection, string $sql) {} - -/** - * @param resource $statement - * @return resource|false - */ -function oci_get_implicit_resultset($statement) {} - -/** @param resource $statement */ -function oci_set_prefetch($statement, int $rows): bool {} - -/** - * @param resource $statement - * @alias oci_set_prefetch - * @deprecated - */ -function ocisetprefetch($statement, int $rows): bool {} - -/** @param resource $statement */ -function oci_set_prefetch_lob($statement, int $prefetch_lob_size): bool {} - -/** @param resource $connection */ -function oci_set_client_identifier($connection, string $client_id): bool {} - -function oci_set_edition(string $edition): bool {} - -/** @param resource $connection */ -function oci_set_module_name($connection, string $name): bool {} - -/** @param resource $connection */ -function oci_set_action($connection, string $action): bool {} - -/** - * @param resource $connection - */ -function oci_set_client_info($connection, string $client_info): bool {} - -/** @param resource $connection */ -function oci_set_db_operation($connection, string $action): bool {} - -/** @param resource $connection */ -function oci_set_call_timeout($connection, int $timeout): bool {} - -/** - * @param resource|string $connection - * @return resource|bool - */ -function oci_password_change($connection, string $username, string $old_password, string $new_password) {} - -/** - * @param resource|string $connection - * @return resource|bool - * @alias oci_password_change - * @deprecated - */ -function ocipasswordchange($connection, string $username, string $old_password, string $new_password) {} - -/** - * @param resource $connection - * @return resource|false - */ -function oci_new_cursor($connection) {} - -/** - * @param resource $connection - * @return resource|false - * @alias oci_new_cursor - * @deprecated - */ -function ocinewcursor($connection) {} - -/** @param resource $statement */ -function oci_result($statement, string|int $column): mixed {} - -/** - * @param resource $statement - * @alias oci_result - * @deprecated - */ -function ociresult($statement, string|int $column): mixed {} - -function oci_client_version(): string {} - -/** @param resource $connection */ -function oci_server_version($connection): string|false {} - -/** - * @param resource $connection - * @alias oci_server_version - * @deprecated - */ -function ociserverversion($connection): string|false {} - -/** @param resource $statement */ -function oci_statement_type($statement): string|false {} - -/** - * @param resource $statement - * @alias oci_statement_type - * @deprecated - */ -function ocistatementtype($statement): string|false {} - -/** @param resource $statement */ -function oci_num_rows($statement): int|false {} - -/** - * @param resource $statement - * @alias oci_num_rows - * @deprecated - */ -function ocirowcount($statement): int|false {} - -function oci_free_collection(OCICollection $collection): bool {} - -/** - * @alias oci_free_collection - * @deprecated - */ -function ocifreecollection(OCICollection $collection): bool {} - -function oci_collection_append(OCICollection $collection, string $value): bool {} - -/** - * @alias oci_collection_append - * @deprecated - */ -function ocicollappend(OCICollection $collection, string $value): bool {} - -function oci_collection_element_get(OCICollection $collection, int $index): string|float|null|false {} - -/** - * @alias oci_collection_element_get - * @deprecated - */ -function ocicollgetelem(OCICollection $collection, int $index): string|float|null|false {} - -function oci_collection_assign(OCICollection $to, OCICollection $from): bool {} - -function oci_collection_element_assign(OCICollection $collection, int $index, string $value): bool {} - -/** - * @alias oci_collection_element_assign - * @deprecated - */ -function ocicollassignelem(OCICollection $collection, int $index, string $value): bool {} - -function oci_collection_size(OCICollection $collection): int|false {} - -/** - * @alias oci_collection_size - * @deprecated - */ -function ocicollsize(OCICollection $collection): int|false {} - -function oci_collection_max(OCICollection $collection): int|false {} - -/** - * @alias oci_collection_max - * @deprecated - */ -function ocicollmax(OCICollection $collection): int|false {} - -function oci_collection_trim(OCICollection $collection, int $num): bool {} - -/** - * @alias oci_collection_trim - * @deprecated - */ -function ocicolltrim(OCICollection $collection, int $num): bool {} - -/** @param resource $connection */ -function oci_new_collection($connection, string $type_name, ?string $schema = null): OCICollection|false {} - -/** - * @param resource $connection - * @alias oci_new_collection - * @deprecated - */ -function ocinewcollection($connection, string $type_name, ?string $schema = null): OCICollection|false {} - -/** @param resource $connection */ -function oci_register_taf_callback($connection, ?callable $callback): bool {} - -/** @param resource $connection */ -function oci_unregister_taf_callback($connection): bool {} - -#[\AllowDynamicProperties] -class OCILob { - /** - * @alias oci_lob_save - * @tentative-return-type - */ - public function save(string $data, int $offset = 0): bool {} - - /** - * @alias oci_lob_import - * @tentative-return-type - */ - public function import(string $filename): bool {} - - /** - * @alias oci_lob_import - * @tentative-return-type - */ - public function saveFile(string $filename): bool {} - - /** - * @alias oci_lob_load - * @tentative-return-type - */ - public function load(): string|false {} - - /** - * @alias oci_lob_read - * @tentative-return-type - */ - public function read(int $length): string|false {} - - /** - * @alias oci_lob_eof - * @tentative-return-type - */ - public function eof(): bool {} - - /** - * @alias oci_lob_tell - * @tentative-return-type - */ - public function tell(): int|false {} - - /** - * @alias oci_lob_rewind - * @tentative-return-type - */ - public function rewind(): bool {} - - /** - * @alias oci_lob_seek - * @tentative-return-type - */ - public function seek(int $offset, int $whence = OCI_SEEK_SET): bool {} - - /** - * @alias oci_lob_size - * @tentative-return-type - */ - public function size(): int|false {} - - /** - * @alias oci_lob_write - * @tentative-return-type - */ - public function write(string $data, ?int $length = null): int|false {} - - /** - * @alias oci_lob_append - * @tentative-return-type - */ - public function append(OCILob $from): bool {} - - /** - * @alias oci_lob_truncate - * @tentative-return-type - */ - public function truncate(int $length = 0): bool {} - - /** - * @alias oci_lob_erase - * @tentative-return-type - */ - public function erase(?int $offset = null, ?int $length = null): int|false {} - - /** - * @alias oci_lob_flush - * @tentative-return-type - */ - public function flush(int $flag = 0): bool {} - - /** - * @alias ocisetbufferinglob - * @tentative-return-type - */ - public function setBuffering(bool $mode): bool {} - - /** - * @alias ocigetbufferinglob - * @tentative-return-type - */ - public function getBuffering(): bool {} - - /** - * @alias oci_lob_export - * @tentative-return-type - */ - public function writeToFile(string $filename, ?int $offset = null, ?int $length = null): bool {} - - /** - * @alias oci_lob_export - * @tentative-return-type - */ - public function export(string $filename, ?int $offset = null, ?int $length = null): bool {} - - /** @tentative-return-type */ - public function writeTemporary(string $data, int $type = OCI_TEMP_CLOB): bool {} - - /** @tentative-return-type */ - public function close(): bool {} - - /** - * @alias oci_free_descriptor - * @tentative-return-type - */ - public function free(): bool {} -} - -#[\AllowDynamicProperties] -class OCICollection { - /** - * @alias oci_free_collection - * @tentative-return-type - */ - public function free(): bool {} - - /** - * @alias oci_collection_append - * @tentative-return-type - */ - public function append(string $value): bool {} - - /** - * @alias oci_collection_element_get - * @tentative-return-type - */ - public function getElem(int $index): string|float|null|false {} - - /** - * @alias oci_collection_assign - * @tentative-return-type - */ - public function assign(OCICollection $from): bool {} - - /** - * @alias oci_collection_element_assign - * @tentative-return-type - */ - public function assignElem(int $index, string $value): bool {} - - /** - * @alias oci_collection_size - * @tentative-return-type - */ - public function size(): int|false {} - - /** - * @alias oci_collection_max - * @tentative-return-type - */ - public function max(): int|false {} - - /** - * @alias oci_collection_trim - * @tentative-return-type - */ - public function trim(int $num): bool {} -} diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h deleted file mode 100644 index 111cdec7e989..000000000000 --- a/ext/oci8/oci8_arginfo.h +++ /dev/null @@ -1,924 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. - * Stub hash: 850d4e63296c95a27cdfc1244d63b1ed496acd54 */ - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_define_by_name, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_INFO(0, column, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -#define arginfo_ocidefinebyname arginfo_oci_define_by_name - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_bind_by_name, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_INFO(0, param, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_length, IS_LONG, 0, "-1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -#define arginfo_ocibindbyname arginfo_oci_bind_by_name - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_bind_array_by_name, 0, 4, _IS_BOOL, 0) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_INFO(0, param, IS_STRING, 0) - ZEND_ARG_INFO(1, var) - ZEND_ARG_TYPE_INFO(0, max_array_length, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_item_length, IS_LONG, 0, "-1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "SQLT_AFC") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_free_descriptor, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocifreedesc arginfo_oci_free_descriptor - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_save, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) - ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -#define arginfo_ocisavelob arginfo_oci_lob_save - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_import, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocisavelobfile arginfo_oci_lob_import - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_lob_load, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ociloadlob arginfo_oci_lob_load - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_lob_read, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) - ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_oci_lob_eof arginfo_oci_free_descriptor - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_lob_tell, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) -ZEND_END_ARG_INFO() - -#define arginfo_oci_lob_rewind arginfo_oci_free_descriptor - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_seek, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) - ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, whence, IS_LONG, 0, "OCI_SEEK_SET") -ZEND_END_ARG_INFO() - -#define arginfo_oci_lob_size arginfo_oci_lob_tell - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_lob_write, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) - ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_append, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, to, OCILob, 0) - ZEND_ARG_OBJ_INFO(0, from, OCILob, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_truncate, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_lob_erase, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_flush, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flag, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ocisetbufferinglob, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) - ZEND_ARG_TYPE_INFO(0, mode, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocigetbufferinglob arginfo_oci_free_descriptor - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_copy, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, to, OCILob, 0) - ZEND_ARG_OBJ_INFO(0, from, OCILob, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_is_equal, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, lob1, OCILob, 0) - ZEND_ARG_OBJ_INFO(0, lob2, OCILob, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_export, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, lob, OCILob, 0) - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") -ZEND_END_ARG_INFO() - -#define arginfo_ociwritelobtofile arginfo_oci_lob_export - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_oci_new_descriptor, 0, 1, OCILob, 1) - ZEND_ARG_INFO(0, connection) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "OCI_DTYPE_LOB") -ZEND_END_ARG_INFO() - -#define arginfo_ocinewdescriptor arginfo_oci_new_descriptor - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_rollback, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, connection) -ZEND_END_ARG_INFO() - -#define arginfo_ocirollback arginfo_oci_rollback - -#define arginfo_oci_commit arginfo_oci_rollback - -#define arginfo_ocicommit arginfo_oci_rollback - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_field_name, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL) -ZEND_END_ARG_INFO() - -#define arginfo_ocicolumnname arginfo_oci_field_name - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_field_size, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL) -ZEND_END_ARG_INFO() - -#define arginfo_ocicolumnsize arginfo_oci_field_size - -#define arginfo_oci_field_scale arginfo_oci_field_size - -#define arginfo_ocicolumnscale arginfo_oci_field_size - -#define arginfo_oci_field_precision arginfo_oci_field_size - -#define arginfo_ocicolumnprecision arginfo_oci_field_size - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_field_type, 0, 2, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL) -ZEND_END_ARG_INFO() - -#define arginfo_ocicolumntype arginfo_oci_field_type - -#define arginfo_oci_field_type_raw arginfo_oci_field_size - -#define arginfo_ocicolumntyperaw arginfo_oci_field_size - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_field_is_null, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL) -ZEND_END_ARG_INFO() - -#define arginfo_ocicolumnisnull arginfo_oci_field_is_null - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_execute, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "OCI_COMMIT_ON_SUCCESS") -ZEND_END_ARG_INFO() - -#define arginfo_ociexecute arginfo_oci_execute - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_cancel, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, statement) -ZEND_END_ARG_INFO() - -#define arginfo_ocicancel arginfo_oci_cancel - -#define arginfo_oci_fetch arginfo_oci_cancel - -#define arginfo_ocifetch arginfo_oci_cancel - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ocifetchinto, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_INFO(1, result) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "OCI_NUM") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_fetch_all, 0, 2, IS_LONG, 0) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_INFO(1, output) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, limit, IS_LONG, 0, "-1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "OCI_FETCHSTATEMENT_BY_COLUMN | OCI_ASSOC") -ZEND_END_ARG_INFO() - -#define arginfo_ocifetchstatement arginfo_oci_fetch_all - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_oci_fetch_object, 0, 1, stdClass, MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "OCI_ASSOC | OCI_RETURN_NULLS") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_fetch_row, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) -ZEND_END_ARG_INFO() - -#define arginfo_oci_fetch_assoc arginfo_oci_fetch_row - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_fetch_array, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "OCI_BOTH | OCI_RETURN_NULLS") -ZEND_END_ARG_INFO() - -#define arginfo_oci_free_statement arginfo_oci_cancel - -#define arginfo_ocifreestatement arginfo_oci_cancel - -#define arginfo_oci_free_cursor arginfo_oci_cancel - -#define arginfo_ocifreecursor arginfo_oci_cancel - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_close, 0, 1, _IS_BOOL, 1) - ZEND_ARG_INFO(0, connection) -ZEND_END_ARG_INFO() - -#define arginfo_ocilogoff arginfo_oci_close - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_connect, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, connection_string, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 0, "\"\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, session_mode, IS_LONG, 0, "OCI_DEFAULT") -ZEND_END_ARG_INFO() - -#define arginfo_ocinlogon arginfo_oci_new_connect - -#define arginfo_oci_connect arginfo_oci_new_connect - -#define arginfo_ocilogon arginfo_oci_new_connect - -#define arginfo_oci_pconnect arginfo_oci_new_connect - -#define arginfo_ociplogon arginfo_oci_new_connect - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_error, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, connection_or_statement, "null") -ZEND_END_ARG_INFO() - -#define arginfo_ocierror arginfo_oci_error - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_num_fields, 0, 1, IS_LONG, 0) - ZEND_ARG_INFO(0, statement) -ZEND_END_ARG_INFO() - -#define arginfo_ocinumcols arginfo_oci_num_fields - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_parse, 0, 0, 2) - ZEND_ARG_INFO(0, connection) - ZEND_ARG_TYPE_INFO(0, sql, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ociparse arginfo_oci_parse - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_get_implicit_resultset, 0, 0, 1) - ZEND_ARG_INFO(0, statement) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_prefetch, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocisetprefetch arginfo_oci_set_prefetch - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_prefetch_lob, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_INFO(0, prefetch_lob_size, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_client_identifier, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, connection) - ZEND_ARG_TYPE_INFO(0, client_id, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_edition, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, edition, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_module_name, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, connection) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_action, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, connection) - ZEND_ARG_TYPE_INFO(0, action, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_client_info, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, connection) - ZEND_ARG_TYPE_INFO(0, client_info, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_oci_set_db_operation arginfo_oci_set_action - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_call_timeout, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, connection) - ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_password_change, 0, 0, 4) - ZEND_ARG_INFO(0, connection) - ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, old_password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, new_password, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocipasswordchange arginfo_oci_password_change - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_cursor, 0, 0, 1) - ZEND_ARG_INFO(0, connection) -ZEND_END_ARG_INFO() - -#define arginfo_ocinewcursor arginfo_oci_new_cursor - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_result, 0, 2, IS_MIXED, 0) - ZEND_ARG_INFO(0, statement) - ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL) -ZEND_END_ARG_INFO() - -#define arginfo_ociresult arginfo_oci_result - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_client_version, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_server_version, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, connection) -ZEND_END_ARG_INFO() - -#define arginfo_ociserverversion arginfo_oci_server_version - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_statement_type, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) -ZEND_END_ARG_INFO() - -#define arginfo_ocistatementtype arginfo_oci_statement_type - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_num_rows, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) -ZEND_END_ARG_INFO() - -#define arginfo_ocirowcount arginfo_oci_num_rows - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_free_collection, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, collection, OCICollection, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocifreecollection arginfo_oci_free_collection - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_collection_append, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, collection, OCICollection, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocicollappend arginfo_oci_collection_append - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_collection_element_get, 0, 2, MAY_BE_STRING|MAY_BE_DOUBLE|MAY_BE_NULL|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, collection, OCICollection, 0) - ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocicollgetelem arginfo_oci_collection_element_get - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_collection_assign, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, to, OCICollection, 0) - ZEND_ARG_OBJ_INFO(0, from, OCICollection, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_collection_element_assign, 0, 3, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, collection, OCICollection, 0) - ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocicollassignelem arginfo_oci_collection_element_assign - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_collection_size, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, collection, OCICollection, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocicollsize arginfo_oci_collection_size - -#define arginfo_oci_collection_max arginfo_oci_collection_size - -#define arginfo_ocicollmax arginfo_oci_collection_size - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_collection_trim, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, collection, OCICollection, 0) - ZEND_ARG_TYPE_INFO(0, num, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_ocicolltrim arginfo_oci_collection_trim - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_oci_new_collection, 0, 2, OCICollection, MAY_BE_FALSE) - ZEND_ARG_INFO(0, connection) - ZEND_ARG_TYPE_INFO(0, type_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, schema, IS_STRING, 1, "null") -ZEND_END_ARG_INFO() - -#define arginfo_ocinewcollection arginfo_oci_new_collection - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_register_taf_callback, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, connection) - ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1) -ZEND_END_ARG_INFO() - -#define arginfo_oci_unregister_taf_callback arginfo_oci_rollback - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_save, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_import, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_OCILob_saveFile arginfo_class_OCILob_import - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCILob_load, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCILob_read, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_eof, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCILob_tell, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) -ZEND_END_ARG_INFO() - -#define arginfo_class_OCILob_rewind arginfo_class_OCILob_eof - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_seek, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, whence, IS_LONG, 0, "OCI_SEEK_SET") -ZEND_END_ARG_INFO() - -#define arginfo_class_OCILob_size arginfo_class_OCILob_tell - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCILob_write, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_append, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, from, OCILob, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_truncate, 0, 0, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCILob_erase, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_flush, 0, 0, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flag, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_setBuffering, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, mode, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_OCILob_getBuffering arginfo_class_OCILob_eof - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_writeToFile, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") -ZEND_END_ARG_INFO() - -#define arginfo_class_OCILob_export arginfo_class_OCILob_writeToFile - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_writeTemporary, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "OCI_TEMP_CLOB") -ZEND_END_ARG_INFO() - -#define arginfo_class_OCILob_close arginfo_class_OCILob_eof - -#define arginfo_class_OCILob_free arginfo_class_OCILob_eof - -#define arginfo_class_OCICollection_free arginfo_class_OCILob_eof - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCICollection_append, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCICollection_getElem, 0, 1, MAY_BE_STRING|MAY_BE_DOUBLE|MAY_BE_NULL|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCICollection_assign, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, from, OCICollection, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCICollection_assignElem, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_OCICollection_size arginfo_class_OCILob_tell - -#define arginfo_class_OCICollection_max arginfo_class_OCILob_tell - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCICollection_trim, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, num, IS_LONG, 0) -ZEND_END_ARG_INFO() - - -ZEND_FUNCTION(oci_define_by_name); -ZEND_FUNCTION(oci_bind_by_name); -ZEND_FUNCTION(oci_bind_array_by_name); -ZEND_FUNCTION(oci_free_descriptor); -ZEND_FUNCTION(oci_lob_save); -ZEND_FUNCTION(oci_lob_import); -ZEND_FUNCTION(oci_lob_load); -ZEND_FUNCTION(oci_lob_read); -ZEND_FUNCTION(oci_lob_eof); -ZEND_FUNCTION(oci_lob_tell); -ZEND_FUNCTION(oci_lob_rewind); -ZEND_FUNCTION(oci_lob_seek); -ZEND_FUNCTION(oci_lob_size); -ZEND_FUNCTION(oci_lob_write); -ZEND_FUNCTION(oci_lob_append); -ZEND_FUNCTION(oci_lob_truncate); -ZEND_FUNCTION(oci_lob_erase); -ZEND_FUNCTION(oci_lob_flush); -ZEND_FUNCTION(ocisetbufferinglob); -ZEND_FUNCTION(ocigetbufferinglob); -ZEND_FUNCTION(oci_lob_copy); -ZEND_FUNCTION(oci_lob_is_equal); -ZEND_FUNCTION(oci_lob_export); -ZEND_FUNCTION(oci_new_descriptor); -ZEND_FUNCTION(oci_rollback); -ZEND_FUNCTION(oci_commit); -ZEND_FUNCTION(oci_field_name); -ZEND_FUNCTION(oci_field_size); -ZEND_FUNCTION(oci_field_scale); -ZEND_FUNCTION(oci_field_precision); -ZEND_FUNCTION(oci_field_type); -ZEND_FUNCTION(oci_field_type_raw); -ZEND_FUNCTION(oci_field_is_null); -ZEND_FUNCTION(oci_execute); -ZEND_FUNCTION(oci_cancel); -ZEND_FUNCTION(oci_fetch); -ZEND_FUNCTION(ocifetchinto); -ZEND_FUNCTION(oci_fetch_all); -ZEND_FUNCTION(oci_fetch_object); -ZEND_FUNCTION(oci_fetch_row); -ZEND_FUNCTION(oci_fetch_assoc); -ZEND_FUNCTION(oci_fetch_array); -ZEND_FUNCTION(oci_free_statement); -ZEND_FUNCTION(oci_close); -ZEND_FUNCTION(oci_new_connect); -ZEND_FUNCTION(oci_connect); -ZEND_FUNCTION(oci_pconnect); -ZEND_FUNCTION(oci_error); -ZEND_FUNCTION(oci_num_fields); -ZEND_FUNCTION(oci_parse); -ZEND_FUNCTION(oci_get_implicit_resultset); -ZEND_FUNCTION(oci_set_prefetch); -ZEND_FUNCTION(oci_set_prefetch_lob); -ZEND_FUNCTION(oci_set_client_identifier); -ZEND_FUNCTION(oci_set_edition); -ZEND_FUNCTION(oci_set_module_name); -ZEND_FUNCTION(oci_set_action); -ZEND_FUNCTION(oci_set_client_info); -ZEND_FUNCTION(oci_set_db_operation); -ZEND_FUNCTION(oci_set_call_timeout); -ZEND_FUNCTION(oci_password_change); -ZEND_FUNCTION(oci_new_cursor); -ZEND_FUNCTION(oci_result); -ZEND_FUNCTION(oci_client_version); -ZEND_FUNCTION(oci_server_version); -ZEND_FUNCTION(oci_statement_type); -ZEND_FUNCTION(oci_num_rows); -ZEND_FUNCTION(oci_free_collection); -ZEND_FUNCTION(oci_collection_append); -ZEND_FUNCTION(oci_collection_element_get); -ZEND_FUNCTION(oci_collection_assign); -ZEND_FUNCTION(oci_collection_element_assign); -ZEND_FUNCTION(oci_collection_size); -ZEND_FUNCTION(oci_collection_max); -ZEND_FUNCTION(oci_collection_trim); -ZEND_FUNCTION(oci_new_collection); -ZEND_FUNCTION(oci_register_taf_callback); -ZEND_FUNCTION(oci_unregister_taf_callback); -ZEND_METHOD(OCILob, writeTemporary); -ZEND_METHOD(OCILob, close); - - -static const zend_function_entry ext_functions[] = { - ZEND_FE(oci_define_by_name, arginfo_oci_define_by_name) - ZEND_DEP_FALIAS(ocidefinebyname, oci_define_by_name, arginfo_ocidefinebyname) - ZEND_FE(oci_bind_by_name, arginfo_oci_bind_by_name) - ZEND_DEP_FALIAS(ocibindbyname, oci_bind_by_name, arginfo_ocibindbyname) - ZEND_FE(oci_bind_array_by_name, arginfo_oci_bind_array_by_name) - ZEND_FE(oci_free_descriptor, arginfo_oci_free_descriptor) - ZEND_DEP_FALIAS(ocifreedesc, oci_free_descriptor, arginfo_ocifreedesc) - ZEND_FE(oci_lob_save, arginfo_oci_lob_save) - ZEND_DEP_FALIAS(ocisavelob, oci_lob_save, arginfo_ocisavelob) - ZEND_FE(oci_lob_import, arginfo_oci_lob_import) - ZEND_DEP_FALIAS(ocisavelobfile, oci_lob_import, arginfo_ocisavelobfile) - ZEND_FE(oci_lob_load, arginfo_oci_lob_load) - ZEND_DEP_FALIAS(ociloadlob, oci_lob_load, arginfo_ociloadlob) - ZEND_FE(oci_lob_read, arginfo_oci_lob_read) - ZEND_FE(oci_lob_eof, arginfo_oci_lob_eof) - ZEND_FE(oci_lob_tell, arginfo_oci_lob_tell) - ZEND_FE(oci_lob_rewind, arginfo_oci_lob_rewind) - ZEND_FE(oci_lob_seek, arginfo_oci_lob_seek) - ZEND_FE(oci_lob_size, arginfo_oci_lob_size) - ZEND_FE(oci_lob_write, arginfo_oci_lob_write) - ZEND_FE(oci_lob_append, arginfo_oci_lob_append) - ZEND_FE(oci_lob_truncate, arginfo_oci_lob_truncate) - ZEND_FE(oci_lob_erase, arginfo_oci_lob_erase) - ZEND_FE(oci_lob_flush, arginfo_oci_lob_flush) - ZEND_FE(ocisetbufferinglob, arginfo_ocisetbufferinglob) - ZEND_FE(ocigetbufferinglob, arginfo_ocigetbufferinglob) - ZEND_FE(oci_lob_copy, arginfo_oci_lob_copy) - ZEND_FE(oci_lob_is_equal, arginfo_oci_lob_is_equal) - ZEND_FE(oci_lob_export, arginfo_oci_lob_export) - ZEND_DEP_FALIAS(ociwritelobtofile, oci_lob_export, arginfo_ociwritelobtofile) - ZEND_FE(oci_new_descriptor, arginfo_oci_new_descriptor) - ZEND_DEP_FALIAS(ocinewdescriptor, oci_new_descriptor, arginfo_ocinewdescriptor) - ZEND_FE(oci_rollback, arginfo_oci_rollback) - ZEND_DEP_FALIAS(ocirollback, oci_rollback, arginfo_ocirollback) - ZEND_FE(oci_commit, arginfo_oci_commit) - ZEND_DEP_FALIAS(ocicommit, oci_commit, arginfo_ocicommit) - ZEND_FE(oci_field_name, arginfo_oci_field_name) - ZEND_DEP_FALIAS(ocicolumnname, oci_field_name, arginfo_ocicolumnname) - ZEND_FE(oci_field_size, arginfo_oci_field_size) - ZEND_DEP_FALIAS(ocicolumnsize, oci_field_size, arginfo_ocicolumnsize) - ZEND_FE(oci_field_scale, arginfo_oci_field_scale) - ZEND_DEP_FALIAS(ocicolumnscale, oci_field_scale, arginfo_ocicolumnscale) - ZEND_FE(oci_field_precision, arginfo_oci_field_precision) - ZEND_DEP_FALIAS(ocicolumnprecision, oci_field_precision, arginfo_ocicolumnprecision) - ZEND_FE(oci_field_type, arginfo_oci_field_type) - ZEND_DEP_FALIAS(ocicolumntype, oci_field_type, arginfo_ocicolumntype) - ZEND_FE(oci_field_type_raw, arginfo_oci_field_type_raw) - ZEND_DEP_FALIAS(ocicolumntyperaw, oci_field_type_raw, arginfo_ocicolumntyperaw) - ZEND_FE(oci_field_is_null, arginfo_oci_field_is_null) - ZEND_DEP_FALIAS(ocicolumnisnull, oci_field_is_null, arginfo_ocicolumnisnull) - ZEND_FE(oci_execute, arginfo_oci_execute) - ZEND_DEP_FALIAS(ociexecute, oci_execute, arginfo_ociexecute) - ZEND_FE(oci_cancel, arginfo_oci_cancel) - ZEND_DEP_FALIAS(ocicancel, oci_cancel, arginfo_ocicancel) - ZEND_FE(oci_fetch, arginfo_oci_fetch) - ZEND_DEP_FALIAS(ocifetch, oci_fetch, arginfo_ocifetch) - ZEND_DEP_FE(ocifetchinto, arginfo_ocifetchinto) - ZEND_FE(oci_fetch_all, arginfo_oci_fetch_all) - ZEND_DEP_FALIAS(ocifetchstatement, oci_fetch_all, arginfo_ocifetchstatement) - ZEND_FE(oci_fetch_object, arginfo_oci_fetch_object) - ZEND_FE(oci_fetch_row, arginfo_oci_fetch_row) - ZEND_FE(oci_fetch_assoc, arginfo_oci_fetch_assoc) - ZEND_FE(oci_fetch_array, arginfo_oci_fetch_array) - ZEND_FE(oci_free_statement, arginfo_oci_free_statement) - ZEND_DEP_FALIAS(ocifreestatement, oci_free_statement, arginfo_ocifreestatement) - ZEND_FALIAS(oci_free_cursor, oci_free_statement, arginfo_oci_free_cursor) - ZEND_DEP_FALIAS(ocifreecursor, oci_free_statement, arginfo_ocifreecursor) - ZEND_FE(oci_close, arginfo_oci_close) - ZEND_DEP_FALIAS(ocilogoff, oci_close, arginfo_ocilogoff) - ZEND_FE(oci_new_connect, arginfo_oci_new_connect) - ZEND_DEP_FALIAS(ocinlogon, oci_new_connect, arginfo_ocinlogon) - ZEND_FE(oci_connect, arginfo_oci_connect) - ZEND_DEP_FALIAS(ocilogon, oci_connect, arginfo_ocilogon) - ZEND_FE(oci_pconnect, arginfo_oci_pconnect) - ZEND_DEP_FALIAS(ociplogon, oci_pconnect, arginfo_ociplogon) - ZEND_FE(oci_error, arginfo_oci_error) - ZEND_DEP_FALIAS(ocierror, oci_error, arginfo_ocierror) - ZEND_FE(oci_num_fields, arginfo_oci_num_fields) - ZEND_DEP_FALIAS(ocinumcols, oci_num_fields, arginfo_ocinumcols) - ZEND_FE(oci_parse, arginfo_oci_parse) - ZEND_DEP_FALIAS(ociparse, oci_parse, arginfo_ociparse) - ZEND_FE(oci_get_implicit_resultset, arginfo_oci_get_implicit_resultset) - ZEND_FE(oci_set_prefetch, arginfo_oci_set_prefetch) - ZEND_DEP_FALIAS(ocisetprefetch, oci_set_prefetch, arginfo_ocisetprefetch) - ZEND_FE(oci_set_prefetch_lob, arginfo_oci_set_prefetch_lob) - ZEND_FE(oci_set_client_identifier, arginfo_oci_set_client_identifier) - ZEND_FE(oci_set_edition, arginfo_oci_set_edition) - ZEND_FE(oci_set_module_name, arginfo_oci_set_module_name) - ZEND_FE(oci_set_action, arginfo_oci_set_action) - ZEND_FE(oci_set_client_info, arginfo_oci_set_client_info) - ZEND_FE(oci_set_db_operation, arginfo_oci_set_db_operation) - ZEND_FE(oci_set_call_timeout, arginfo_oci_set_call_timeout) - ZEND_FE(oci_password_change, arginfo_oci_password_change) - ZEND_DEP_FALIAS(ocipasswordchange, oci_password_change, arginfo_ocipasswordchange) - ZEND_FE(oci_new_cursor, arginfo_oci_new_cursor) - ZEND_DEP_FALIAS(ocinewcursor, oci_new_cursor, arginfo_ocinewcursor) - ZEND_FE(oci_result, arginfo_oci_result) - ZEND_DEP_FALIAS(ociresult, oci_result, arginfo_ociresult) - ZEND_FE(oci_client_version, arginfo_oci_client_version) - ZEND_FE(oci_server_version, arginfo_oci_server_version) - ZEND_DEP_FALIAS(ociserverversion, oci_server_version, arginfo_ociserverversion) - ZEND_FE(oci_statement_type, arginfo_oci_statement_type) - ZEND_DEP_FALIAS(ocistatementtype, oci_statement_type, arginfo_ocistatementtype) - ZEND_FE(oci_num_rows, arginfo_oci_num_rows) - ZEND_DEP_FALIAS(ocirowcount, oci_num_rows, arginfo_ocirowcount) - ZEND_FE(oci_free_collection, arginfo_oci_free_collection) - ZEND_DEP_FALIAS(ocifreecollection, oci_free_collection, arginfo_ocifreecollection) - ZEND_FE(oci_collection_append, arginfo_oci_collection_append) - ZEND_DEP_FALIAS(ocicollappend, oci_collection_append, arginfo_ocicollappend) - ZEND_FE(oci_collection_element_get, arginfo_oci_collection_element_get) - ZEND_DEP_FALIAS(ocicollgetelem, oci_collection_element_get, arginfo_ocicollgetelem) - ZEND_FE(oci_collection_assign, arginfo_oci_collection_assign) - ZEND_FE(oci_collection_element_assign, arginfo_oci_collection_element_assign) - ZEND_DEP_FALIAS(ocicollassignelem, oci_collection_element_assign, arginfo_ocicollassignelem) - ZEND_FE(oci_collection_size, arginfo_oci_collection_size) - ZEND_DEP_FALIAS(ocicollsize, oci_collection_size, arginfo_ocicollsize) - ZEND_FE(oci_collection_max, arginfo_oci_collection_max) - ZEND_DEP_FALIAS(ocicollmax, oci_collection_max, arginfo_ocicollmax) - ZEND_FE(oci_collection_trim, arginfo_oci_collection_trim) - ZEND_DEP_FALIAS(ocicolltrim, oci_collection_trim, arginfo_ocicolltrim) - ZEND_FE(oci_new_collection, arginfo_oci_new_collection) - ZEND_DEP_FALIAS(ocinewcollection, oci_new_collection, arginfo_ocinewcollection) - ZEND_FE(oci_register_taf_callback, arginfo_oci_register_taf_callback) - ZEND_FE(oci_unregister_taf_callback, arginfo_oci_unregister_taf_callback) - ZEND_FE_END -}; - - -static const zend_function_entry class_OCILob_methods[] = { - ZEND_ME_MAPPING(save, oci_lob_save, arginfo_class_OCILob_save, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(import, oci_lob_import, arginfo_class_OCILob_import, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(saveFile, oci_lob_import, arginfo_class_OCILob_saveFile, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(load, oci_lob_load, arginfo_class_OCILob_load, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(read, oci_lob_read, arginfo_class_OCILob_read, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(eof, oci_lob_eof, arginfo_class_OCILob_eof, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(tell, oci_lob_tell, arginfo_class_OCILob_tell, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(rewind, oci_lob_rewind, arginfo_class_OCILob_rewind, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(seek, oci_lob_seek, arginfo_class_OCILob_seek, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(size, oci_lob_size, arginfo_class_OCILob_size, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(write, oci_lob_write, arginfo_class_OCILob_write, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(append, oci_lob_append, arginfo_class_OCILob_append, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(truncate, oci_lob_truncate, arginfo_class_OCILob_truncate, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(erase, oci_lob_erase, arginfo_class_OCILob_erase, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(flush, oci_lob_flush, arginfo_class_OCILob_flush, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(setBuffering, ocisetbufferinglob, arginfo_class_OCILob_setBuffering, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(getBuffering, ocigetbufferinglob, arginfo_class_OCILob_getBuffering, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(writeToFile, oci_lob_export, arginfo_class_OCILob_writeToFile, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(export, oci_lob_export, arginfo_class_OCILob_export, ZEND_ACC_PUBLIC) - ZEND_ME(OCILob, writeTemporary, arginfo_class_OCILob_writeTemporary, ZEND_ACC_PUBLIC) - ZEND_ME(OCILob, close, arginfo_class_OCILob_close, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(free, oci_free_descriptor, arginfo_class_OCILob_free, ZEND_ACC_PUBLIC) - ZEND_FE_END -}; - - -static const zend_function_entry class_OCICollection_methods[] = { - ZEND_ME_MAPPING(free, oci_free_collection, arginfo_class_OCICollection_free, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(append, oci_collection_append, arginfo_class_OCICollection_append, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(getElem, oci_collection_element_get, arginfo_class_OCICollection_getElem, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(assign, oci_collection_assign, arginfo_class_OCICollection_assign, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(assignElem, oci_collection_element_assign, arginfo_class_OCICollection_assignElem, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(size, oci_collection_size, arginfo_class_OCICollection_size, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(max, oci_collection_max, arginfo_class_OCICollection_max, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(trim, oci_collection_trim, arginfo_class_OCICollection_trim, ZEND_ACC_PUBLIC) - ZEND_FE_END -}; - -static void register_oci8_symbols(int module_number) -{ - REGISTER_LONG_CONSTANT("OCI_DEFAULT", OCI_DEFAULT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_SYSOPER", OCI_SYSOPER, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_SYSDBA", OCI_SYSDBA, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_CRED_EXT", PHP_OCI_CRED_EXT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_DESCRIBE_ONLY", OCI_DESCRIBE_ONLY, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_COMMIT_ON_SUCCESS", OCI_COMMIT_ON_SUCCESS, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_NO_AUTO_COMMIT", OCI_DEFAULT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_EXACT_FETCH", OCI_EXACT_FETCH, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_SEEK_SET", PHP_OCI_SEEK_SET, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_SEEK_CUR", PHP_OCI_SEEK_CUR, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_SEEK_END", PHP_OCI_SEEK_END, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_LOB_BUFFER_FREE", OCI_LOB_BUFFER_FREE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_BFILEE", SQLT_BFILEE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_CFILEE", SQLT_CFILEE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_CLOB", SQLT_CLOB, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_BLOB", SQLT_BLOB, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_RDD", SQLT_RDD, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_INT", SQLT_INT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_NUM", SQLT_NUM, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_RSET", SQLT_RSET, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_AFC", SQLT_AFC, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_CHR", SQLT_CHR, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_VCS", SQLT_VCS, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_AVC", SQLT_AVC, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_STR", SQLT_STR, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_LVC", SQLT_LVC, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_FLT", SQLT_FLT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_UIN", SQLT_UIN, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_LNG", SQLT_LNG, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_LBI", SQLT_LBI, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_BIN", SQLT_BIN, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_ODT", SQLT_ODT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_BDOUBLE", SQLT_BDOUBLE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_BFLOAT", SQLT_BFLOAT, CONST_PERSISTENT); -#if OCI_MAJOR_VERSION >= 12 - REGISTER_LONG_CONSTANT("SQLT_BOL", SQLT_BOL, CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("OCI_B_NTY", SQLT_NTY, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SQLT_NTY", SQLT_NTY, CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("OCI_SYSDATE", "SYSDATE", CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_BFILE", SQLT_BFILEE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_CFILEE", SQLT_CFILEE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_CLOB", SQLT_CLOB, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_BLOB", SQLT_BLOB, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_ROWID", SQLT_RDD, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_CURSOR", SQLT_RSET, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_BIN", SQLT_BIN, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_INT", SQLT_INT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_B_NUM", SQLT_NUM, CONST_PERSISTENT); -#if OCI_MAJOR_VERSION >= 12 - REGISTER_LONG_CONSTANT("OCI_B_BOL", SQLT_BOL, CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("OCI_FETCHSTATEMENT_BY_COLUMN", PHP_OCI_FETCHSTATEMENT_BY_COLUMN, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FETCHSTATEMENT_BY_ROW", PHP_OCI_FETCHSTATEMENT_BY_ROW, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_ASSOC", PHP_OCI_ASSOC, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_NUM", PHP_OCI_NUM, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_BOTH", PHP_OCI_BOTH, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_RETURN_NULLS", PHP_OCI_RETURN_NULLS, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_RETURN_LOBS", PHP_OCI_RETURN_LOBS, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_DTYPE_FILE", OCI_DTYPE_FILE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_DTYPE_LOB", OCI_DTYPE_LOB, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_DTYPE_ROWID", OCI_DTYPE_ROWID, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_D_FILE", OCI_DTYPE_FILE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_D_LOB", OCI_DTYPE_LOB, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_D_ROWID", OCI_DTYPE_ROWID, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_TEMP_CLOB", OCI_TEMP_CLOB, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_TEMP_BLOB", OCI_TEMP_BLOB, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FO_END", OCI_FO_END, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FO_ABORT", OCI_FO_ABORT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FO_REAUTH", OCI_FO_REAUTH, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FO_BEGIN", OCI_FO_BEGIN, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FO_ERROR", OCI_FO_ERROR, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FO_NONE", OCI_FO_NONE, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FO_SESSION", OCI_FO_SESSION, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FO_SELECT", OCI_FO_SELECT, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FO_TXNAL", OCI_FO_TXNAL, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("OCI_FO_RETRY", OCI_FO_RETRY, CONST_PERSISTENT); - - - zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "oci_new_connect", sizeof("oci_new_connect") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); - - zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "ocinlogon", sizeof("ocinlogon") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); - - zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "oci_connect", sizeof("oci_connect") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); - - zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "ocilogon", sizeof("ocilogon") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); - - zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "oci_pconnect", sizeof("oci_pconnect") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); - - zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "ociplogon", sizeof("ociplogon") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); -} - -static zend_class_entry *register_class_OCILob(void) -{ - zend_class_entry ce, *class_entry; - - INIT_CLASS_ENTRY(ce, "OCILob", class_OCILob_methods); - class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES; - - zend_string *attribute_name_AllowDynamicProperties_class_OCILob_0 = zend_string_init_interned("AllowDynamicProperties", sizeof("AllowDynamicProperties") - 1, 1); - zend_add_class_attribute(class_entry, attribute_name_AllowDynamicProperties_class_OCILob_0, 0); - zend_string_release(attribute_name_AllowDynamicProperties_class_OCILob_0); - - return class_entry; -} - -static zend_class_entry *register_class_OCICollection(void) -{ - zend_class_entry ce, *class_entry; - - INIT_CLASS_ENTRY(ce, "OCICollection", class_OCICollection_methods); - class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES; - - zend_string *attribute_name_AllowDynamicProperties_class_OCICollection_0 = zend_string_init_interned("AllowDynamicProperties", sizeof("AllowDynamicProperties") - 1, 1); - zend_add_class_attribute(class_entry, attribute_name_AllowDynamicProperties_class_OCICollection_0, 0); - zend_string_release(attribute_name_AllowDynamicProperties_class_OCICollection_0); - - return class_entry; -} diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c deleted file mode 100644 index dcad33564751..000000000000 --- a/ext/oci8/oci8_collection.c +++ /dev/null @@ -1,806 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | - | Thies C. Arntzen | - | | - | Collection support by Andy Sautins | - | Temporary LOB support by David Benson | - | ZTS per process OCIPLogon by Harald Radi | - | | - | Redesigned by: Antony Dovgal | - | Andi Gutmans | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" - -#ifdef HAVE_OCI8 - -#include "php_oci8.h" -#include "php_oci8_int.h" - -/* {{{ php_oci_collection_create() - Create and return connection handle */ -php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len) -{ - dvoid *dschp1 = NULL; - dvoid *parmp1; - dvoid *parmp2; - php_oci_collection *collection; - sword errstatus; - - collection = emalloc(sizeof(php_oci_collection)); - - collection->connection = connection; - collection->collection = NULL; - GC_ADDREF(collection->connection->id); - - /* get type handle by name */ - PHP_OCI_CALL_RETURN(errstatus, OCITypeByName, - ( - connection->env, - connection->err, - connection->svc, - (text *) schema, - (ub4) schema_len, - (text *) tdo, - (ub4) tdo_len, - (CONST text *) 0, - (ub4) 0, - OCI_DURATION_SESSION, - OCI_TYPEGET_ALL, - &(collection->tdo) - ) - ); - - if (errstatus != OCI_SUCCESS) { - goto CLEANUP; - } - - /* allocate describe handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (connection->env, (dvoid **) &dschp1, (ub4) OCI_HTYPE_DESCRIBE, (size_t) 0, (dvoid **) 0)); - - if (errstatus != OCI_SUCCESS) { - goto CLEANUP; - } - - /* describe TDO */ - PHP_OCI_CALL_RETURN(errstatus, OCIDescribeAny, - ( - connection->svc, - connection->err, - (dvoid *) collection->tdo, - (ub4) 0, - OCI_OTYPE_PTR, - (ub1) OCI_DEFAULT, - (ub1) OCI_PTYPE_TYPE, - dschp1 - ) - ); - - if (errstatus != OCI_SUCCESS) { - goto CLEANUP; - } - - /* get first parameter handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *) dschp1, (ub4) OCI_HTYPE_DESCRIBE, (dvoid *)&parmp1, (ub4 *)0, (ub4)OCI_ATTR_PARAM, connection->err)); - - if (errstatus != OCI_SUCCESS) { - goto CLEANUP; - } - - /* get the collection type code of the attribute */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, - ( - (dvoid*) parmp1, - (ub4) OCI_DTYPE_PARAM, - (dvoid*) &(collection->coll_typecode), - (ub4 *) 0, - (ub4) OCI_ATTR_COLLECTION_TYPECODE, - connection->err - ) - ); - - if (errstatus != OCI_SUCCESS) { - goto CLEANUP; - } - - switch(collection->coll_typecode) { - case OCI_TYPECODE_TABLE: - case OCI_TYPECODE_VARRAY: - /* get collection element handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, - ( - (dvoid*) parmp1, - (ub4) OCI_DTYPE_PARAM, - (dvoid*) &parmp2, - (ub4 *) 0, - (ub4) OCI_ATTR_COLLECTION_ELEMENT, - connection->err - ) - ); - - if (errstatus != OCI_SUCCESS) { - goto CLEANUP; - } - - /* get REF of the TDO for the type */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, - ( - (dvoid*) parmp2, - (ub4) OCI_DTYPE_PARAM, - (dvoid*) &(collection->elem_ref), - (ub4 *) 0, - (ub4) OCI_ATTR_REF_TDO, - connection->err - ) - ); - - if (errstatus != OCI_SUCCESS) { - goto CLEANUP; - } - - /* get the TDO (only header) */ - PHP_OCI_CALL_RETURN(errstatus, OCITypeByRef, - ( - connection->env, - connection->err, - collection->elem_ref, - OCI_DURATION_SESSION, - OCI_TYPEGET_HEADER, - &(collection->element_type) - ) - ); - - if (errstatus != OCI_SUCCESS) { - goto CLEANUP; - } - - /* get typecode */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, - ( - (dvoid*) parmp2, - (ub4) OCI_DTYPE_PARAM, - (dvoid*) &(collection->element_typecode), - (ub4 *) 0, - (ub4) OCI_ATTR_TYPECODE, - connection->err - ) - ); - - if (errstatus != OCI_SUCCESS) { - goto CLEANUP; - } - break; - /* we only support VARRAYs and TABLEs */ - default: - php_error_docref(NULL, E_WARNING, "Unknown collection type %d", collection->coll_typecode); - break; - } - - /* Create object to hold return table */ - PHP_OCI_CALL_RETURN(errstatus, OCIObjectNew, - ( - connection->env, - connection->err, - connection->svc, - OCI_TYPECODE_TABLE, - collection->tdo, - (dvoid *)0, - OCI_DURATION_DEFAULT, - TRUE, - (dvoid **) &(collection->collection) - ) - ); - - if (errstatus != OCI_SUCCESS) { - goto CLEANUP; - } - - /* free the describe handle (Bug #44113) */ - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1, OCI_HTYPE_DESCRIBE)); - PHP_OCI_REGISTER_RESOURCE(collection, le_collection); - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return collection; - -CLEANUP: - - if (dschp1) { - /* free the describe handle (Bug #44113) */ - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1, OCI_HTYPE_DESCRIBE)); - } - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - php_oci_collection_close(collection); - return NULL; -} -/* }}} */ - -/* {{{ php_oci_collection_size() - Return size of the collection */ -int php_oci_collection_size(php_oci_collection *collection, sb4 *size) -{ - php_oci_connection *connection = collection->connection; - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_max() - Return max number of elements in the collection */ -int php_oci_collection_max(php_oci_collection *collection, zend_long *max) -{ - php_oci_connection *connection = collection->connection; - - PHP_OCI_CALL_RETURN(*max, OCICollMax, (connection->env, collection->collection)); - - /* error handling is not necessary here? */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_trim() - Trim collection to the given number of elements */ -int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size) -{ - php_oci_connection *connection = collection->connection; - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCICollTrim, (connection->env, connection->err, (sb4) trim_size, collection->collection)); - - if (errstatus != OCI_SUCCESS) { - errstatus = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_append_null() - Append NULL element to the end of the collection */ -int php_oci_collection_append_null(php_oci_collection *collection) -{ - OCIInd null_index = OCI_IND_NULL; - php_oci_connection *connection = collection->connection; - sword errstatus; - - /* append NULL element */ - PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, (connection->env, connection->err, (dvoid *)0, &null_index, collection->collection)); - - if (errstatus != OCI_SUCCESS) { - errstatus = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_append_date() - Append DATE element to the end of the collection (use "DD-MON-YY" format) */ -int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len) -{ - OCIInd new_index = OCI_IND_NOTNULL; - OCIDate oci_date; - php_oci_connection *connection = collection->connection; - sword errstatus; - - /* format and language are NULLs, so format is "DD-MON-YY" and language is the default language of the session */ - PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date)); - - if (errstatus != OCI_SUCCESS) { - /* failed to convert string to date */ - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, - ( - connection->env, - connection->err, - (dvoid *) &oci_date, - (dvoid *) &new_index, - (OCIColl *) collection->collection - ) - ); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_append_number() - Append NUMBER to the end of the collection */ -int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len) -{ - OCIInd new_index = OCI_IND_NOTNULL; - double element_double; - OCINumber oci_number; - php_oci_connection *connection = collection->connection; - sword errstatus; - - element_double = zend_strtod(number, NULL); - - PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, - ( - connection->env, - connection->err, - (dvoid *) &oci_number, - (dvoid *) &new_index, - (OCIColl *) collection->collection - ) - ); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_append_string() - Append STRING to the end of the collection */ -int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len) -{ - OCIInd new_index = OCI_IND_NOTNULL; - OCIString *ocistr = (OCIString *)0; - php_oci_connection *connection = collection->connection; - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, - ( - connection->env, - connection->err, - (dvoid *) ocistr, - (dvoid *) &new_index, - (OCIColl *) collection->collection - ) - ); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_append() - Append wrapper. Appends any supported element to the end of the collection */ -int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len) -{ - if (element_len == 0) { - return php_oci_collection_append_null(collection); - } - - switch(collection->element_typecode) { - case OCI_TYPECODE_DATE: - return php_oci_collection_append_date(collection, element, element_len); - break; - - case OCI_TYPECODE_VARCHAR2 : - return php_oci_collection_append_string(collection, element, element_len); - break; - - case OCI_TYPECODE_UNSIGNED16 : /* UNSIGNED SHORT */ - case OCI_TYPECODE_UNSIGNED32 : /* UNSIGNED LONG */ - case OCI_TYPECODE_REAL : /* REAL */ - case OCI_TYPECODE_DOUBLE : /* DOUBLE */ - case OCI_TYPECODE_INTEGER : /* INT */ - case OCI_TYPECODE_SIGNED16 : /* SHORT */ - case OCI_TYPECODE_SIGNED32 : /* LONG */ - case OCI_TYPECODE_DECIMAL : /* DECIMAL */ - case OCI_TYPECODE_FLOAT : /* FLOAT */ - case OCI_TYPECODE_NUMBER : /* NUMBER */ - case OCI_TYPECODE_SMALLINT : /* SMALLINT */ - return php_oci_collection_append_number(collection, element, element_len); - break; - - default: - php_error_docref(NULL, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode); - return 1; - break; - } - /* never reached */ - return 1; -} -/* }}} */ - -/* {{{ php_oci_collection_element_get() - Get the element with the given index */ -int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element) -{ - php_oci_connection *connection = collection->connection; - dvoid *element; - OCIInd *element_index; - boolean exists; - oratext buff[1024]; - ub4 buff_len = 1024; - sword errstatus; - - ZVAL_NULL(result_element); - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - - PHP_OCI_CALL_RETURN(errstatus, OCICollGetElem, - ( - connection->env, - connection->err, - collection->collection, - (ub4)index, - &exists, - &element, - (dvoid **)&element_index - ) - ); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - if (exists == 0) { - /* element doesn't exist */ - return 1; - } - - if (*element_index == OCI_IND_NULL) { - /* this is not an error, we're returning NULL here */ - return 0; - } - - switch (collection->element_typecode) { - case OCI_TYPECODE_DATE: - PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - ZVAL_STRINGL(result_element, (char *)buff, buff_len); - Z_STRVAL_P(result_element)[buff_len] = '\0'; - - return 0; - break; - - case OCI_TYPECODE_VARCHAR2: - { - OCIString *oci_string = *(OCIString **)element; - text *str; - - PHP_OCI_CALL_RETURN(str, OCIStringPtr, (connection->env, oci_string)); - - if (str) { - ZVAL_STRING(result_element, (char *)str); - } - return 0; - } - break; - - case OCI_TYPECODE_UNSIGNED16: /* UNSIGNED SHORT */ - case OCI_TYPECODE_UNSIGNED32: /* UNSIGNED LONG */ - case OCI_TYPECODE_REAL: /* REAL */ - case OCI_TYPECODE_DOUBLE: /* DOUBLE */ - case OCI_TYPECODE_INTEGER: /* INT */ - case OCI_TYPECODE_SIGNED16: /* SHORT */ - case OCI_TYPECODE_SIGNED32: /* LONG */ - case OCI_TYPECODE_DECIMAL: /* DECIMAL */ - case OCI_TYPECODE_FLOAT: /* FLOAT */ - case OCI_TYPECODE_NUMBER: /* NUMBER */ - case OCI_TYPECODE_SMALLINT: /* SMALLINT */ - { - double double_number; - - PHP_OCI_CALL_RETURN(errstatus, OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - ZVAL_DOUBLE(result_element, double_number); - - return 0; - } - break; - default: - php_error_docref(NULL, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode); - return 1; - break; - } - /* never reached */ - return 1; -} -/* }}} */ - -/* {{{ php_oci_collection_element_set_null() - Set the element with the given index to NULL */ -int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index) -{ - OCIInd null_index = OCI_IND_NULL; - php_oci_connection *connection = collection->connection; - sword errstatus; - - /* set NULL element */ - PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index, collection->collection)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_element_set_date() - Change element's value to the given DATE */ -int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len) -{ - OCIInd new_index = OCI_IND_NOTNULL; - OCIDate oci_date; - php_oci_connection *connection = collection->connection; - sword errstatus; - - /* format and language are NULLs, so format is "DD-MON-YY" and language is the default language of the session */ - PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date)); - - if (errstatus != OCI_SUCCESS) { - /* failed to convert string to date */ - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, - ( - connection->env, - connection->err, - (ub4)index, - (dvoid *) &oci_date, - (dvoid *) &new_index, - (OCIColl *) collection->collection - ) - ); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_element_set_number() - Change element's value to the given NUMBER */ -int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len) -{ - OCIInd new_index = OCI_IND_NOTNULL; - double element_double; - OCINumber oci_number; - php_oci_connection *connection = collection->connection; - sword errstatus; - - element_double = zend_strtod(number, NULL); - - PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, - ( - connection->env, - connection->err, - (ub4) index, - (dvoid *) &oci_number, - (dvoid *) &new_index, - (OCIColl *) collection->collection - ) - ); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_element_set_string() - Change element's value to the given string */ -int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len) -{ - OCIInd new_index = OCI_IND_NOTNULL; - OCIString *ocistr = (OCIString *)0; - php_oci_connection *connection = collection->connection; - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, - ( - connection->env, - connection->err, - (ub4)index, - (dvoid *) ocistr, - (dvoid *) &new_index, - (OCIColl *) collection->collection - ) - ); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_element_set() - Collection element setter */ -int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len) -{ - if (value_len == 0) { - return php_oci_collection_element_set_null(collection, index); - } - - switch(collection->element_typecode) { - case OCI_TYPECODE_DATE: - return php_oci_collection_element_set_date(collection, index, value, value_len); - break; - - case OCI_TYPECODE_VARCHAR2 : - return php_oci_collection_element_set_string(collection, index, value, value_len); - break; - - case OCI_TYPECODE_UNSIGNED16 : /* UNSIGNED SHORT */ - case OCI_TYPECODE_UNSIGNED32 : /* UNSIGNED LONG */ - case OCI_TYPECODE_REAL : /* REAL */ - case OCI_TYPECODE_DOUBLE : /* DOUBLE */ - case OCI_TYPECODE_INTEGER : /* INT */ - case OCI_TYPECODE_SIGNED16 : /* SHORT */ - case OCI_TYPECODE_SIGNED32 : /* LONG */ - case OCI_TYPECODE_DECIMAL : /* DECIMAL */ - case OCI_TYPECODE_FLOAT : /* FLOAT */ - case OCI_TYPECODE_NUMBER : /* NUMBER */ - case OCI_TYPECODE_SMALLINT : /* SMALLINT */ - return php_oci_collection_element_set_number(collection, index, value, value_len); - break; - - default: - php_error_docref(NULL, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode); - return 1; - break; - } - /* never reached */ - return 1; -} -/* }}} */ - -/* {{{ php_oci_collection_assign() - Assigns a value to the collection from another collection */ -int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from) -{ - php_oci_connection *connection = collection_dest->connection; - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_collection_close() - Destroy collection and all associated resources */ -void php_oci_collection_close(php_oci_collection *collection) -{ - php_oci_connection *connection = collection->connection; - sword errstatus; - - if (collection->collection) { - PHP_OCI_CALL_RETURN(errstatus, OCIObjectFree, (connection->env, connection->err, (dvoid *)collection->collection, (ub2)OCI_OBJECTFREE_FORCE)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - } else { - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - } - } - - zend_list_delete(collection->connection->id); - efree(collection); - return; -} -/* }}} */ - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8_dtrace.d b/ext/oci8/oci8_dtrace.d deleted file mode 100644 index 79ddd3dd6869..000000000000 --- a/ext/oci8/oci8_dtrace.d +++ /dev/null @@ -1,36 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Christopher Jones | - +----------------------------------------------------------------------+ -*/ - -provider phpoci { - probe oci8__check__connection(void *connection, char *client_id, int is_open, long errcode, unsigned long server_status); - probe oci8__connect__entry(char *username, char *dbname, char *charset, long session_mode, int persistent, int exclusive); - probe oci8__connect__return(void *connection); - probe oci8__connection__close(void *connection); - probe oci8__error(int status, long errcode); - probe oci8__execute__mode(void *connection, char *client_id, void *statement, unsigned int mode); - probe oci8__sqltext(void *connection, char *client_id, void *statement, char *sql); - - probe oci8__connect__p__dtor__close(void *connection); - probe oci8__connect__p__dtor__release(void *connection); - probe oci8__connect__lookup(void *connection, int is_stub); - probe oci8__connect__expiry(void *connection, int is_stub, long idle_expiry, long timestamp); - probe oci8__connect__type(int persistent, int exclusive, void *connection, long num_persistent, long num_connections); - probe oci8__sesspool__create(void *session_pool); - probe oci8__sesspool__stats(unsigned long free, unsigned long busy, unsigned long open); - probe oci8__sesspool__type(int type, void *session_pool); -}; diff --git a/ext/oci8/oci8_failover.c b/ext/oci8/oci8_failover.c deleted file mode 100644 index bf395332ca77..000000000000 --- a/ext/oci8/oci8_failover.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | - | Thies C. Arntzen | - | | - | Collection support by Andy Sautins | - | Temporary LOB support by David Benson | - | ZTS per process OCIPLogon by Harald Radi | - | | - | Redesigned by: Antony Dovgal | - | Andi Gutmans | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" - -#ifdef HAVE_OCI8 - -#include "php_oci8.h" -#include "php_oci8_int.h" - -/* {{{ callback_fn() - OCI TAF callback function, calling userspace function */ -sb4 callback_fn(void *svchp, void *envhp, void *fo_ctx, ub4 fo_type, ub4 fo_event) -{ - /* Create zval */ - zval retval, params[3]; - php_oci_connection *connection = (php_oci_connection*)fo_ctx; - - /* Default return value */ - sb4 returnValue = 0; - - /* Check if userspace callback function was unregistered */ - if (Z_ISUNDEF(connection->taf_callback) || Z_ISNULL(connection->taf_callback)) { - return 0; - } - - /* Initialize zval */ - ZVAL_RES(¶ms[0], connection->id); - ZVAL_LONG(¶ms[1], fo_event); - ZVAL_LONG(¶ms[2], fo_type); - - /* Call user function (if possible) */ - if (call_user_function(NULL, NULL, &connection->taf_callback, &retval, 3, params) == FAILURE) { - php_error_docref(NULL, E_WARNING, "Unable to call Oracle TAF callback function"); - } - - /* Set return value */ - if (Z_TYPE(retval) == IS_LONG) { - returnValue = (sb4) Z_LVAL(retval); - } - - /* Setting params[0] to null so resource isn't destroyed on zval_ptr_dtor */ - ZVAL_NULL(¶ms[0]); - - /* Cleanup */ - zval_ptr_dtor(&retval); - zval_ptr_dtor(¶ms[0]); - zval_ptr_dtor(¶ms[1]); - zval_ptr_dtor(¶ms[2]); - - return returnValue; -} -/* }}} */ - -/* {{{ php_oci_unregister_taf_callback() - Unregister the userspace callback function for Oracle TAF, - while keeping the OCI callback alive */ -int php_oci_unregister_taf_callback(php_oci_connection *connection) -{ - return php_oci_register_taf_callback(connection, NULL); -} -/* }}} */ - -/* {{{ php_oci_register_taf_callback() - Register a callback function for Oracle TAF */ -int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback) -{ - sword errstatus; - int registered = 0; - - /* temporary failover callback structure */ - OCIFocbkStruct failover; - - if (!callback) { - /* Unregister callback */ - if (Z_ISUNDEF(connection->taf_callback) || Z_ISNULL(connection->taf_callback)) { - return 0; // Nothing to unregister - } - - registered = 1; - zval_ptr_dtor(&connection->taf_callback); - ZVAL_NULL(&connection->taf_callback); - } else { - if (!Z_ISUNDEF(connection->taf_callback)) { - registered = 1; - if (!Z_ISNULL(connection->taf_callback)) { - zval_ptr_dtor(&connection->taf_callback); - ZVAL_NULL(&connection->taf_callback); - } - } - - /* Set userspace callback function */ - ZVAL_COPY(&connection->taf_callback, callback); - } - - /* OCI callback function already registered */ - if (registered) { - return 0; - } - - /* set context */ - failover.fo_ctx = connection; - - /* set callback function */ - failover.callback_function = &callback_fn; - - /* do the registration */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (connection->server, (ub4) OCI_HTYPE_SERVER, (void *) &failover, (ub4) 0, (ub4) OCI_ATTR_FOCBK, connection->err)); - - if (errstatus != OCI_SUCCESS) { - zval_ptr_dtor(&connection->taf_callback); - ZVAL_UNDEF(&connection->taf_callback); - connection->errcode = php_oci_error(connection->err, errstatus); - return 1; - } - - /* successful conclusion */ - return 0; -} -/* }}} */ - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c deleted file mode 100644 index 2b1117dd6515..000000000000 --- a/ext/oci8/oci8_interface.c +++ /dev/null @@ -1,2344 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | - | Thies C. Arntzen | - | | - | Collection support by Andy Sautins | - | Temporary LOB support by David Benson | - | ZTS per process OCIPLogon by Harald Radi | - | | - | Redesigned by: Antony Dovgal | - | Andi Gutmans | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" - -#ifdef HAVE_OCI8 - -#include "php_oci8.h" -#include "php_oci8_int.h" - -#ifndef OCI_STMT_CALL -#define OCI_STMT_CALL 10 -#endif - -#define ERROR_ARG_POS(arg_num) (getThis() ? (arg_num-1) : (arg_num)) - -/* {{{ Register a callback function for Oracle Transparent Application Failover (TAF) */ -PHP_FUNCTION(oci_register_taf_callback) -{ - zval *z_connection; - php_oci_connection *connection; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zval *callback = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|f!", &z_connection, &fci, &fcc) == FAILURE) { - RETURN_THROWS(); - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - /* If callable passed, assign callback zval so that it can be passed to php_oci_register_taf_callback() */ - if (ZEND_FCI_INITIALIZED(fci)) { - callback = &fci.function_name; - } - - if (php_oci_register_taf_callback(connection, callback) == 0) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ Unregister a callback function for Oracle Transparent Application Failover (TAF) */ -PHP_FUNCTION(oci_unregister_taf_callback) -{ - zval *z_connection; - php_oci_connection *connection; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) { - RETURN_THROWS(); - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if (php_oci_unregister_taf_callback(connection) == 0) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ Define a PHP variable to an Oracle column by name */ -/* if you want to define a LOB/CLOB etc make sure you allocate it via OCINewDescriptor BEFORE defining!!! */ -PHP_FUNCTION(oci_define_by_name) -{ - zval *stmt, *var; - char *name; - size_t name_len; - zend_long type = 0; - php_oci_statement *statement; - php_oci_define *define; - zend_string *zvtmp; - - ZEND_PARSE_PARAMETERS_START(3, 4) - Z_PARAM_RESOURCE(stmt) - Z_PARAM_STRING(name, name_len) - Z_PARAM_ZVAL(var) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(type) - ZEND_PARSE_PARAMETERS_END(); - - if (!name_len) { - zend_argument_value_error(2, "cannot be empty"); - RETURN_THROWS(); - } - - PHP_OCI_ZVAL_TO_STATEMENT(stmt, statement); - - if (statement->defines == NULL) { - ALLOC_HASHTABLE(statement->defines); - zend_hash_init(statement->defines, 13, NULL, php_oci_define_hash_dtor, 0); - } - else if (zend_hash_str_exists(statement->defines, (const char *)name, name_len)) { - RETURN_FALSE; - } - - define = ecalloc(1,sizeof(php_oci_define)); - - /* if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { */ - zvtmp = zend_string_init(name, name_len, 0); - if ((define = zend_hash_add_new_ptr(statement->defines, zvtmp, define)) != NULL) { - zend_string_release_ex(zvtmp, 0); - } else { - efree(define); - zend_string_release_ex(zvtmp, 0); - RETURN_FALSE; - } - - define->name = (text*) ecalloc(1, name_len+1); - memcpy(define->name, name, name_len); - define->name[name_len] = '\0'; - define->name_len = (ub4) name_len; - define->type = (ub4) type; - ZEND_ASSERT(Z_ISREF_P(var)); - ZVAL_COPY(&define->val, var); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Bind a PHP variable to an Oracle placeholder by name */ -/* if you want to bind a LOB/CLOB etc make sure you allocate it via OCINewDescriptor BEFORE binding!!! */ -PHP_FUNCTION(oci_bind_by_name) -{ - ub2 bind_type = SQLT_CHR; /* unterminated string */ - size_t name_len; - zend_long maxlen = -1, type = 0; - char *name; - zval *z_statement; - zval *bind_var = NULL; - php_oci_statement *statement; - - ZEND_PARSE_PARAMETERS_START(3, 5) - Z_PARAM_RESOURCE(z_statement) - Z_PARAM_STRING(name, name_len) - Z_PARAM_ZVAL(bind_var) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(maxlen) - Z_PARAM_LONG(type) - ZEND_PARSE_PARAMETERS_END(); - - if (type) { - bind_type = (ub2) type; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Bind a PHP array to an Oracle PL/SQL type by name */ -PHP_FUNCTION(oci_bind_array_by_name) -{ - size_t name_len; - zend_long max_item_len = -1; - zend_long max_array_len = 0; - zend_long type = SQLT_AFC; - char *name; - zval *z_statement; - zval *bind_var = NULL; - php_oci_statement *statement; - - ZEND_PARSE_PARAMETERS_START(4, 6) - Z_PARAM_RESOURCE(z_statement) - Z_PARAM_STRING(name, name_len) - Z_PARAM_ZVAL(bind_var) - Z_PARAM_LONG(max_array_len) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(max_item_len) - Z_PARAM_LONG(type) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (ZEND_NUM_ARGS() == 5 && max_item_len <= 0) { - max_item_len = -1; - } - - if (max_array_len <= 0) { - zend_argument_value_error(4, "must be greater than 0"); - RETURN_THROWS(); - } - - if (php_oci_bind_array_by_name(statement, name, (sb4) name_len, bind_var, max_array_len, max_item_len, type)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Deletes large object description */ -PHP_FUNCTION(oci_free_descriptor) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - zend_list_close(descriptor->id); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Saves a large object */ -PHP_FUNCTION(oci_lob_save) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - char *data; - size_t data_len; - zend_long offset = 0; - ub4 bytes_written; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &offset) == FAILURE) { - RETURN_THROWS(); - } - - if (offset < 0) { - zend_argument_value_error(ERROR_ARG_POS(3), "must be greater than or equal to 0"); - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_write(descriptor, (ub4) offset, data, (ub4) data_len, &bytes_written)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Loads file into a LOB */ -PHP_FUNCTION(oci_lob_import) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - char *filename; - size_t filename_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_import(descriptor, filename)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Loads a large object */ -PHP_FUNCTION(oci_lob_load) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - char *buffer = NULL; - ub4 buffer_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len)) { - RETURN_FALSE; - } - if (buffer_len > 0) { - zend_string *ret = zend_string_init(buffer, buffer_len, 0); - if (buffer) - efree(buffer); - RETURN_STR(ret); - } - else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ Reads particular part of a large object */ -PHP_FUNCTION(oci_lob_read) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - zend_long length; - char *buffer; - ub4 buffer_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &z_descriptor, oci_lob_class_entry_ptr, &length) == FAILURE) { - RETURN_THROWS(); - } - - if (length <= 0) { - zend_argument_value_error(ERROR_ARG_POS(2), "must be greater than 0"); - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_read(descriptor, length, descriptor->lob_current_position, &buffer, &buffer_len)) { - RETURN_FALSE; - } - if (buffer_len > 0) { - zend_string *ret = zend_string_init(buffer, buffer_len, 0); - efree(buffer); - RETURN_STR(ret); - } - else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ Checks if EOF is reached */ -PHP_FUNCTION(oci_lob_eof) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - ub4 lob_length; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (!php_oci_lob_get_length(descriptor, &lob_length)) { - if (lob_length == descriptor->lob_current_position) { - RETURN_TRUE; - } - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Tells LOB pointer position */ -PHP_FUNCTION(oci_lob_tell) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - RETURN_LONG(descriptor->lob_current_position); -} -/* }}} */ - -/* {{{ Rewind pointer of a LOB */ -PHP_FUNCTION(oci_lob_rewind) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - descriptor->lob_current_position = 0; - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Moves the pointer of a LOB */ -PHP_FUNCTION(oci_lob_seek) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - zend_long offset, whence = PHP_OCI_SEEK_SET; - ub4 lob_length; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol|l", &z_descriptor, oci_lob_class_entry_ptr, &offset, &whence) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_get_length(descriptor, &lob_length)) { - RETURN_FALSE; - } - - switch(whence) { - case PHP_OCI_SEEK_CUR: - descriptor->lob_current_position += (ub4) offset; - break; - case PHP_OCI_SEEK_END: - if ((descriptor->lob_size + offset) >= 0) { - descriptor->lob_current_position = descriptor->lob_size + (ub4) offset; - } - else { - descriptor->lob_current_position = 0; - } - break; - case PHP_OCI_SEEK_SET: - default: - descriptor->lob_current_position = (offset > 0) ? (ub4) offset : 0; - break; - } - if (descriptor->lob_current_position > UB4MAXVAL) { - php_error_docref(NULL, E_WARNING, "Invalid offset or LOB position"); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Returns size of a large object */ -PHP_FUNCTION(oci_lob_size) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - ub4 lob_length; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_get_length(descriptor, &lob_length)) { - RETURN_FALSE; - } - RETURN_LONG(lob_length); -} -/* }}} */ - -/* {{{ Writes data to current position of a LOB */ -PHP_FUNCTION(oci_lob_write) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - size_t data_len; - zend_long write_len; - bool write_len_is_null = 1; - ub4 bytes_written; - char *data; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|l!", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &write_len, &write_len_is_null) == FAILURE) { - RETURN_THROWS(); - } - - if (!write_len_is_null) { - data_len = MIN((zend_long) data_len, write_len); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (data_len <= 0) { - RETURN_LONG(0); - } - - if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, (ub4) data_len, &bytes_written)) { - RETURN_FALSE; - } - RETURN_LONG(bytes_written); -} -/* }}} */ - -/* {{{ Appends data from a LOB to another LOB */ -PHP_FUNCTION(oci_lob_append) -{ - zval *tmp_dest, *tmp_from, *z_descriptor_dest, *z_descriptor_from; - php_oci_descriptor *descriptor_dest, *descriptor_from; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); - RETURN_FALSE; - } - - if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest); - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from); - - if (php_oci_lob_append(descriptor_dest, descriptor_from)) { - RETURN_FALSE; - } - /* XXX should we increase lob_size here ? */ - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Truncates a LOB */ -PHP_FUNCTION(oci_lob_truncate) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - zend_long trim_length = 0; - ub4 ub_trim_length; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &trim_length) == FAILURE) { - RETURN_THROWS(); - } - - if (trim_length < 0) { - zend_argument_value_error(ERROR_ARG_POS(2), "must be greater than or equal to 0"); - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - ub_trim_length = (ub4) trim_length; - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_truncate(descriptor, ub_trim_length)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Erases a specified portion of the internal LOB, starting at a specified offset */ -PHP_FUNCTION(oci_lob_erase) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - ub4 bytes_erased; - zend_long offset, length; - bool offset_is_null = 1, length_is_null = 1; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l!l!", &z_descriptor, oci_lob_class_entry_ptr, &offset, &offset_is_null, &length, &length_is_null) == FAILURE) { - RETURN_THROWS(); - } - - if (offset_is_null) { - offset = -1; - } else if (offset < 0) { - zend_argument_value_error(ERROR_ARG_POS(2), "must be greater than or equal to 0"); - RETURN_THROWS(); - } - - if (length_is_null) { - length = -1; - } else if (length < 0) { - zend_argument_value_error(ERROR_ARG_POS(3), "must be greater than or equal to 0"); - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_erase(descriptor, offset, (ub4) length, &bytes_erased)) { - RETURN_FALSE; - } - RETURN_LONG(bytes_erased); -} -/* }}} */ - -/* {{{ Flushes the LOB buffer */ -PHP_FUNCTION(oci_lob_flush) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - zend_long flush_flag = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &flush_flag) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (descriptor->buffering == PHP_OCI_LOB_BUFFER_DISABLED) { - /* buffering wasn't enabled, there is nothing to flush */ - RETURN_FALSE; - } - - if (php_oci_lob_flush(descriptor, flush_flag)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Enables/disables buffering for a LOB */ -PHP_FUNCTION(ocisetbufferinglob) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - bool flag; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ob", &z_descriptor, oci_lob_class_entry_ptr, &flag) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_set_buffering(descriptor, flag)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Returns current state of buffering for a LOB */ -PHP_FUNCTION(ocigetbufferinglob) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Copies data from a LOB to another LOB */ -PHP_FUNCTION(oci_lob_copy) -{ - zval *tmp_dest, *tmp_from, *z_descriptor_dest, *z_descriptor_from; - php_oci_descriptor *descriptor_dest, *descriptor_from; - zend_long length; - bool length_is_null = 1; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO|l!", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr, &length, &length_is_null) == FAILURE) { - RETURN_THROWS(); - } - - if (length_is_null) { - length = -1; - } else if (length < 0) { - zend_argument_value_error(3, "must be greater than or equal to 0"); - RETURN_THROWS(); - } - - if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); - RETURN_FALSE; - } - - if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest); - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from); - - if (php_oci_lob_copy(descriptor_dest, descriptor_from, length)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Tests to see if two LOB/FILE locators are equal */ -PHP_FUNCTION(oci_lob_is_equal) -{ - zval *tmp_first, *tmp_second, *z_descriptor_first, *z_descriptor_second; - php_oci_descriptor *descriptor_first, *descriptor_second; - boolean is_equal; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_descriptor_first, oci_lob_class_entry_ptr, &z_descriptor_second, oci_lob_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp_first = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_first), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); - RETURN_FALSE; - } - - if ((tmp_second = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_second), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_first, descriptor_first); - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_second, descriptor_second); - - if (php_oci_lob_is_equal(descriptor_first, descriptor_second, &is_equal)) { - RETURN_FALSE; - } - - if (is_equal == TRUE) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Writes a large object into a file */ -PHP_FUNCTION(oci_lob_export) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - char *filename; - char *buffer; - size_t filename_len; - zend_long start, length, block_length; - bool start_is_null = 1, length_is_null = 1; - php_stream *stream; - ub4 lob_length; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Op|l!l!", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &start_is_null, &length, &length_is_null) == FAILURE) { - RETURN_THROWS(); - } - - if (start_is_null) { - start = -1; - } else if (start < 0) { - zend_argument_value_error(ERROR_ARG_POS(3), "must be greater than or equal to 0"); - RETURN_THROWS(); - } - - if (length_is_null) { - length = -1; - } else if (length < 0) { - zend_argument_value_error(ERROR_ARG_POS(4), "must be greater than or equal to 0"); - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_get_length(descriptor, &lob_length)) { - RETURN_FALSE; - } - - if (start == -1) { - start = 0; - } - - if (length == -1) { - length = lob_length - descriptor->lob_current_position; - } - - if (lob_length == 0) { - length = 0; - } - - if (length == 0) { - /* nothing to write, fail silently */ - RETURN_FALSE; - } - - if (php_check_open_basedir(filename)) { - RETURN_FALSE; - } - - stream = php_stream_open_wrapper_ex(filename, "w", REPORT_ERRORS, NULL, NULL); - - block_length = PHP_OCI_LOB_BUFFER_SIZE; - if (block_length > length) { - block_length = length; - } - - while(length > 0) { - ub4 tmp_bytes_read = 0; - if (php_oci_lob_read(descriptor, block_length, start, &buffer, &tmp_bytes_read)) { - php_stream_close(stream); - RETURN_FALSE; - } - if (tmp_bytes_read && !php_stream_write(stream, buffer, tmp_bytes_read)) { - php_stream_close(stream); - if (buffer) - efree(buffer); - RETURN_FALSE; - } - if (buffer) { - efree(buffer); - } - - length -= tmp_bytes_read; - descriptor->lob_current_position += tmp_bytes_read; - start += tmp_bytes_read; - - if (block_length > length) { - block_length = length; - } - } - - php_stream_close(stream); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Writes temporary blob */ -PHP_METHOD(OCILob, writeTemporary) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - char *data; - size_t data_len; - zend_long type = OCI_TEMP_CLOB; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_write_tmp(descriptor, type, data, (int) data_len)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Closes lob descriptor */ -PHP_METHOD(OCILob, close) -{ - zval *tmp, *z_descriptor; - php_oci_descriptor *descriptor; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); - - if (php_oci_lob_close(descriptor)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Initialize a new empty descriptor LOB/FILE (LOB is default) */ -PHP_FUNCTION(oci_new_descriptor) -{ - zval *z_connection; - php_oci_connection *connection; - php_oci_descriptor *descriptor; - zend_long type = OCI_DTYPE_LOB; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &z_connection, &type) == FAILURE) { - RETURN_THROWS(); - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - /* php_oci_lob_create() checks type */ - descriptor = php_oci_lob_create(connection, type); - - if (!descriptor) { - RETURN_NULL(); - } - - object_init_ex(return_value, oci_lob_class_entry_ptr); - add_property_resource(return_value, "descriptor", descriptor->id); -} -/* }}} */ - -/* {{{ Rollback the current context */ -PHP_FUNCTION(oci_rollback) -{ - zval *z_connection; - php_oci_connection *connection; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_connection) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if (connection->descriptors) { - php_oci_connection_descriptors_free(connection); - } - - if (php_oci_connection_rollback(connection)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Commit the current context */ -PHP_FUNCTION(oci_commit) -{ - zval *z_connection; - php_oci_connection *connection; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_connection) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if (connection->descriptors) { - php_oci_connection_descriptors_free(connection); - } - - if (php_oci_connection_commit(connection)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Tell the name of a column */ -PHP_FUNCTION(oci_field_name) -{ - php_oci_out_column *column; - - if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0) ) ) { - RETURN_STRINGL(column->name, column->name_len); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Tell the maximum data size of a column */ -PHP_FUNCTION(oci_field_size) -{ - php_oci_out_column *column; - - if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0) ) ) { - /* Handle data type of LONG */ - if (column->data_type == SQLT_LNG){ - RETURN_LONG(column->storage_size4); - } - RETURN_LONG(column->data_size); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Tell the scale of a column */ -PHP_FUNCTION(oci_field_scale) -{ - php_oci_out_column *column; - - if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0) ) ) { - RETURN_LONG(column->scale); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Tell the precision of a column */ -PHP_FUNCTION(oci_field_precision) -{ - php_oci_out_column *column; - - if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0) ) ) { - RETURN_LONG(column->precision); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Tell the data type of a column */ -PHP_FUNCTION(oci_field_type) -{ - php_oci_out_column *column; - - column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - - if (!column) { - RETURN_FALSE; - } - - switch (column->data_type) { -#ifdef SQLT_TIMESTAMP - case SQLT_TIMESTAMP: - RETVAL_STRING("TIMESTAMP"); - break; -#endif -#ifdef SQLT_TIMESTAMP_TZ - case SQLT_TIMESTAMP_TZ: - RETVAL_STRING("TIMESTAMP WITH TIMEZONE"); - break; -#endif -#ifdef SQLT_TIMESTAMP_LTZ - case SQLT_TIMESTAMP_LTZ: - RETVAL_STRING("TIMESTAMP WITH LOCAL TIMEZONE"); - break; -#endif -#ifdef SQLT_INTERVAL_YM - case SQLT_INTERVAL_YM: - RETVAL_STRING("INTERVAL YEAR TO MONTH"); - break; -#endif -#ifdef SQLT_INTERVAL_DS - case SQLT_INTERVAL_DS: - RETVAL_STRING("INTERVAL DAY TO SECOND"); - break; -#endif - case SQLT_DAT: - RETVAL_STRING("DATE"); - break; - case SQLT_NUM: - RETVAL_STRING("NUMBER"); - break; - case SQLT_LNG: - RETVAL_STRING("LONG"); - break; - case SQLT_BIN: - RETVAL_STRING("RAW"); - break; - case SQLT_LBI: - RETVAL_STRING("LONG RAW"); - break; - case SQLT_CHR: - RETVAL_STRING("VARCHAR2"); - break; - case SQLT_RSET: - RETVAL_STRING("REFCURSOR"); - break; - case SQLT_AFC: - RETVAL_STRING("CHAR"); - break; - case SQLT_BLOB: - RETVAL_STRING("BLOB"); - break; - case SQLT_CLOB: - RETVAL_STRING("CLOB"); - break; - case SQLT_BFILE: - RETVAL_STRING("BFILE"); - break; - case SQLT_RDD: - RETVAL_STRING("ROWID"); - break; - default: - RETVAL_LONG(column->data_type); - } -} -/* }}} */ - -/* {{{ Tell the raw oracle data type of a column */ -PHP_FUNCTION(oci_field_type_raw) -{ - php_oci_out_column *column; - - column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - if (column) { - RETURN_LONG(column->data_type); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Tell whether a field in the current row is NULL */ -PHP_FUNCTION(oci_field_is_null) -{ - php_oci_out_column *column; - - if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0) ) ) { - if (column->indicator == -1) { - RETURN_TRUE; - } - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Execute a parsed statement */ -PHP_FUNCTION(oci_execute) -{ - zval *z_statement; - php_oci_statement *statement; - zend_long mode = OCI_COMMIT_ON_SUCCESS; - - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_RESOURCE(z_statement) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(mode) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_execute(statement, (ub4) mode)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Cancel reading from a cursor */ -PHP_FUNCTION(oci_cancel) -{ - zval *z_statement; - php_oci_statement *statement; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) { - RETURN_THROWS(); - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_cancel(statement)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Prepare a new row of data for reading */ -PHP_FUNCTION(oci_fetch) -{ - zval *z_statement; - php_oci_statement *statement; - ub4 nrows = 1; /* only one row at a time is supported for now */ - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_statement) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_fetch(statement, nrows)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Fetch a row of result data into an array */ -PHP_FUNCTION(ocifetchinto) -{ - php_oci_fetch_row(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_OCI_NUM, 3); -} -/* }}} */ - -/* {{{ Fetch all rows of result data into an array */ -PHP_FUNCTION(oci_fetch_all) -{ - zval *z_statement, *array; - zval element, tmp; - php_oci_statement *statement; - php_oci_out_column **columns; - zval **outarrs; - ub4 nrows = 1; - int i; - zend_long rows = 0, flags = PHP_OCI_FETCHSTATEMENT_BY_COLUMN | PHP_OCI_ASSOC, skip = 0, maxrows = -1; - - ZEND_PARSE_PARAMETERS_START(2, 5) - Z_PARAM_RESOURCE(z_statement) - Z_PARAM_ZVAL(array) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(skip) - Z_PARAM_LONG(maxrows) - Z_PARAM_LONG(flags) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - while (skip--) { - if (php_oci_statement_fetch(statement, nrows)) { - zend_try_array_init(array); - RETURN_LONG(0); - } - } - - if (flags & PHP_OCI_FETCHSTATEMENT_BY_ROW) { - /* Fetch by Row: array will contain one sub-array per query row */ - array = zend_try_array_init(array); - if (!array) { - RETURN_THROWS(); - } - - columns = safe_emalloc(statement->ncolumns, sizeof(php_oci_out_column *), 0); - for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0); - } - - while (!php_oci_statement_fetch(statement, nrows)) { - zval row; - - array_init_size(&row, statement->ncolumns); - - for (i = 0; i < statement->ncolumns; i++) { - php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS); - - if (flags & PHP_OCI_NUM) { - zend_hash_next_index_insert(Z_ARRVAL(row), &element); - } else { /* default to ASSOC */ - zend_string *zvtmp; - zvtmp = zend_string_init(columns[ i ]->name, columns[ i ]->name_len, 0); - zend_symtable_update(Z_ARRVAL(row), zvtmp, &element); - zend_string_release_ex(zvtmp, 0); - } - } - - zend_hash_next_index_insert(Z_ARRVAL_P(array), &row); - rows++; - - if (maxrows != -1 && rows == maxrows) { - php_oci_statement_cancel(statement); - break; - } - } - efree(columns); - - } else { /* default to BY_COLUMN */ - /* Fetch by columns: array will contain one sub-array per query column */ - array = zend_try_array_init_size(array, statement->ncolumns); - if (!array) { - RETURN_THROWS(); - } - - columns = safe_emalloc(statement->ncolumns, sizeof(php_oci_out_column *), 0); - outarrs = safe_emalloc(statement->ncolumns, sizeof(zval*), 0); - - if (flags & PHP_OCI_NUM) { - for (i = 0; i < statement->ncolumns; i++) { - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0); - - array_init(&tmp); - outarrs[ i ] = zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp); - } - } else { /* default to ASSOC */ - for (i = 0; i < statement->ncolumns; i++) { - zend_string *zvtmp; - columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0); - - array_init(&tmp); - zvtmp = zend_string_init(columns[ i ]->name, columns[ i ]->name_len, 0); - outarrs[ i ] = zend_symtable_update(Z_ARRVAL_P(array), zvtmp, &tmp); - zend_string_release_ex(zvtmp, 0); - } - } - - while (!php_oci_statement_fetch(statement, nrows)) { - for (i = 0; i < statement->ncolumns; i++) { - php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS); - zend_hash_index_update(Z_ARRVAL_P(outarrs[ i ]), rows, &element); - } - - rows++; - - if (maxrows != -1 && rows == maxrows) { - php_oci_statement_cancel(statement); - break; - } - } - - efree(columns); - efree(outarrs); - } - - RETURN_LONG(rows); -} -/* }}} */ - -/* {{{ Fetch a result row as an object */ -PHP_FUNCTION(oci_fetch_object) -{ - php_oci_fetch_row(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_OCI_ASSOC | PHP_OCI_RETURN_NULLS, 2); - - if (Z_TYPE_P(return_value) == IS_ARRAY) { - object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); - } -} -/* }}} */ - -/* {{{ Fetch a result row as an enumerated array */ -PHP_FUNCTION(oci_fetch_row) -{ - php_oci_fetch_row(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_OCI_NUM | PHP_OCI_RETURN_NULLS, 1); -} -/* }}} */ - -/* {{{ Fetch a result row as an associative array */ -PHP_FUNCTION(oci_fetch_assoc) -{ - php_oci_fetch_row(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_OCI_ASSOC | PHP_OCI_RETURN_NULLS, 1); -} -/* }}} */ - -/* {{{ Fetch a result row as an array */ -PHP_FUNCTION(oci_fetch_array) -{ - php_oci_fetch_row(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_OCI_BOTH | PHP_OCI_RETURN_NULLS, 2); -} -/* }}} */ - -/* {{{ Free all resources associated with a statement */ -PHP_FUNCTION(oci_free_statement) -{ - zval *z_statement; - php_oci_statement *statement; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_statement) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - zend_list_close(statement->id); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Disconnect from database */ -PHP_FUNCTION(oci_close) -{ - /* oci_close for pconnect (if old_oci_close_semantics not set) would - * release the connection back to the client-side session pool (and to the - * server-side pool if Database Resident Connection Pool is being used). - * Subsequent pconnects in the same script are not guaranteed to get the - * same database session. - */ - - zval *z_connection; - php_oci_connection *connection; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_connection) - ZEND_PARSE_PARAMETERS_END(); - - if (OCI_G(old_oci_close_semantics)) { - /* do nothing to keep BC */ - RETURN_NULL(); - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - if (GC_REFCOUNT(connection->id) == 2) { /* CHANGED VERSION::PHP7 - Changed the refCount to 2 since - internally Zend engine increments - RefCount value by 1 */ - /* Unregister Oracle TAF */ - php_oci_unregister_taf_callback(connection); - - zend_list_close(connection->id); - } - - /* ZVAL_NULL(z_connection); */ - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Connect to an Oracle database and log on. Returns a new session. */ -PHP_FUNCTION(oci_new_connect) -{ - php_oci_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 1); -} -/* }}} */ - -/* {{{ Connect to an Oracle database and log on. Returns a new session. */ -PHP_FUNCTION(oci_connect) -{ - php_oci_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 0); -} -/* }}} */ - -/* {{{ Connect to an Oracle database using a persistent connection and log on. Returns a new session. */ -PHP_FUNCTION(oci_pconnect) -{ - php_oci_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1, 0); -} -/* }}} */ - -/* {{{ Return the last error of stmt|connection|global. If no error happened returns false. */ -PHP_FUNCTION(oci_error) -{ - zval *arg = NULL; - php_oci_statement *statement; - php_oci_connection *connection; - text errbuf[PHP_OCI_ERRBUF_LEN]; - sb4 errcode = 0; - dvoid *errh = NULL; - ub2 error_offset = 0; - text *sqltext = NULL; - - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE_OR_NULL(arg) - ZEND_PARSE_PARAMETERS_END(); - - if (arg) { - statement = (php_oci_statement *) zend_fetch_resource_ex(arg, NULL, le_statement); - if (statement) { - errh = statement->err; - errcode = statement->errcode; - - if (php_oci_fetch_sqltext_offset(statement, &sqltext, &error_offset)) { - RETURN_FALSE; - } - goto go_out; - } - - connection = (php_oci_connection *) zend_fetch_resource_ex(arg, NULL, le_connection); - if (connection) { - errh = connection->err; - errcode = connection->errcode; - goto go_out; - } - - connection = (php_oci_connection *) zend_fetch_resource_ex(arg, NULL, le_pconnection); - if (connection) { - errh = connection->err; - errcode = connection->errcode; - goto go_out; - } - } else { - errh = OCI_G(err); - errcode = OCI_G(errcode); - } - -go_out: - if (errcode == 0) { /* no error set in the handle */ - RETURN_FALSE; - } - - if (!errh) { - php_error_docref(NULL, E_WARNING, "oci_error: unable to find error handle"); - RETURN_FALSE; - } - - errcode = php_oci_fetch_errmsg(errh, errbuf, sizeof(errbuf)); - - if (errcode) { - array_init(return_value); - add_assoc_long(return_value, "code", errcode); - /* TODO: avoid reallocation ??? */ - add_assoc_string(return_value, "message", (char*) errbuf); - add_assoc_long(return_value, "offset", error_offset); - add_assoc_string(return_value, "sqltext", sqltext ? (char *) sqltext : ""); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ Return the number of result columns in a statement */ -PHP_FUNCTION(oci_num_fields) -{ - zval *z_statement; - php_oci_statement *statement; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_statement) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - RETURN_LONG(statement->ncolumns); -} -/* }}} */ - -/* {{{ Parse a SQL or PL/SQL statement and return a statement resource */ -PHP_FUNCTION(oci_parse) -{ - zval *z_connection; - php_oci_connection *connection; - php_oci_statement *statement; - char *query; - size_t query_len; - - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_RESOURCE(z_connection) - Z_PARAM_STRING(query, query_len) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - statement = php_oci_statement_create(connection, query, (int) query_len); - - if (statement) { - RETURN_RES(statement->id); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Sets the number of rows to be prefetched on execute to prefetch_rows for stmt */ -PHP_FUNCTION(oci_set_prefetch) -{ - zval *z_statement; - php_oci_statement *statement; - zend_long size; - - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_RESOURCE(z_statement) - Z_PARAM_LONG(size) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (size < 0) { - zend_argument_value_error(2, "must be greater than or equal to 0"); - RETURN_THROWS(); - } - - if (php_oci_statement_set_prefetch(statement, (ub4)size)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Sets the amount of LOB data to be prefetched when OCI LOB locators are fetched */ -PHP_FUNCTION(oci_set_prefetch_lob) -{ - zval *z_statement; - zend_long prefetch_lob_size; -#if (OCI_MAJOR_VERSION > 12 || (OCI_MAJOR_VERSION == 12 && OCI_MINOR_VERSION >= 2)) - php_oci_statement *statement; -#endif - - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_RESOURCE(z_statement) - Z_PARAM_LONG(prefetch_lob_size) - ZEND_PARSE_PARAMETERS_END(); - -#if (OCI_MAJOR_VERSION > 12 || (OCI_MAJOR_VERSION == 12 && OCI_MINOR_VERSION >= 2)) - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (prefetch_lob_size < 0) { - zend_argument_value_error(2, "must be greater than or equal to 0"); - RETURN_THROWS(); - } - - statement->prefetch_lob_size = (ub4) prefetch_lob_size; - RETURN_TRUE; -#else - /* Although the LOB prefetch feature was available in some earlier Oracle - * version, I don't consider it stable until 12.2 */ - php_error_docref(NULL, E_NOTICE, "Unsupported with this version of Oracle Client"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ Sets the client identifier attribute on the connection */ -PHP_FUNCTION(oci_set_client_identifier) -{ - zval *z_connection; - php_oci_connection *connection; - char *client_id; - size_t client_id_len; - sword errstatus; - - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_RESOURCE(z_connection) - Z_PARAM_STRING(client_id, client_id_len) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_id, (ub4) client_id_len, (ub4) OCI_ATTR_CLIENT_IDENTIFIER, connection->err)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - RETURN_FALSE; - } - -#ifdef HAVE_OCI8_DTRACE - /* The alternatives to storing client_id like done below are - i) display it in a probe here in oci_set_client_identifier and - let the user D script correlate the connection address probe - argument and the client_id. This would likely require user D - script variables, which would use kernel memory. - ii) call OCIAttrGet for each probe definition that uses - client_id. This would be slower than storing it. - */ - - if (connection->client_id) { - pefree(connection->client_id, connection->is_persistent); - } - - if (client_id) { - /* this long winded copy allows compatibility with older PHP versions */ - connection->client_id = (char *)pemalloc(client_id_len+1, connection->is_persistent); - memcpy(connection->client_id, client_id, client_id_len); - connection->client_id[client_id_len] = '\0'; - } else { - connection->client_id = NULL; - } -#endif /* HAVE_OCI8_DTRACE */ - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Sets the edition attribute for all subsequent connections created */ -PHP_FUNCTION(oci_set_edition) -{ - char *edition; - size_t edition_len; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STRING(edition, edition_len) - ZEND_PARSE_PARAMETERS_END(); - - if (OCI_G(edition)) { - efree(OCI_G(edition)); - } - - if (edition) { - OCI_G(edition) = (char *)safe_emalloc(edition_len+1, sizeof(char), 0); - memcpy(OCI_G(edition), edition, edition_len); - OCI_G(edition)[edition_len] = '\0'; - } else { - OCI_G(edition) = NULL; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Sets the module attribute on the connection for end-to-end tracing */ -PHP_FUNCTION(oci_set_module_name) -{ - zval *z_connection; - char *module; - size_t module_len; - - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_RESOURCE(z_connection) - Z_PARAM_STRING(module, module_len) - ZEND_PARSE_PARAMETERS_END(); - - php_oci_connection *connection; - sword errstatus; - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) module, (ub4) module_len, (ub4) OCI_ATTR_MODULE, connection->err)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Sets the action attribute on the connection for end-to-end tracing */ -PHP_FUNCTION(oci_set_action) -{ - zval *z_connection; - char *action; - size_t action_len; - - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_RESOURCE(z_connection) - Z_PARAM_STRING(action, action_len) - ZEND_PARSE_PARAMETERS_END(); - - php_oci_connection *connection; - sword errstatus; - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) action, (ub4) action_len, (ub4) OCI_ATTR_ACTION, connection->err)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Sets the client info attribute on the connection for end-to-end tracing */ -PHP_FUNCTION(oci_set_client_info) -{ - zval *z_connection; - char *client_info; - size_t client_info_len; - - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_RESOURCE(z_connection) - Z_PARAM_STRING(client_info, client_info_len) - ZEND_PARSE_PARAMETERS_END(); - - php_oci_connection *connection; - sword errstatus; - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_info, (ub4) client_info_len, (ub4) OCI_ATTR_CLIENT_INFO, connection->err)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Sets the "DB operation" on the connection for Oracle end-to-end tracing. - For history, see Oracle bug 16695981 */ -PHP_FUNCTION(oci_set_db_operation) -{ - zval *z_connection; - char *dbop_name; - size_t dbop_name_len; - - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_RESOURCE(z_connection) - Z_PARAM_STRING(dbop_name, dbop_name_len) - ZEND_PARSE_PARAMETERS_END(); - -#if (OCI_MAJOR_VERSION > 11) - php_oci_connection *connection; - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) dbop_name, (ub4) dbop_name_len, (ub4) OCI_ATTR_DBOP, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - RETURN_FALSE; - } - RETURN_TRUE; -#else - php_error_docref(NULL, E_NOTICE, "Unsupported attribute type"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ */ -PHP_FUNCTION(oci_set_call_timeout) -{ - zval *z_connection; - zend_long call_timeout; // milliseconds - - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_RESOURCE(z_connection) - Z_PARAM_LONG(call_timeout) - ZEND_PARSE_PARAMETERS_END(); - -#if (OCI_MAJOR_VERSION >= 18) - php_oci_connection *connection; - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &call_timeout, 0, OCI_ATTR_CALL_TIMEOUT, OCI_G(err))); - - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode)); - RETURN_FALSE; - } - RETURN_TRUE; -#else - php_error_docref(NULL, E_NOTICE, "Unsupported with this version of Oracle Client"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ Changes the password of an account */ -PHP_FUNCTION(oci_password_change) -{ - zval *z_connection; - char *user, *pass_old, *pass_new, *dbname; - size_t user_len, pass_old_len, pass_new_len, dbname_len; - php_oci_connection *connection; - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rsss", &z_connection, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) { - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if (!user_len) { - zend_argument_value_error(2, "cannot be empty"); - RETURN_THROWS(); - } - if (!pass_old_len) { - zend_argument_value_error(3, "cannot be empty"); - RETURN_THROWS(); - } - if (!pass_new_len) { - zend_argument_value_error(4, "cannot be empty"); - RETURN_THROWS(); - } - - if (php_oci_password_change(connection, user, (int) user_len, pass_old, (int) pass_old_len, pass_new, (int) pass_new_len)) { - RETURN_FALSE; - } - RETURN_TRUE; - } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "ssss", &dbname, &dbname_len, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) { - - if (!user_len) { - zend_argument_value_error(2, "cannot be empty"); - RETURN_THROWS(); - } - if (!pass_old_len) { - zend_argument_value_error(3, "cannot be empty"); - RETURN_THROWS(); - } - if (!pass_new_len) { - zend_argument_value_error(4, "cannot be empty"); - RETURN_THROWS(); - } - - connection = php_oci_do_connect_ex(user, (int) user_len, pass_old, (int) pass_old_len, pass_new, (int) pass_new_len, dbname, (int) dbname_len, NULL, OCI_DEFAULT, 0, 0); - if (!connection) { - RETURN_FALSE; - } - RETURN_RES(connection->id); - } - WRONG_PARAM_COUNT; -} -/* }}} */ - -/* {{{ Return a new cursor (Statement-Handle) - use this to bind ref-cursors! */ -PHP_FUNCTION(oci_new_cursor) -{ - zval *z_connection; - php_oci_connection *connection; - php_oci_statement *statement; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_connection) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - statement = php_oci_statement_create(connection, NULL, 0); - - if (statement) { - RETURN_RES(statement->id); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ Return a single column of result data */ -PHP_FUNCTION(oci_result) -{ - php_oci_out_column *column; - - column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); - if(column) { - php_oci_column_to_zval(column, return_value, 0); - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ Return a string containing runtime client library version information */ -PHP_FUNCTION(oci_client_version) -{ - char version[256]; - ZEND_PARSE_PARAMETERS_NONE(); - - php_oci_client_get_version(version, sizeof(version)); - RETURN_STRING(version); -} -/* }}} */ - -/* {{{ Return a string containing server version information */ -PHP_FUNCTION(oci_server_version) -{ - zval *z_connection; - php_oci_connection *connection; - char version[256]; - zend_string *ret; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_connection) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if (php_oci_server_get_version(connection, version, sizeof(version))) { - RETURN_FALSE; - } - - ret = zend_string_init(version, strlen(version), 0); - RETURN_STR(ret); -} -/* }}} */ - -/* {{{ Return the query type of an OCI statement */ -PHP_FUNCTION(oci_statement_type) -{ - zval *z_statement; - php_oci_statement *statement; - ub2 type; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_statement) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_get_type(statement, &type)) { - RETURN_FALSE; - } - - switch (type) { - case OCI_STMT_SELECT: - RETVAL_STRING("SELECT"); - break; - case OCI_STMT_UPDATE: - RETVAL_STRING("UPDATE"); - break; - case OCI_STMT_DELETE: - RETVAL_STRING("DELETE"); - break; - case OCI_STMT_INSERT: - RETVAL_STRING("INSERT"); - break; - case OCI_STMT_CREATE: - RETVAL_STRING("CREATE"); - break; - case OCI_STMT_DROP: - RETVAL_STRING("DROP"); - break; - case OCI_STMT_ALTER: - RETVAL_STRING("ALTER"); - break; - case OCI_STMT_BEGIN: - RETVAL_STRING("BEGIN"); - break; - case OCI_STMT_DECLARE: - RETVAL_STRING("DECLARE"); - break; - case OCI_STMT_CALL: - RETVAL_STRING("CALL"); - break; - default: - RETVAL_STRING("UNKNOWN"); - } -} -/* }}} */ - -/* {{{ Return the row count of an OCI statement */ -PHP_FUNCTION(oci_num_rows) -{ - zval *z_statement; - php_oci_statement *statement; - ub4 rowcount; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_statement) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - if (php_oci_statement_get_numrows(statement, &rowcount)) { - RETURN_FALSE; - } - RETURN_LONG(rowcount); -} -/* }}} */ - -/* {{{ Deletes collection object*/ -PHP_FUNCTION(oci_free_collection) -{ - zval *tmp, *z_collection; - php_oci_collection *collection; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); - - zend_list_close(collection->id); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Append an object to the collection */ -PHP_FUNCTION(oci_collection_append) -{ - zval *tmp, *z_collection; - php_oci_collection *collection; - char *value; - size_t value_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); - - if (php_oci_collection_append(collection, value, (int) value_len)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Retrieve the value at collection index ndx */ -PHP_FUNCTION(oci_collection_element_get) -{ - zval *tmp, *z_collection; - php_oci_collection *collection; - zend_long element_index; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &z_collection, oci_coll_class_entry_ptr, &element_index) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); - - if (php_oci_collection_element_get(collection, element_index, return_value)) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ Assign a collection from another existing collection */ -PHP_FUNCTION(oci_collection_assign) -{ - zval *tmp_dest, *tmp_from, *z_collection_dest, *z_collection_from; - php_oci_collection *collection_dest, *collection_from; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &z_collection_dest, oci_coll_class_entry_ptr, &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_collection_dest), "collection", sizeof("collection")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find collection property. The first argument should be valid collection object"); - RETURN_FALSE; - } - - if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_collection_from), "collection", sizeof("collection")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find collection property. The second argument should be valid collection object"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(tmp_dest, collection_dest); - PHP_OCI_ZVAL_TO_COLLECTION(tmp_from, collection_from); - - if (php_oci_collection_assign(collection_dest, collection_from)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Assign element val to collection at index ndx */ -PHP_FUNCTION(oci_collection_element_assign) -{ - zval *tmp, *z_collection; - php_oci_collection *collection; - size_t value_len; - zend_long element_index; - char *value; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); - - if (php_oci_collection_element_set(collection, element_index, value, (int) value_len)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Return the size of a collection */ -PHP_FUNCTION(oci_collection_size) -{ - zval *tmp, *z_collection; - php_oci_collection *collection; - sb4 size = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); - - if (php_oci_collection_size(collection, &size)) { - RETURN_FALSE; - } - RETURN_LONG(size); -} -/* }}} */ - -/* {{{ Return the max value of a collection. For a varray this is the maximum length of the array */ -PHP_FUNCTION(oci_collection_max) -{ - zval *tmp, *z_collection; - php_oci_collection *collection; - zend_long max; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); - - if (php_oci_collection_max(collection, &max)) { - RETURN_FALSE; - } - RETURN_LONG(max); -} -/* }}} */ - -/* {{{ Trim num elements from the end of a collection */ -PHP_FUNCTION(oci_collection_trim) -{ - zval *tmp, *z_collection; - php_oci_collection *collection; - zend_long trim_size; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &z_collection, oci_coll_class_entry_ptr, &trim_size) == FAILURE) { - RETURN_THROWS(); - } - - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find collection property"); - RETURN_FALSE; - } - - PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); - - if (php_oci_collection_trim(collection, trim_size)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Initialize a new collection */ -PHP_FUNCTION(oci_new_collection) -{ - zval *z_connection; - php_oci_connection *connection; - php_oci_collection *collection; - char *tdo, *schema = NULL; - size_t tdo_len, schema_len = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|s!", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) { - RETURN_THROWS(); - } - - PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - - if ( (collection = php_oci_collection_create(connection, tdo, (int) tdo_len, schema, (int) schema_len)) ) { - object_init_ex(return_value, oci_coll_class_entry_ptr); - add_property_resource(return_value, "collection", collection->id); - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ Get the next statement resource from an Oracle 12c PL/SQL Implicit Result Set */ -PHP_FUNCTION(oci_get_implicit_resultset) -{ - zval *z_statement; - php_oci_statement *statement; - php_oci_statement *imp_statement; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_RESOURCE(z_statement) - ZEND_PARSE_PARAMETERS_END(); - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - imp_statement = php_oci_get_implicit_resultset(statement); - - if (imp_statement) { - if (php_oci_statement_execute(imp_statement, (ub4)OCI_DEFAULT)) - RETURN_FALSE; - RETURN_RES(imp_statement->id); - } - RETURN_FALSE; -} - -/* }}} */ - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c deleted file mode 100644 index d8eb51a6ef10..000000000000 --- a/ext/oci8/oci8_lob.c +++ /dev/null @@ -1,949 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | - | Thies C. Arntzen | - | | - | Collection support by Andy Sautins | - | Temporary LOB support by David Benson | - | ZTS per process OCIPLogon by Harald Radi | - | | - | Redesigned by: Antony Dovgal | - | Andi Gutmans | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" - -#ifdef HAVE_OCI8 - -#include "php_oci8.h" -#include "php_oci8_int.h" - -/* for import/export functions */ -#include - -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -/* {{{ php_oci_lob_create() - Create LOB descriptor and allocate all the resources needed */ -php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_long type) -{ - php_oci_descriptor *descriptor; - sword errstatus; - - switch (type) { - case OCI_DTYPE_FILE: - case OCI_DTYPE_LOB: - case OCI_DTYPE_ROWID: - /* these three are allowed */ - break; - default: - php_error_docref(NULL, E_WARNING, "Unknown descriptor type " ZEND_LONG_FMT, type); - return NULL; - break; - } - - descriptor = ecalloc(1, sizeof(php_oci_descriptor)); - descriptor->type = (ub4) type; - descriptor->connection = connection; - GC_ADDREF(descriptor->connection->id); - - PHP_OCI_CALL_RETURN(errstatus, OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0)); - - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus); - PHP_OCI_HANDLE_ERROR(connection, OCI_G(errcode)); - efree(descriptor); - return NULL; - } else { - OCI_G(errcode) = 0; /* retain backwards compat with OCI8 1.4 */ - } - - PHP_OCI_REGISTER_RESOURCE(descriptor, le_descriptor); - - descriptor->lob_current_position = 0; - descriptor->lob_size = -1; /* we should set it to -1 to know, that it's just not initialized */ - descriptor->buffering = PHP_OCI_LOB_BUFFER_DISABLED; /* buffering is off by default */ - descriptor->charset_form = SQLCS_IMPLICIT; /* default value */ - descriptor->charset_id = connection->charset; - descriptor->is_open = 0; - descriptor->chunk_size = 0; - - if (descriptor->type == OCI_DTYPE_LOB || descriptor->type == OCI_DTYPE_FILE) { - /* add Lobs & Files to hash. we'll flush them at the end */ - if (!connection->descriptors) { - ALLOC_HASHTABLE(connection->descriptors); - zend_hash_init(connection->descriptors, 0, NULL, php_oci_descriptor_flush_hash_dtor, 0); - connection->descriptor_count = 0; - } - - descriptor->index = (connection->descriptor_count)++; - if (connection->descriptor_count == LONG_MAX) { - php_error_docref(NULL, E_WARNING, "Internal descriptor counter has reached limit"); - php_oci_connection_descriptors_free(connection); - return NULL; - } - - zend_hash_index_update_ptr(connection->descriptors, descriptor->index, descriptor); - } - return descriptor; - -} -/* }}} */ - -/* {{{ php_oci_lob_get_length() - Get length of the LOB. The length is cached so we don't need to ask Oracle every time */ -int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length) -{ - php_oci_connection *connection = descriptor->connection; - sword errstatus; - - *length = 0; - - if (descriptor->lob_size >= 0) { - *length = descriptor->lob_size; - return 0; - } else { - if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(errstatus, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - } - - PHP_OCI_CALL_RETURN(errstatus, OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - descriptor->lob_size = *length; - - if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(errstatus, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - } - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_callback() - Append LOB portion to a memory buffer */ -sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp) -{ - ub4 lenp = (ub4) len; - php_oci_lob_ctx *ctx = (php_oci_lob_ctx *)ctxp; - - switch (piece) - { - case OCI_LAST_PIECE: - if ((*(ctx->lob_len) + lenp) > (ctx->alloc_len)) { - /* this should not happen ever */ - *(ctx->lob_data) = NULL; - *(ctx->lob_len) = 0; - return OCI_ERROR; - } - memcpy(*(ctx->lob_data) + *(ctx->lob_len), bufxp, (size_t) lenp); - *(ctx->lob_len) += lenp; - *(*(ctx->lob_data) + *(ctx->lob_len)) = 0x00; - return OCI_CONTINUE; - - case OCI_FIRST_PIECE: - case OCI_NEXT_PIECE: - if ((*(ctx->lob_len) + lenp) > ctx->alloc_len) { - /* this should not happen ever */ - *(ctx->lob_data) = NULL; - *(ctx->lob_len) = 0; - return OCI_ERROR; - } - memcpy(*(ctx->lob_data) + *(ctx->lob_len), bufxp, (size_t) lenp); - *(ctx->lob_len) += lenp; - return OCI_CONTINUE; - - default: { - php_error_docref(NULL, E_WARNING, "Unexpected LOB piece id received (value:%d)", piece); - *(ctx->lob_data) = NULL; - *(ctx->lob_len) = 0; - return OCI_ERROR; - } - } -} -/* }}} */ - -/* {{{ php_oci_lob_calculate_buffer() - Work out the size for LOB buffering */ -static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, zend_long read_length) -{ - php_oci_connection *connection = descriptor->connection; - ub4 chunk_size; - sword errstatus; - - if (descriptor->type == OCI_DTYPE_FILE) { - return (int) read_length; - } - - if (!descriptor->chunk_size) { - PHP_OCI_CALL_RETURN(errstatus, OCILobGetChunkSize, (connection->svc, connection->err, descriptor->descriptor, &chunk_size)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return (int) read_length; /* we have to return original length here */ - } - descriptor->chunk_size = chunk_size; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - } - - if ((read_length % descriptor->chunk_size) != 0) { - return (int) descriptor->chunk_size * (((int) read_length / descriptor->chunk_size) + 1); - } - return (int) read_length; -} -/* }}} */ - -/* {{{ php_oci_lob_read() - Read specified portion of the LOB into the buffer */ -int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zend_long initial_offset, char **data, ub4 *data_len) -{ - php_oci_connection *connection = descriptor->connection; - ub4 length = 0; - int buffer_size = PHP_OCI_LOB_BUFFER_SIZE; - php_oci_lob_ctx ctx; - ub1 *bufp; - oraub8 bytes_read, offset = 0; - oraub8 requested_len = read_length; /* this is by default */ - oraub8 chars_read = 0; - int is_clob = 0; - sb4 bytes_per_char = 1; - sword errstatus; - - *data_len = 0; - *data = NULL; - - ctx.lob_len = data_len; - ctx.lob_data = data; - ctx.alloc_len = 0; - - if (php_oci_lob_get_length(descriptor, &length)) { - return 1; - } - - if (length <= 0) { - return 0; - } - - if (initial_offset > length) { - php_error_docref(NULL, E_WARNING, "Offset must be less than size of the LOB"); - return 1; - } - - if (read_length == -1) { - requested_len = length; - } - - if ((ub4) requested_len > (length - (ub4) initial_offset)) { - requested_len = length - initial_offset; - } - - if (requested_len <= 0) { - return 0; - } - - offset = initial_offset; - - if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(errstatus, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - } else { - ub2 charset_id = 0; - - PHP_OCI_CALL_RETURN(errstatus, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - if (charset_id > 0) { /* charset_id is always > 0 for [N]CLOBs */ - is_clob = 1; - } - } - - if (is_clob) { - PHP_OCI_CALL_RETURN(errstatus, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - } else { - /* BLOBs don't have encoding, so bytes_per_char == 1 */ - } - - ctx.alloc_len = ((ub4) requested_len + 1) * bytes_per_char; - *data = ecalloc(bytes_per_char, requested_len + 1); - - if (is_clob) { - chars_read = requested_len; - bytes_read = 0; - } else { - chars_read = 0; - bytes_read = requested_len; - } - - buffer_size = ((int) requested_len < buffer_size ) ? (int) requested_len : buffer_size; /* optimize buffer size */ - buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size); /* use chunk size */ - - bufp = (ub1 *) ecalloc(1, buffer_size); - PHP_OCI_CALL_RETURN(errstatus, OCILobRead2, - ( - connection->svc, - connection->err, - descriptor->descriptor, - (oraub8 *)&bytes_read, /* IN/OUT bytes toread/read */ - (oraub8 *)&chars_read, /* IN/OUT chars toread/read */ - (oraub8) offset + 1, /* offset (starts with 1) */ - (dvoid *) bufp, - (oraub8) buffer_size, /* size of buffer */ - OCI_FIRST_PIECE, - (dvoid *)&ctx, - (OCICallbackLobRead2) php_oci_lob_callback, /* callback... */ - (ub2) descriptor->charset_id, /* The character set ID of the buffer data. */ - (ub1) descriptor->charset_form /* The character set form of the buffer data. */ - ) - ); - - efree(bufp); - - if (is_clob) { - offset = descriptor->lob_current_position + chars_read; - } else { - offset = descriptor->lob_current_position + bytes_read; - } - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - if (*data) { - efree(*data); - *data = NULL; - } - *data_len = 0; - return 1; - } - - descriptor->lob_current_position = (int)offset; - - if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(errstatus, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - if (*data) { - efree(*data); - *data = NULL; - } - *data_len = 0; - return 1; - } - } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_write() - Write data to the LOB */ -int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written) -{ - OCILobLocator *lob = (OCILobLocator *) descriptor->descriptor; - php_oci_connection *connection = (php_oci_connection *) descriptor->connection; - ub4 lob_length; - sword errstatus; - - *bytes_written = 0; - if (php_oci_lob_get_length(descriptor, &lob_length)) { - return 1; - } - - if (!data || data_len <= 0) { - return 0; - } - - if (offset > descriptor->lob_current_position) { - offset = descriptor->lob_current_position; - } - - PHP_OCI_CALL_RETURN(errstatus, OCILobWrite, - ( - connection->svc, - connection->err, - lob, - (ub4 *)&data_len, - (ub4) offset + 1, - (dvoid *) data, - (ub4) data_len, - OCI_ONE_PIECE, - (dvoid *)0, - (OCICallbackLobWrite) 0, - (ub2) descriptor->charset_id, - (ub1) descriptor->charset_form - ) - ); - - if (errstatus) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - *bytes_written = 0; - return 1; - } - *bytes_written = data_len; - descriptor->lob_current_position += data_len; - - if ((int) descriptor->lob_current_position > (int) descriptor->lob_size) { - descriptor->lob_size = descriptor->lob_current_position; - } - - /* marking buffer as used */ - if (descriptor->buffering == PHP_OCI_LOB_BUFFER_ENABLED) { - descriptor->buffering = PHP_OCI_LOB_BUFFER_USED; - } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_set_buffering() - Turn buffering off/onn for this particular LOB */ -int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off) -{ - php_oci_connection *connection = descriptor->connection; - sword errstatus; - - if (!on_off && descriptor->buffering == PHP_OCI_LOB_BUFFER_DISABLED) { - /* disabling when it's already off */ - return 0; - } - - if (on_off && descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) { - /* enabling when it's already on */ - return 0; - } - - if (on_off) { - PHP_OCI_CALL_RETURN(errstatus, OCILobEnableBuffering, (connection->svc, connection->err, descriptor->descriptor)); - } else { - PHP_OCI_CALL_RETURN(errstatus, OCILobDisableBuffering, (connection->svc, connection->err, descriptor->descriptor)); - } - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - descriptor->buffering = on_off ? PHP_OCI_LOB_BUFFER_ENABLED : PHP_OCI_LOB_BUFFER_DISABLED; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_get_buffering() - Return current buffering state for the LOB */ -int php_oci_lob_get_buffering (php_oci_descriptor *descriptor) -{ - if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) { - return 1; - } else { - return 0; - } -} -/* }}} */ - -/* {{{ php_oci_lob_copy() - Copy one LOB (or its part) to another one */ -int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from, zend_long length) -{ - php_oci_connection *connection = descriptor_dest->connection; - ub4 length_dest, length_from, copy_len; - sword errstatus; - - if (php_oci_lob_get_length(descriptor_dest, &length_dest)) { - return 1; - } - - if (php_oci_lob_get_length(descriptor_from, &length_from)) { - return 1; - } - - if (length == -1) { - copy_len = length_from - descriptor_from->lob_current_position; - } else { - copy_len = (ub4) length; - } - - if ((int)copy_len <= 0) { - /* silently fail, there is nothing to copy */ - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCILobCopy, - ( - connection->svc, - connection->err, - descriptor_dest->descriptor, - descriptor_from->descriptor, - copy_len, - descriptor_dest->lob_current_position+1, - descriptor_from->lob_current_position+1 - ) - ); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_close() - Close LOB */ -int php_oci_lob_close (php_oci_descriptor *descriptor) -{ - php_oci_connection *connection = descriptor->connection; - sword errstatus; - - if (descriptor->is_open) { - PHP_OCI_CALL_RETURN(errstatus, OCILobClose, (connection->svc, connection->err, descriptor->descriptor)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - } - - if (php_oci_temp_lob_close(descriptor)) { - return 1; - } - - return 0; -} -/* }}} */ - -/* {{{ php_oci_temp_lob_close() - Close Temporary LOB */ -int php_oci_temp_lob_close (php_oci_descriptor *descriptor) -{ - php_oci_connection *connection = descriptor->connection; - int is_temporary; - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - if (is_temporary) { - PHP_OCI_CALL_RETURN(errstatus, OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_flush() - Flush buffers for the LOB (only if they have been used) */ -int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag) -{ - OCILobLocator *lob = descriptor->descriptor; - php_oci_connection *connection = descriptor->connection; - sword errstatus; - - if (!lob) { - return 1; - } - - switch (flush_flag) { - case 0: - case OCI_LOB_BUFFER_FREE: - /* only these two are allowed */ - break; - default: - php_error_docref(NULL, E_WARNING, "Invalid flag value: " ZEND_LONG_FMT, flush_flag); - return 1; - break; - } - - /* do not really flush buffer, but report success - * to suppress OCI error when flushing not used buffer - * */ - if (descriptor->buffering != PHP_OCI_LOB_BUFFER_USED) { - return 0; - } - - PHP_OCI_CALL_RETURN(errstatus, OCILobFlushBuffer, (connection->svc, connection->err, lob, (ub4) flush_flag)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - /* marking buffer as enabled and not used */ - descriptor->buffering = PHP_OCI_LOB_BUFFER_ENABLED; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_free() - Close LOB descriptor and free associated resources */ -void php_oci_lob_free (php_oci_descriptor *descriptor) -{ - if (!descriptor || !descriptor->connection) { - return; - } - - if (descriptor->connection->descriptors) { - if (zend_hash_num_elements(descriptor->connection->descriptors) == 0) { - descriptor->connection->descriptor_count = 0; - } else { - /* delete descriptor from the hash */ - zend_hash_index_del(descriptor->connection->descriptors, descriptor->index); - if (descriptor->index + 1 == descriptor->connection->descriptor_count) { - /* If the descriptor being freed is the end-most one - * allocated, then the descriptor_count is reduced so - * a future descriptor can reuse the hash table index. - * This can prevent the hash index range increasing in - * the common case that each descriptor is - * allocated/used/freed before another descriptor is - * needed. However it is possible that a script frees - * descriptors in arbitrary order which would prevent - * descriptor_count ever being reduced to zero until - * zend_hash_num_elements() returns 0. - */ - descriptor->connection->descriptor_count--; - } - } - } - - /* flushing Lobs & Files with buffering enabled */ - if ((descriptor->type == OCI_DTYPE_FILE || descriptor->type == OCI_DTYPE_LOB) && descriptor->buffering == PHP_OCI_LOB_BUFFER_USED) { - php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE); - } - - if (descriptor->type == OCI_DTYPE_LOB) { - php_oci_temp_lob_close(descriptor); - } - - PHP_OCI_CALL(OCIDescriptorFree, (descriptor->descriptor, descriptor->type)); - - zend_list_delete(descriptor->connection->id); - efree(descriptor); -} -/* }}} */ - -/* {{{ php_oci_lob_import() - Import LOB contents from the given file */ -int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename) -{ - int fp; - ub4 loblen; - OCILobLocator *lob = (OCILobLocator *)descriptor->descriptor; - php_oci_connection *connection = descriptor->connection; - char buf[8192]; - ub4 offset = 1; - sword errstatus; - - if (php_check_open_basedir(filename)) { - return 1; - } - - if ((fp = VCWD_OPEN(filename, O_RDONLY|O_BINARY)) == -1) { - php_error_docref(NULL, E_WARNING, "Can't open file %s", filename); - return 1; - } - - while ((loblen = read(fp, &buf, sizeof(buf))) > 0) { - PHP_OCI_CALL_RETURN(errstatus, - OCILobWrite, - ( - connection->svc, - connection->err, - lob, - &loblen, - offset, - (dvoid *) &buf, - loblen, - OCI_ONE_PIECE, - (dvoid *)0, - (OCICallbackLobWrite) 0, - (ub2) descriptor->charset_id, - (ub1) descriptor->charset_form - ) - ); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - close(fp); - return 1; - } else { - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - } - offset += loblen; - } - close(fp); - - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_append() - Append data to the end of the LOB */ -int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from) -{ - php_oci_connection *connection = descriptor_dest->connection; - OCILobLocator *lob_dest = descriptor_dest->descriptor; - OCILobLocator *lob_from = descriptor_from->descriptor; - ub4 dest_len, from_len; - sword errstatus; - - if (php_oci_lob_get_length(descriptor_dest, &dest_len)) { - return 1; - } - - if (php_oci_lob_get_length(descriptor_from, &from_len)) { - return 1; - } - - if (from_len <= 0) { - return 0; - } - - PHP_OCI_CALL_RETURN(errstatus, OCILobAppend, (connection->svc, connection->err, lob_dest, lob_from)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_truncate() - Truncate LOB to the given length */ -int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_length) -{ - php_oci_connection *connection = descriptor->connection; - OCILobLocator *lob = descriptor->descriptor; - ub4 lob_length; - sword errstatus; - - if (php_oci_lob_get_length(descriptor, &lob_length)) { - return 1; - } - - if (lob_length <= 0) { - return 0; - } - - if (new_lob_length < 0) { - php_error_docref(NULL, E_WARNING, "Size must be greater than or equal to 0"); - return 1; - } - - if (new_lob_length > lob_length) { - php_error_docref(NULL, E_WARNING, "Size must be less than or equal to the current LOB size"); - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCILobTrim, (connection->svc, connection->err, lob, (ub4) new_lob_length)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - descriptor->lob_size = (ub4) new_lob_length; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_erase() - Erase (or fill with whitespaces, depending on LOB type) the LOB (or its part) */ -int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased) -{ - php_oci_connection *connection = descriptor->connection; - OCILobLocator *lob = descriptor->descriptor; - ub4 lob_length; - sword errstatus; - - *bytes_erased = 0; - - if (php_oci_lob_get_length(descriptor, &lob_length)) { - return 1; - } - - if (offset == -1) { - offset = descriptor->lob_current_position; - } - - if (length == -1) { - length = lob_length; - } - - PHP_OCI_CALL_RETURN(errstatus, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, (ub4) offset+1)); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - *bytes_erased = length; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_is_equal() - Compare two LOB descriptors and figure out if they are pointing to the same LOB */ -int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result) -{ - php_oci_connection *connection = descriptor_first->connection; - OCILobLocator *first_lob = descriptor_first->descriptor; - OCILobLocator *second_lob = descriptor_second->descriptor; - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCILobIsEqual, (connection->env, first_lob, second_lob, result)); - - if (errstatus) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_lob_write_tmp() - Create temporary LOB and write data to it */ -int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char *data, int data_len) -{ - php_oci_connection *connection = descriptor->connection; - OCILobLocator *lob = descriptor->descriptor; - ub4 bytes_written = 0; - sword errstatus; - - switch (type) { - case OCI_TEMP_BLOB: - case OCI_TEMP_CLOB: - /* only these two are allowed */ - break; - default: - php_error_docref(NULL, E_WARNING, "Invalid temporary lob type: " ZEND_LONG_FMT, type); - return 1; - break; - } - - if (data_len < 0) { - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCILobCreateTemporary, - ( - connection->svc, - connection->err, - lob, - OCI_DEFAULT, - OCI_DEFAULT, - (ub1)type, - OCI_ATTR_NOCACHE, - OCI_DURATION_SESSION - ) - ); - - if (errstatus) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCILobOpen, (connection->svc, connection->err, lob, OCI_LOB_READWRITE)); - - if (errstatus) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - - descriptor->is_open = 1; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - - return php_oci_lob_write(descriptor, 0, data, data_len, &bytes_written); -} -/* }}} */ - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c deleted file mode 100644 index 91bba23127b1..000000000000 --- a/ext/oci8/oci8_statement.c +++ /dev/null @@ -1,1977 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | - | Thies C. Arntzen | - | | - | Collection support by Andy Sautins | - | Temporary LOB support by David Benson | - | ZTS per process OCIPLogon by Harald Radi | - | | - | Redesigned by: Antony Dovgal | - | Andi Gutmans | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" - -#ifdef HAVE_OCI8 - -#include "php_oci8.h" -#include "php_oci8_int.h" - -#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64) -typedef ub8 oci_phpsized_int; -#else -typedef ub4 oci_phpsized_int; -#endif - -/* {{{ php_oci_statement_create() - Create statemend handle and allocate necessary resources */ -php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len) -{ - php_oci_statement *statement; - sword errstatus; - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - - statement = ecalloc(1,sizeof(php_oci_statement)); - - if (!query_len) { - /* do not allocate stmt handle for refcursors, we'll get it from OCIStmtPrepare2() */ - PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->stmt), OCI_HTYPE_STMT, 0, NULL)); - } - - PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->err), OCI_HTYPE_ERROR, 0, NULL)); - - if (query_len > 0) { - PHP_OCI_CALL_RETURN(errstatus, OCIStmtPrepare2, - ( - connection->svc, - &(statement->stmt), - connection->err, - (text *)query, - query_len, - NULL, - 0, - OCI_NTV_SYNTAX, - OCI_DEFAULT - ) - ); -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_SQLTEXT_ENABLED()) { - DTRACE_OCI8_SQLTEXT(connection, connection->client_id, statement, query); - } -#endif /* HAVE_OCI8_DTRACE */ - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - - PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_STRLS_CACHE_DELETE)); - PHP_OCI_CALL(OCIHandleFree,(statement->err, OCI_HTYPE_ERROR)); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - efree(statement); - return NULL; - } - } - - if (query && query_len) { - statement->last_query = ecalloc(1, query_len + 1); - memcpy(statement->last_query, query, query_len); - statement->last_query_len = query_len; - } - else { - statement->last_query = NULL; - statement->last_query_len = 0; - } - - statement->connection = connection; - statement->has_data = 0; - statement->has_descr = 0; - statement->parent_stmtid = 0; - statement->impres_child_stmt = NULL; - statement->impres_count = 0; - statement->impres_flag = PHP_OCI_IMPRES_UNKNOWN; /* may or may not have Implicit Result Set children */ - GC_ADDREF(statement->connection->id); - - if (OCI_G(default_prefetch) >= 0) { - php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch)); - } else { - php_oci_statement_set_prefetch(statement, (ub4)100); /* semi-arbitrary, "sensible default" */ - } - - if (OCI_G(prefetch_lob_size) > 0) { - statement->prefetch_lob_size = (ub4)OCI_G(prefetch_lob_size); - } else { - statement->prefetch_lob_size = 0; - } - - PHP_OCI_REGISTER_RESOURCE(statement, le_statement); - - OCI_G(num_statements)++; - - return statement; -} -/* }}} */ - -/* {{{ php_oci_get_implicit_resultset() - Fetch implicit result set statement resource */ -php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement) -{ -#if (OCI_MAJOR_VERSION < 12) - php_error_docref(NULL, E_WARNING, "Implicit results are available in Oracle Database 12c onwards"); - return NULL; -#else - void *result; - ub4 rtype; - php_oci_statement *statement2; /* implicit result set statement handle */ - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCIStmtGetNextResult, (statement->stmt, statement->err, &result, &rtype, OCI_DEFAULT)); - if (errstatus == OCI_NO_DATA) { - return NULL; - } - - if (rtype != OCI_RESULT_TYPE_SELECT) { - /* Only OCI_RESULT_TYPE_SELECT is supported by Oracle DB 12cR1 */ - php_error_docref(NULL, E_WARNING, "Unexpected implicit result type returned from Oracle Database"); - return NULL; - } else { - statement2 = ecalloc(1,sizeof(php_oci_statement)); - - PHP_OCI_CALL(OCIHandleAlloc, (statement->connection->env, (dvoid **)&(statement2->err), OCI_HTYPE_ERROR, 0, NULL)); - statement2->stmt = (OCIStmt *)result; - statement2->parent_stmtid = statement->id; - statement2->impres_child_stmt = NULL; - statement2->impres_count = 0; - statement2->impres_flag = PHP_OCI_IMPRES_IS_CHILD; - statement2->connection = statement->connection; - statement2->errcode = 0; - statement2->last_query = NULL; - statement2->last_query_len = 0; - statement2->columns = NULL; - statement2->binds = NULL; - statement2->defines = NULL; - statement2->ncolumns = 0; - statement2->executed = 0; - statement2->has_data = 0; - statement2->has_descr = 0; - statement2->stmttype = 0; - - GC_ADDREF(statement->id); - GC_ADDREF(statement2->connection->id); - - php_oci_statement_set_prefetch(statement2, statement->prefetch_count); - statement2->prefetch_lob_size = statement->prefetch_lob_size; - - PHP_OCI_REGISTER_RESOURCE(statement2, le_statement); - - OCI_G(num_statements)++; - - return statement2; - } -#endif /* OCI_MAJOR_VERSION < 12 */ -} -/* }}} */ - -/* {{{ php_oci_statement_set_prefetch() - Set prefetch buffer size for the statement */ -int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch) -{ - sword errstatus; - - if (prefetch > 20000) { - prefetch = 20000; /* keep it somewhat sane */ - } - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err)); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - statement->prefetch_count = 0; - return 1; - } - statement->prefetch_count = prefetch; - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_cleanup_pre_fetch() - Helper function to cleanup ref-cursors and descriptors from the previous row */ -int php_oci_cleanup_pre_fetch(zval *data) -{ - php_oci_out_column *outcol = (php_oci_out_column*) Z_PTR_P(data); - - if (!outcol->is_descr && !outcol->is_cursor) - return ZEND_HASH_APPLY_KEEP; - - switch(outcol->data_type) { - case SQLT_CLOB: - case SQLT_BLOB: - case SQLT_RDD: - case SQLT_BFILE: - if (outcol->descid) { - zend_list_delete(outcol->descid); - outcol->descid = 0; - } - break; - case SQLT_RSET: - if (outcol->stmtid) { - zend_list_delete(outcol->stmtid); - outcol->stmtid = 0; - outcol->nested_statement = NULL; - } - break; - default: - break; - } - return ZEND_HASH_APPLY_KEEP; - -} -/* }}} */ - -/* {{{ php_oci_statement_fetch() - Fetch a row from the statement */ -int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows) -{ - int i; - void *handlepp; - ub4 typep, iterp, idxp; - ub1 in_outp, piecep; - bool piecewisecols = 0; - php_oci_out_column *column; - sword errstatus; - - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - - if (statement->has_descr && statement->columns) { - zend_hash_apply(statement->columns, php_oci_cleanup_pre_fetch); - } - - PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch2, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, 0, OCI_DEFAULT)); - - if (errstatus == OCI_NO_DATA || nrows == 0) { - if (statement->last_query == NULL) { - /* reset define-list for refcursors */ - if (statement->columns) { - zend_hash_destroy(statement->columns); - efree(statement->columns); - statement->columns = NULL; - statement->ncolumns = 0; - } - statement->executed = 0; - } - - statement->has_data = 0; - - if (nrows == 0) { - /* this is exactly what we requested */ - return 0; - } - return 1; - } - - /* reset length for all piecewise columns */ - for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0); - if (column && column->piecewise) { - column->retlen4 = 0; - piecewisecols = 1; - } - } - - while (errstatus == OCI_NEED_DATA) { - if (piecewisecols) { - PHP_OCI_CALL_RETURN(errstatus, - OCIStmtGetPieceInfo, - ( - statement->stmt, - statement->err, - &handlepp, - &typep, - &in_outp, - &iterp, - &idxp, - &piecep - ) - ); - - /* scan through our columns for a piecewise column with a matching handle */ - for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0); - if (column && column->piecewise && handlepp == column->oci_define) { - if (!column->data) { - column->data = (text *) ecalloc(1, PHP_OCI_PIECE_SIZE + 1); - } else { - column->data = erealloc(column->data, column->retlen4 + PHP_OCI_PIECE_SIZE + 1); - } - column->cb_retlen = PHP_OCI_PIECE_SIZE; - - /* and instruct fetch to fetch waiting piece into our buffer */ - PHP_OCI_CALL(OCIStmtSetPieceInfo, - ( - (void *) column->oci_define, - OCI_HTYPE_DEFINE, - statement->err, - ((char*)column->data) + column->retlen4, - &(column->cb_retlen), - piecep, - &column->indicator, - &column->retcode - ) - ); - } - } - } - - PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch2, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, 0, OCI_DEFAULT)); - - if (piecewisecols) { - for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0); - if (column && column->piecewise && handlepp == column->oci_define) { - column->retlen4 += column->cb_retlen; - } - } - } - } - - if (errstatus == OCI_SUCCESS_WITH_INFO || errstatus == OCI_SUCCESS) { - statement->has_data = 1; - - /* do the stuff needed for OCIDefineByPos */ - for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0); - if (column == NULL) { - continue; - } - - if (!column->define) { - continue; - } - - ZEND_ASSERT(Z_ISREF(column->define->val)); - zval_ptr_dtor(Z_REFVAL(column->define->val)); - ZVAL_NULL(Z_REFVAL(column->define->val)); - php_oci_column_to_zval(column, Z_REFVAL(column->define->val), 0); - } - - return 0; - } - - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - - statement->has_data = 0; - - return 1; -} -/* }}} */ - -/* {{{ php_oci_statement_get_column() - Get column from the result set */ -php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len) -{ - php_oci_out_column *column = NULL; - int i; - - if (statement->columns == NULL) { /* we release the columns at the end of a fetch */ - return NULL; - } - - if (column_name) { - for (i = 0; i < statement->ncolumns; i++) { - column = php_oci_statement_get_column(statement, i + 1, NULL, 0); - if (column == NULL) { - continue; - } else if (((int) column->name_len == column_name_len) && (!strncmp(column->name, column_name, column_name_len))) { - return column; - } - } - } else if (column_index != -1) { - if ((column = zend_hash_index_find_ptr(statement->columns, column_index)) == NULL) { - return NULL; - } - return column; - } - - return NULL; -} -/* }}} */ - -/* {{{ php_oci_define_callback() */ -sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcpp) -{ - php_oci_out_column *outcol = (php_oci_out_column *)ctx; - - if (!outcol) { - - php_error_docref(NULL, E_WARNING, "Invalid context pointer value"); - return OCI_ERROR; - } - - switch(outcol->data_type) { - case SQLT_RSET: { - php_oci_statement *nested_stmt; - - nested_stmt = php_oci_statement_create(outcol->statement->connection, NULL, 0); - if (!nested_stmt) { - return OCI_ERROR; - } - nested_stmt->parent_stmtid = outcol->statement->id; - GC_ADDREF(outcol->statement->id); - outcol->nested_statement = nested_stmt; - outcol->stmtid = nested_stmt->id; - - *bufpp = nested_stmt->stmt; - *alenpp = &(outcol->retlen4); - *piecep = OCI_ONE_PIECE; - *indpp = &(outcol->indicator); - *rcpp = &(outcol->retcode); - return OCI_CONTINUE; - } - break; - case SQLT_RDD: - case SQLT_BLOB: - case SQLT_CLOB: - case SQLT_BFILE: { - php_oci_descriptor *descr; - int dtype; - - if (outcol->data_type == SQLT_BFILE) { - dtype = OCI_DTYPE_FILE; - } else if (outcol->data_type == SQLT_RDD ) { - dtype = OCI_DTYPE_ROWID; - } else { - dtype = OCI_DTYPE_LOB; - } - - descr = php_oci_lob_create(outcol->statement->connection, dtype); - if (!descr) { - return OCI_ERROR; - } - outcol->descid = descr->id; - descr->charset_form = outcol->charset_form; - - *bufpp = descr->descriptor; - *alenpp = &(outcol->retlen4); - *piecep = OCI_ONE_PIECE; - *indpp = &(outcol->indicator); - *rcpp = &(outcol->retcode); - - return OCI_CONTINUE; - } - break; - } - return OCI_ERROR; -} -/* }}} */ - -/* {{{ php_oci_statement_execute() - Execute statement */ -int php_oci_statement_execute(php_oci_statement *statement, ub4 mode) -{ - php_oci_out_column *outcol; - OCIParam *param = NULL; - text *colname; - ub4 counter; - ub2 define_type; - ub4 iters; - ub4 colcount; - ub2 dynamic; - dvoid *buf; - sword errstatus; - - switch (mode) { - case OCI_COMMIT_ON_SUCCESS: - case OCI_DESCRIBE_ONLY: - case OCI_DEFAULT: - /* only these are allowed */ -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_EXECUTE_MODE_ENABLED()) { - DTRACE_OCI8_EXECUTE_MODE(statement->connection, statement->connection->client_id, statement, mode); - } -#endif /* HAVE_OCI8_DTRACE */ - break; - default: - php_error_docref(NULL, E_WARNING, "Invalid execute mode given: %d", mode); - return 1; - break; - } - - if (!statement->stmttype) { - /* get statement type */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } else { - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - } - } - - if (statement->stmttype == OCI_STMT_SELECT) { - iters = 0; - } else { - iters = 1; - } - - if (statement->last_query) { /* Don't execute REFCURSORS or Implicit Result Set handles */ - - if (statement->binds) { - int result = 0; - zend_hash_apply_with_argument(statement->binds, php_oci_bind_pre_exec, (void *)&result); - if (result) { - return 1; - } - } - - /* execute statement */ - PHP_OCI_CALL_RETURN(errstatus, OCIStmtExecute, (statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL, NULL, mode)); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - if (statement->binds) { - zend_hash_apply(statement->binds, php_oci_bind_post_exec); - } - - if (mode & OCI_COMMIT_ON_SUCCESS) { - /* No need to rollback on disconnect */ - statement->connection->rb_on_disconnect = 0; - } else if (statement->stmttype != OCI_STMT_SELECT) { - /* Assume some uncommitted DML occurred */ - statement->connection->rb_on_disconnect = 1; - } - /* else for SELECT with OCI_NO_AUTO_COMMIT, leave - * "rb_on_disconnect" at its previous value. SELECT can't - * initiate uncommitted DML. (An AUTONOMOUS_TRANSACTION in - * invoked PL/SQL must explicitly rollback/commit else the - * SELECT fails). - */ - - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - } - - if (statement->stmttype == OCI_STMT_SELECT && statement->executed == 0) { - /* we only need to do the define step is this very statement is executed the first time! */ - statement->executed = 1; - - ALLOC_HASHTABLE(statement->columns); - zend_hash_init(statement->columns, 13, NULL, php_oci_column_hash_dtor, 0); - - counter = 1; - - /* get number of columns */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0, OCI_ATTR_PARAM_COUNT, statement->err)); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - statement->ncolumns = colcount; - - for (counter = 1; counter <= colcount; counter++) { - outcol = (php_oci_out_column *) ecalloc(1, sizeof(php_oci_out_column)); - - outcol = zend_hash_index_update_ptr(statement->columns, counter, outcol); - - /* get column */ - PHP_OCI_CALL_RETURN(errstatus, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m, counter)); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* get column datatype */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_type, (ub4 *)0, OCI_ATTR_DATA_TYPE, statement->err)); - - if (errstatus != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* get character set form */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_form, (ub4 *)0, OCI_ATTR_CHARSET_FORM, statement->err)); - - if (errstatus != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* get character set id */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_id, (ub4 *)0, OCI_ATTR_CHARSET_ID, statement->err)); - - if (errstatus != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* get size of the column */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_size, (dvoid *)0, OCI_ATTR_DATA_SIZE, statement->err)); - - if (errstatus != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - outcol->storage_size4 = outcol->data_size; - outcol->retlen = outcol->data_size; - - /* get scale of the column */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0, OCI_ATTR_SCALE, statement->err)); - - if (errstatus != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* get precision of the column */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->precision, (dvoid *)0, OCI_ATTR_PRECISION, statement->err)); - - if (errstatus != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* get name of the column */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid **)&colname, (ub4 *)&outcol->name_len, (ub4)OCI_ATTR_NAME, statement->err)); - - if (errstatus != OCI_SUCCESS) { - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - - outcol->name = ecalloc(1, outcol->name_len + 1); - memcpy(outcol->name, colname, outcol->name_len); - - /* find a user-set define */ - if (statement->defines) { - if ((outcol->define = zend_hash_str_find_ptr(statement->defines, outcol->name, outcol->name_len)) != NULL) { - if (outcol->define->type) { - outcol->data_type = outcol->define->type; - } - } - } - - buf = 0; - switch (outcol->data_type) { - case SQLT_RSET: - outcol->statement = statement; /* parent handle */ - - define_type = SQLT_RSET; - outcol->is_cursor = 1; - outcol->statement->has_descr = 1; - outcol->storage_size4 = -1; - outcol->retlen = -1; - dynamic = OCI_DYNAMIC_FETCH; - break; - - case SQLT_RDD: /* ROWID */ - case SQLT_BLOB: /* binary LOB */ - case SQLT_CLOB: /* character LOB */ - case SQLT_BFILE: /* binary file LOB */ - outcol->statement = statement; /* parent handle */ - - define_type = outcol->data_type; - outcol->is_descr = 1; - outcol->statement->has_descr = 1; - outcol->storage_size4 = -1; - outcol->chunk_size = 0; - dynamic = OCI_DYNAMIC_FETCH; - break; - - case SQLT_LNG: - case SQLT_LBI: - if (outcol->data_type == SQLT_LBI) { - define_type = SQLT_BIN; - } else { - define_type = SQLT_CHR; - } - outcol->storage_size4 = PHP_OCI_MAX_DATA_SIZE; - outcol->piecewise = 1; - dynamic = OCI_DYNAMIC_FETCH; - break; - - case SQLT_BIN: - default: - define_type = SQLT_CHR; - if (outcol->data_type == SQLT_BIN) { - define_type = SQLT_BIN; - } - if ((outcol->data_type == SQLT_DAT) || (outcol->data_type == SQLT_NUM) -#ifdef SQLT_TIMESTAMP - || (outcol->data_type == SQLT_TIMESTAMP) -#endif -#ifdef SQLT_TIMESTAMP_TZ - || (outcol->data_type == SQLT_TIMESTAMP_TZ) -#endif -#ifdef SQLT_TIMESTAMP_LTZ - || (outcol->data_type == SQLT_TIMESTAMP_LTZ) -#endif -#ifdef SQLT_INTERVAL_YM - || (outcol->data_type == SQLT_INTERVAL_YM) -#endif -#ifdef SQLT_INTERVAL_DS - || (outcol->data_type == SQLT_INTERVAL_DS) -#endif - ) { - outcol->storage_size4 = 512; /* XXX this should fit "most" NLS date-formats and Numbers */ -#if defined(SQLT_IBFLOAT) && defined(SQLT_IBDOUBLE) - } else if (outcol->data_type == SQLT_IBFLOAT || outcol->data_type == SQLT_IBDOUBLE) { - outcol->storage_size4 = 1024; -#endif - } else { - outcol->storage_size4++; /* add one for string terminator */ - } - - outcol->storage_size4 *= 3; - - dynamic = OCI_DEFAULT; - buf = outcol->data = (text *) safe_emalloc(1, outcol->storage_size4, 0); - memset(buf, 0, outcol->storage_size4); - break; - } - - if (dynamic == OCI_DYNAMIC_FETCH) { - PHP_OCI_CALL_RETURN(errstatus, - OCIDefineByPos, - ( - statement->stmt, /* IN/OUT handle to the requested SQL query */ - (OCIDefine **)&outcol->oci_define, /* IN/OUT pointer to a pointer to a define handle */ - statement->err, /* IN/OUT An error handle */ - counter, /* IN position in the select list */ - (dvoid *)NULL, /* IN/OUT pointer to a buffer */ - outcol->storage_size4, /* IN The size of each valuep buffer in bytes */ - define_type, /* IN The data type */ - (dvoid *)&outcol->indicator, /* IN pointer to an indicator variable or arr */ - (ub2 *)NULL, /* IN/OUT Pointer to array of length of data fetched */ - (ub2 *)NULL, /* OUT Pointer to array of column-level return codes */ - OCI_DYNAMIC_FETCH /* IN mode (OCI_DEFAULT, OCI_DYNAMIC_FETCH) */ - ) - ); - } else { - PHP_OCI_CALL_RETURN(errstatus, - OCIDefineByPos, - ( - statement->stmt, /* IN/OUT handle to the requested SQL query */ - (OCIDefine **)&outcol->oci_define, /* IN/OUT pointer to a pointer to a define handle */ - statement->err, /* IN/OUT An error handle */ - counter, /* IN position in the select list */ - (dvoid *)buf, /* IN/OUT pointer to a buffer */ - outcol->storage_size4, /* IN The size of each valuep buffer in bytes */ - define_type, /* IN The data type */ - (dvoid *)&outcol->indicator, /* IN pointer to an indicator variable or arr */ - (ub2 *)&outcol->retlen, /* IN/OUT Pointer to array of length of data fetched */ - (ub2 *)&outcol->retcode, /* OUT Pointer to array of column-level return codes */ - OCI_DEFAULT /* IN mode (OCI_DEFAULT, OCI_DYNAMIC_FETCH) */ - ) - ); - - } - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - /* Enable LOB data prefetching. */ -#if (OCI_MAJOR_VERSION > 12 || (OCI_MAJOR_VERSION == 12 && OCI_MINOR_VERSION >= 2)) - if ((outcol->data_type == SQLT_CLOB || outcol->data_type == SQLT_BLOB) && statement->prefetch_lob_size > 0) { - int get_lob_len = 1; /* == true */ - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (outcol->oci_define, OCI_HTYPE_DEFINE, &get_lob_len, 0, OCI_ATTR_LOBPREFETCH_LENGTH, statement->err)); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (outcol->oci_define, OCI_HTYPE_DEFINE, &(statement->prefetch_lob_size), 0, OCI_ATTR_LOBPREFETCH_SIZE, statement->err)); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - } -#endif - - /* additional define setup */ - switch (outcol->data_type) { - case SQLT_RSET: - case SQLT_BLOB: - case SQLT_CLOB: - case SQLT_RDD: - case SQLT_BFILE: - PHP_OCI_CALL_RETURN(errstatus, - OCIDefineDynamic, - ( - outcol->oci_define, - statement->err, - (dvoid *)outcol, - php_oci_define_callback - ) - ); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - break; - } - } - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - } - - return 0; -} -/* }}} */ - -/* {{{ php_oci_statement_cancel() - Cancel statement */ -int php_oci_statement_cancel(php_oci_statement *statement) -{ - return php_oci_statement_fetch(statement, 0); -} -/* }}} */ - -/* {{{ php_oci_statement_free() - Destroy statement handle and free associated resources */ -void php_oci_statement_free(php_oci_statement *statement) -{ - if (statement->stmt) { - if (statement->last_query_len) { /* FIXME: magical */ - PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, statement->errcode ? OCI_STRLS_CACHE_DELETE : OCI_DEFAULT)); - } else if (statement->impres_flag != PHP_OCI_IMPRES_IS_CHILD) { /* Oracle doc says don't free Implicit Result Set handles */ - PHP_OCI_CALL(OCIHandleFree, (statement->stmt, OCI_HTYPE_STMT)); - } - statement->stmt = NULL; - } - - if (statement->err) { - PHP_OCI_CALL(OCIHandleFree, (statement->err, OCI_HTYPE_ERROR)); - statement->err = NULL; - } - - if (statement->last_query) { - efree(statement->last_query); - } - - if (statement->binds) { - zend_hash_destroy(statement->binds); - efree(statement->binds); - } - - if (statement->defines) { - zend_hash_destroy(statement->defines); - efree(statement->defines); - } - - if (statement->columns) { - zend_hash_destroy(statement->columns); - efree(statement->columns); - } - - if (statement->parent_stmtid) { - zend_list_delete(statement->parent_stmtid); - } - - zend_list_delete(statement->connection->id); - efree(statement); - - OCI_G(num_statements)--; -} -/* }}} */ - -/* {{{ php_oci_bind_pre_exec() - Helper function */ -int php_oci_bind_pre_exec(zval *data, void *result) -{ - php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data); - zval *zv = &bind->val; - - *(int *)result = 0; - - ZVAL_DEREF(zv); - if (Z_TYPE_P(zv) == IS_ARRAY) { - /* These checks are currently valid for oci_bind_by_name, not - * oci_bind_array_by_name. Also bind->type and - * bind->indicator are not used for oci_bind_array_by_name. - */ - return 0; - } - switch (bind->type) { - case SQLT_NTY: - case SQLT_BFILEE: - case SQLT_CFILEE: - case SQLT_CLOB: - case SQLT_BLOB: - case SQLT_RDD: - if (Z_TYPE_P(zv) != IS_OBJECT) { - php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); - *(int *)result = 1; - } - break; - - case SQLT_CHR: - case SQLT_AFC: - case SQLT_INT: - case SQLT_NUM: -#if defined(OCI_MAJOR_VERSION) && OCI_MAJOR_VERSION >= 12 - case SQLT_BOL: -#endif - case SQLT_LBI: - case SQLT_BIN: - case SQLT_LNG: - if (Z_TYPE_P(zv) == IS_RESOURCE || Z_TYPE_P(zv) == IS_OBJECT) { - php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); - *(int *)result = 1; - } - break; - - case SQLT_RSET: - if (Z_TYPE_P(zv) != IS_RESOURCE) { - php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); - *(int *)result = 1; - } - break; - } - - /* reset all bind stuff to a normal state... */ - bind->indicator = 0; - - return 0; -} -/* }}} */ - -/* {{{ php_oci_bind_post_exec() - Helper function */ -int php_oci_bind_post_exec(zval *data) -{ - php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data); - php_oci_connection *connection = bind->parent_statement->connection; - sword errstatus; - zval *zv = &bind->val; - - ZVAL_DEREF(zv); - if (bind->indicator == -1) { /* NULL */ - if (Z_TYPE_P(zv) == IS_STRING) { - *Z_STRVAL_P(zv) = '\0'; /* XXX avoid warning in debug mode */ - } - zval_ptr_dtor(zv); - ZVAL_NULL(zv); - } else if (Z_TYPE_P(zv) == IS_STRING - && Z_STRLEN_P(zv) > 0 - && Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] != '\0') { - /* The post- PHP 5.3 feature for "interned" strings disallows - * their reallocation but (i) any IN binds either interned or - * not should already be null terminated and (ii) for OUT - * binds, php_oci_bind_out_callback() should have allocated a - * new string that we can modify here. - */ - ZVAL_NEW_STR(zv, zend_string_extend(Z_STR_P(zv), Z_STRLEN_P(zv)+1, 0)); - Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] = '\0'; - } else if (Z_TYPE_P(zv) == IS_ARRAY) { - int i; - zval *entry = NULL; - HashTable *hash; - - SEPARATE_ARRAY(zv); - hash = Z_ARRVAL_P(zv); - zend_hash_internal_pointer_reset(hash); - - switch (bind->array.type) { - case SQLT_NUM: - case SQLT_INT: - case SQLT_LNG: - for (i = 0; i < (int) bind->array.current_length; i++) { - if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - zval_ptr_dtor(entry); - ZVAL_LONG(entry, ((oci_phpsized_int *)(bind->array.elements))[i]); - zend_hash_move_forward(hash); - } else { - add_next_index_long(zv, ((oci_phpsized_int *)(bind->array.elements))[i]); - } - } - break; - case SQLT_FLT: - for (i = 0; i < (int) bind->array.current_length; i++) { - if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - zval_ptr_dtor(entry); - ZVAL_DOUBLE(entry, ((double *)(bind->array.elements))[i]); - zend_hash_move_forward(hash); - } else { - add_next_index_double(zv, ((double *)(bind->array.elements))[i]); - } - } - break; - case SQLT_ODT: - for (i = 0; i < (int) bind->array.current_length; i++) { - oratext buff[1024]; - ub4 buff_len = 1024; - - memset((void*)buff,0,sizeof(buff)); - - if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); - zval_ptr_dtor(entry); - - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - ZVAL_NULL(entry); - } else { - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - ZVAL_STRINGL(entry, (char *)buff, buff_len); - } - zend_hash_move_forward(hash); - } else { - PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - add_next_index_null(zv); - } else { - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - add_next_index_stringl(zv, (char *)buff, buff_len); - } - } - } - break; - - case SQLT_AFC: - case SQLT_CHR: - case SQLT_VCS: - case SQLT_AVC: - case SQLT_STR: - case SQLT_LVC: - for (i = 0; i < (int) bind->array.current_length; i++) { - /* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */ - int curr_element_length = bind->array.element_lengths[i]; - if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - zval_ptr_dtor(entry); - ZVAL_STRINGL(entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length); - zend_hash_move_forward(hash); - } else { - add_next_index_stringl(zv, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length); - } - } - break; - } - } else if ((Z_TYPE_P(zv) == IS_TRUE) || (Z_TYPE_P(zv) == IS_FALSE)) { - /* This convetrsion is done on purpose (ext/oci8 uses LVAL as a temporary value) */ - if (Z_LVAL_P(zv) == 0) - ZVAL_FALSE(zv); - else if (Z_LVAL_P(zv) == 1) - ZVAL_TRUE(zv); - } - - return 0; -} -/* }}} */ - -/* {{{ php_oci_bind_by_name() - Bind zval to the given placeholder */ -int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_len, zval *var, zend_long maxlength, ub2 type) -{ - php_oci_collection *bind_collection = NULL; - php_oci_descriptor *bind_descriptor = NULL; - php_oci_statement *bind_statement = NULL; - dvoid *oci_desc = NULL; - /* dvoid *php_oci_collection = NULL; */ - OCIStmt *oci_stmt = NULL; - dvoid *bind_data = NULL; - php_oci_bind *old_bind, *bindp; - int mode = OCI_DATA_AT_EXEC; - sb4 value_sz = -1; - sword errstatus; - zval *param = NULL; - - ZEND_ASSERT(Z_ISREF_P(var)); - param = Z_REFVAL_P(var); - - switch (type) { - case SQLT_NTY: - { - zval *tmp; - - if (Z_TYPE_P(param) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(param), "collection", sizeof("collection")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find collection property"); - return 1; - } - - PHP_OCI_ZVAL_TO_COLLECTION_EX(tmp, bind_collection); - value_sz = sizeof(void*); - mode = OCI_DEFAULT; - - if (!bind_collection->collection) { - return 1; - } - } - break; - case SQLT_BFILEE: - case SQLT_CFILEE: - case SQLT_CLOB: - case SQLT_BLOB: - case SQLT_RDD: - { - zval *tmp; - - if (Z_TYPE_P(param) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(param), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find descriptor property"); - return 1; - } - - PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, bind_descriptor); - - value_sz = sizeof(void*); - - oci_desc = bind_descriptor->descriptor; - - if (!oci_desc) { - return 1; - } - } - break; - - case SQLT_INT: - case SQLT_NUM: - if (Z_TYPE_P(param) == IS_RESOURCE || Z_TYPE_P(param) == IS_OBJECT) { - php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); - return 1; - } - convert_to_long(param); - bind_data = (oci_phpsized_int *)&Z_LVAL_P(param); - value_sz = sizeof(oci_phpsized_int); - mode = OCI_DEFAULT; - break; - - case SQLT_LBI: - case SQLT_BIN: - case SQLT_LNG: - case SQLT_AFC: - case SQLT_CHR: /* SQLT_CHR is the default value when type was not specified */ - if (Z_TYPE_P(param) == IS_RESOURCE || Z_TYPE_P(param) == IS_OBJECT) { - php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); - return 1; - } - if (Z_TYPE_P(param) != IS_NULL) { - if (!try_convert_to_string(param)) { - return 1; - } - } - if ((maxlength == -1) || (maxlength == 0)) { - if (type == SQLT_LNG) { - value_sz = SB4MAXVAL; - } else if (Z_TYPE_P(param) == IS_STRING) { - value_sz = (sb4) Z_STRLEN_P(param); - } else { - /* Bug-72524: revert value_sz from PHP_OCI_PIECE_SIZE to 0. This restores PHP 5.6 behavior */ - value_sz = 0; - } - } else { - value_sz = (sb4) maxlength; - } - break; - - case SQLT_RSET: - if (Z_TYPE_P(param) != IS_RESOURCE) { - php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); - return 1; - } - PHP_OCI_ZVAL_TO_STATEMENT_EX(param, bind_statement); - value_sz = sizeof(void*); - - oci_stmt = bind_statement->stmt; - - if (!oci_stmt) { - return 1; - } - break; - -#if defined(OCI_MAJOR_VERSION) && OCI_MAJOR_VERSION >= 12 - case SQLT_BOL: - if (Z_TYPE_P(param) == IS_RESOURCE || Z_TYPE_P(param) == IS_OBJECT) { - php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); - return 1; - } - convert_to_boolean(param); - bind_data = (zend_long *)&Z_LVAL_P(param); - if (Z_TYPE_P(param) == IS_TRUE) - *(zend_long *)bind_data = 1; - else if (Z_TYPE_P(param) == IS_FALSE) - *(zend_long *)bind_data = 0; - else { - php_error_docref(NULL, E_WARNING, "Invalid variable used for bind"); - return 1; - } - - value_sz = sizeof(zend_long); - - mode = OCI_DEFAULT; - break; -#endif - - default: - php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: %d", (int)type); - return 1; - break; - } - - if (!statement->binds) { - ALLOC_HASHTABLE(statement->binds); - zend_hash_init(statement->binds, 13, NULL, php_oci_bind_hash_dtor, 0); - } - - if ((old_bind = zend_hash_str_find_ptr(statement->binds, name, name_len)) != NULL) { - bindp = old_bind; - if (!Z_ISUNDEF(bindp->val)) { - zval_ptr_dtor(&bindp->val); - ZVAL_UNDEF(&bindp->val); - } - } else { - zend_string *zvtmp; - zvtmp = zend_string_init(name, name_len, 0); - bindp = (php_oci_bind *) ecalloc(1, sizeof(php_oci_bind)); - bindp = zend_hash_update_ptr(statement->binds, zvtmp, bindp); - zend_string_release_ex(zvtmp, 0); - } - - /* Make sure the minimum of value_sz is 1 to avoid ORA-3149 - * when both in/out parameters are bound with empty strings - */ - if (value_sz == 0) - value_sz = 1; - - bindp->descriptor = oci_desc; - bindp->statement = oci_stmt; - bindp->parent_statement = statement; - ZVAL_COPY(&bindp->val, var); - bindp->type = type; - /* Storing max length set in OCIBindByName() to check it later in - * php_oci_bind_in_callback() function to avoid ORA-1406 error while - * executing OCIStmtExecute() - */ - bindp->dummy_len = value_sz; - - PHP_OCI_CALL_RETURN(errstatus, - OCIBindByName, - ( - statement->stmt, /* statement handle */ - (OCIBind **)&bindp->bind, /* bind hdl (will alloc) */ - statement->err, /* error handle */ - (text*) name, /* placeholder name */ - (sb4) name_len, /* placeholder length */ - (dvoid *)bind_data, /* in/out data */ - value_sz, /* PHP_OCI_MAX_DATA_SIZE, */ /* max size of input/output data */ - type, /* in/out data type */ - (dvoid *)&bindp->indicator, /* indicator (ignored) */ - (ub2 *)0, /* size array (ignored) */ - (ub2 *)&bindp->retcode, /* return code (ignored) */ - (ub4)0, /* maxarr_len (PL/SQL only?) */ - (ub4 *)0, /* actual array size (PL/SQL only?) */ - mode /* mode */ - ) - ); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - if (mode == OCI_DATA_AT_EXEC) { - PHP_OCI_CALL_RETURN(errstatus, OCIBindDynamic, - ( - bindp->bind, - statement->err, - (dvoid *)bindp, - php_oci_bind_in_callback, - (dvoid *)bindp, - php_oci_bind_out_callback - ) - ); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - } - - if (type == SQLT_NTY) { - /* Bind object */ - PHP_OCI_CALL_RETURN(errstatus, OCIBindObject, - ( - bindp->bind, - statement->err, - bind_collection->tdo, - (dvoid **) &(bind_collection->collection), - (ub4 *) 0, - (dvoid **) 0, - (ub4 *) 0 - ) - ); - - if (errstatus) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - } - - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_bind_in_callback() - Callback used when binding LOBs and VARCHARs */ -sb4 php_oci_bind_in_callback( - dvoid *ictxp, /* context pointer */ - OCIBind *bindp, /* bind handle */ - ub4 iter, /* 0-based execute iteration value */ - ub4 index, /* index of current array for PL/SQL or row index for SQL */ - dvoid **bufpp, /* pointer to data */ - ub4 *alenp, /* size after value/piece has been read */ - ub1 *piecep, /* which piece */ - dvoid **indpp) /* indicator value */ -{ - php_oci_bind *phpbind; - zval *val; - - if (!(phpbind=(php_oci_bind *)ictxp) || Z_ISUNDEF(phpbind->val)) { - php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value"); - return OCI_ERROR; - } - - val = &phpbind->val; - ZVAL_DEREF(val); - - if (Z_ISNULL_P(val)) { - /* we're going to insert a NULL column */ - phpbind->indicator = -1; - *bufpp = 0; - *alenp = -1; - *indpp = (dvoid *)&phpbind->indicator; - } else if ((phpbind->descriptor == 0) && (phpbind->statement == 0)) { - /* "normal" string bind */ - if (!try_convert_to_string(val)) { - return OCI_ERROR; - } - - *bufpp = Z_STRVAL_P(val); - *alenp = (ub4) Z_STRLEN_P(val); - /* - * bind_char_1: If max length set in OCIBindByName is less than the - * actual length of input string, then we have to overwrite alenp with - * max value set in OCIBindByName (dummy_len). Or else it will cause - * ORA-1406 error in OCIStmtExecute - */ - if ((phpbind->dummy_len > 0) && (phpbind->dummy_len < *alenp)) - *alenp = phpbind->dummy_len; - *indpp = (dvoid *)&phpbind->indicator; - } else if (phpbind->statement != 0) { - /* RSET */ - *bufpp = phpbind->statement; - *alenp = -1; /* seems to be alright */ - *indpp = (dvoid *)&phpbind->indicator; - } else { - /* descriptor bind */ - *bufpp = phpbind->descriptor; - *alenp = -1; /* seems to be alright */ - *indpp = (dvoid *)&phpbind->indicator; - } - - *piecep = OCI_ONE_PIECE; /* pass all data in one go */ - - return OCI_CONTINUE; -} -/* }}} */ - -/* {{{ php_oci_bind_out_callback() - Callback used when binding LOBs and VARCHARs */ -sb4 php_oci_bind_out_callback( - dvoid *octxp, /* context pointer */ - OCIBind *bindp, /* bind handle */ - ub4 iter, /* 0-based execute iteration value */ - ub4 index, /* index of current array for PL/SQL or row index for SQL */ - dvoid **bufpp, /* pointer to data */ - ub4 **alenpp, /* size after value/piece has been read */ - ub1 *piecep, /* which piece */ - dvoid **indpp, /* indicator value */ - ub2 **rcodepp) /* return code */ -{ - php_oci_bind *phpbind; - zval *val; - sb4 retval = OCI_ERROR; - - if (!(phpbind=(php_oci_bind *)octxp) || Z_ISUNDEF(phpbind->val)) { - php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value"); - return retval; - } - - val = &phpbind->val; - ZVAL_DEREF(val); - - if (Z_TYPE_P(val) == IS_RESOURCE) { - /* Processing for ref-cursor out binds */ - if (phpbind->statement != NULL) { - *bufpp = phpbind->statement; - *alenpp = &phpbind->dummy_len; - *piecep = OCI_ONE_PIECE; - *rcodepp = &phpbind->retcode; - *indpp = &phpbind->indicator; - } - retval = OCI_CONTINUE; - } else if (Z_TYPE_P(val) == IS_OBJECT) { - zval *tmp; - php_oci_descriptor *desc; - - if (!phpbind->descriptor) { - return OCI_ERROR; - } - - /* Do not use the cached lob size if the descriptor is an - * out-bind as the contents would have been changed for in/out - * binds (Bug #46994). - */ - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(val), "descriptor", sizeof("descriptor")-1)) == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to find object outbind descriptor property"); - return OCI_ERROR; - } - PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, desc); - desc->lob_size = -1; /* force OCI8 to update cached size */ - - *alenpp = &phpbind->dummy_len; - *bufpp = phpbind->descriptor; - *piecep = OCI_ONE_PIECE; - *rcodepp = &phpbind->retcode; - *indpp = &phpbind->indicator; - retval = OCI_CONTINUE; - } else { - zval_ptr_dtor(val); - - { - char *p = ecalloc(1, PHP_OCI_PIECE_SIZE); - ZVAL_STRINGL(val, p, PHP_OCI_PIECE_SIZE); - efree(p); - } - - /* XXX we assume that zend-zval len has 4 bytes */ - *alenpp = (ub4*) &Z_STRLEN_P(val); - *bufpp = Z_STRVAL_P(val); - *piecep = OCI_ONE_PIECE; - *rcodepp = &phpbind->retcode; - *indpp = &phpbind->indicator; - retval = OCI_CONTINUE; - } - - return retval; -} -/* }}} */ - -/* {{{ php_oci_statement_get_column_helper() - Helper function to get column by name and index */ -php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data) -{ - zval *z_statement; - zend_string *column_index_string; - zend_long column_index_int; - - php_oci_statement *statement; - php_oci_out_column *column; - - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_RESOURCE(z_statement) - Z_PARAM_STR_OR_LONG(column_index_string, column_index_int) - ZEND_PARSE_PARAMETERS_END_EX(return NULL); - - statement = (php_oci_statement *) zend_fetch_resource_ex(z_statement, "oci8 statement", le_statement); - - if (!statement) { - return NULL; - } - - if (need_data && !statement->has_data) { - return NULL; - } - - if (column_index_string != NULL) { - column = php_oci_statement_get_column(statement, -1, ZSTR_VAL(column_index_string), (int) ZSTR_LEN(column_index_string)); - if (!column) { - php_error_docref(NULL, E_WARNING, "Invalid column name \"%s\"", ZSTR_VAL(column_index_string)); - return NULL; - } - } else { - column = php_oci_statement_get_column(statement, column_index_int, NULL, 0); - - if (!column) { - php_error_docref(NULL, E_WARNING, "Invalid column index \"" ZEND_LONG_FMT "\"", column_index_int); - return NULL; - } - } - return column; -} -/* }}} */ - -/* {{{ php_oci_statement_get_type() - Return type of the statement */ -int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type) -{ - ub2 statement_type; - sword errstatus; - - *type = 0; - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - *type = statement_type; - - return 0; -} -/* }}} */ - -/* {{{ php_oci_statement_get_numrows() - Get the number of rows fetched to the clientside (NOT the number of rows in the result set) */ -int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows) -{ - ub4 statement_numrows; - sword errstatus; - - *numrows = 0; - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0, OCI_ATTR_ROW_COUNT, statement->err)); - - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - *numrows = statement_numrows; - - return 0; -} -/* }}} */ - -/* {{{ php_oci_bind_array_by_name() - Bind arrays to PL/SQL types */ -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type) -{ - php_oci_bind *bind; - sword errstatus; - zend_string *zvtmp; - zval *val; - - ZEND_ASSERT(Z_ISREF_P(var)); - val = Z_REFVAL_P(var); - convert_to_array(val); - SEPARATE_ARRAY(val); - - if (maxlength < -1) { - php_error_docref(NULL, E_WARNING, "Invalid max length value (" ZEND_LONG_FMT ")", maxlength); - return 1; - } - - switch(type) { - case SQLT_NUM: - case SQLT_INT: - case SQLT_LNG: - bind = php_oci_bind_array_helper_number(val, max_table_length); - break; - - case SQLT_FLT: - bind = php_oci_bind_array_helper_double(val, max_table_length); - break; - - case SQLT_AFC: - case SQLT_CHR: - case SQLT_VCS: - case SQLT_AVC: - case SQLT_STR: - case SQLT_LVC: - if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(val)) == 0) { - php_error_docref(NULL, E_WARNING, "You must provide max length value for empty arrays"); - return 1; - } - bind = php_oci_bind_array_helper_string(val, max_table_length, maxlength); - break; - case SQLT_ODT: - bind = php_oci_bind_array_helper_date(val, max_table_length, statement->connection); - break; - default: - php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: " ZEND_LONG_FMT, type); - return 1; - break; - } - - if (bind == NULL) { - /* failed to generate bind struct */ - return 1; - } - - bind->descriptor = NULL; - bind->statement = NULL; - bind->parent_statement = statement; - bind->bind = NULL; - ZVAL_COPY(&bind->val, var); - bind->array.type = type; - bind->indicator = 0; /* not used for array binds */ - bind->type = 0; /* not used for array binds */ - - PHP_OCI_CALL_RETURN(errstatus, - OCIBindByName, - ( - statement->stmt, - (OCIBind **)&bind->bind, - statement->err, - (text *)name, - (sb4) name_len, - (dvoid *) bind->array.elements, - (sb4) bind->array.max_length, - (ub2)type, - (dvoid *)bind->array.indicators, - (ub2 *)bind->array.element_lengths, - (ub2 *)0, /* bindp->array.retcodes, */ - (ub4) max_table_length, - (ub4 *) &(bind->array.current_length), - (ub4) OCI_DEFAULT - ) - ); - - - if (errstatus != OCI_SUCCESS) { - if (bind->array.elements) { - efree(bind->array.elements); - } - - if (bind->array.element_lengths) { - efree(bind->array.element_lengths); - } - - if (bind->array.indicators) { - efree(bind->array.indicators); - } - - zval_ptr_dtor(&bind->val); - - efree(bind); - - statement->errcode = php_oci_error(statement->err, errstatus); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } - - if (!statement->binds) { - ALLOC_HASHTABLE(statement->binds); - zend_hash_init(statement->binds, 13, NULL, php_oci_bind_hash_dtor, 0); - } - - zvtmp = zend_string_init(name, name_len, 0); - zend_hash_update_ptr(statement->binds, zvtmp, bind); - zend_string_release_ex(zvtmp, 0); - - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ - -/* {{{ php_oci_bind_array_helper_string() - Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength) -{ - php_oci_bind *bind; - ub4 i; - HashTable *hash; - zval *entry; - - SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */ - hash = Z_ARRVAL_P(var); - - if (maxlength == -1) { - zend_hash_internal_pointer_reset(hash); - while ((entry = zend_hash_get_current_data(hash)) != NULL) { - if (!try_convert_to_string(entry)) { - return NULL; - } - - if (maxlength == -1 || Z_STRLEN_P(entry) > (size_t) maxlength) { - maxlength = Z_STRLEN_P(entry) + 1; - } - - zend_hash_move_forward(hash); - } - } - - bind = emalloc(sizeof(php_oci_bind)); - ZVAL_UNDEF(&bind->val); - bind->array.elements = (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0); - memset(bind->array.elements, 0, max_table_length * (maxlength + 1) * sizeof(text)); - bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var)); - bind->array.old_length = bind->array.current_length; - bind->array.max_length = (ub4) maxlength; - bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0); - memset(bind->array.element_lengths, 0, max_table_length*sizeof(ub2)); - bind->array.indicators = safe_emalloc(max_table_length, sizeof(sb2), 0); - memset(bind->array.indicators, 0, max_table_length*sizeof(sb2)); - - zend_hash_internal_pointer_reset(hash); - - for (i = 0; i < bind->array.current_length; i++) { - if ((entry = zend_hash_get_current_data(hash)) != NULL) { - if (!try_convert_to_string(entry)) { - efree(bind->array.elements); - efree(bind->array.element_lengths); - efree(bind->array.indicators); - efree(bind); - return NULL; - } - - bind->array.element_lengths[i] = (ub2) Z_STRLEN_P(entry); - if (Z_STRLEN_P(entry) == 0) { - bind->array.indicators[i] = -1; - } - zend_hash_move_forward(hash); - } else { - break; - } - } - - zend_hash_internal_pointer_reset(hash); - for (i = 0; i < max_table_length; i++) { - if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - int element_length; - if (!try_convert_to_string(entry)) { - efree(bind->array.elements); - efree(bind->array.element_lengths); - efree(bind->array.indicators); - efree(bind); - return NULL; - } - - element_length = ((size_t) maxlength > Z_STRLEN_P(entry)) ? (int) Z_STRLEN_P(entry) : (int) maxlength; - - memcpy((text *)bind->array.elements + i*maxlength, Z_STRVAL_P(entry), element_length); - ((text *)bind->array.elements)[i*maxlength + element_length] = '\0'; - - zend_hash_move_forward(hash); - } else { - ((text *)bind->array.elements)[i*maxlength] = '\0'; - } - } - zend_hash_internal_pointer_reset(hash); - - return bind; -} -/* }}} */ - -/* {{{ php_oci_bind_array_helper_number() - Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length) -{ - php_oci_bind *bind; - ub4 i; - HashTable *hash; - zval *entry; - - SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */ - hash = Z_ARRVAL_P(var); - - bind = emalloc(sizeof(php_oci_bind)); - ZVAL_UNDEF(&bind->val); - bind->array.elements = (oci_phpsized_int *)safe_emalloc(max_table_length, sizeof(oci_phpsized_int), 0); - bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var)); - bind->array.old_length = bind->array.current_length; - bind->array.max_length = sizeof(oci_phpsized_int); - bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0); - memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2)); - bind->array.indicators = NULL; - - zend_hash_internal_pointer_reset(hash); - for (i = 0; i < max_table_length; i++) { - if (i < bind->array.current_length) { - bind->array.element_lengths[i] = sizeof(oci_phpsized_int); - } - if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - convert_to_long(entry); - ((oci_phpsized_int *)bind->array.elements)[i] = (oci_phpsized_int) Z_LVAL_P(entry); - zend_hash_move_forward(hash); - } else { - ((oci_phpsized_int *)bind->array.elements)[i] = 0; - } - } - zend_hash_internal_pointer_reset(hash); - - return bind; -} -/* }}} */ - -/* {{{ php_oci_bind_array_helper_double() - Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length) -{ - php_oci_bind *bind; - ub4 i; - HashTable *hash; - zval *entry; - - SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */ - hash = Z_ARRVAL_P(var); - - bind = emalloc(sizeof(php_oci_bind)); - ZVAL_UNDEF(&bind->val); - bind->array.elements = (double *)safe_emalloc(max_table_length, sizeof(double), 0); - bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var)); - bind->array.old_length = bind->array.current_length; - bind->array.max_length = sizeof(double); - bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0); - memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2)); - bind->array.indicators = NULL; - - zend_hash_internal_pointer_reset(hash); - for (i = 0; i < max_table_length; i++) { - if (i < bind->array.current_length) { - bind->array.element_lengths[i] = sizeof(double); - } - if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - convert_to_double(entry); - ((double *)bind->array.elements)[i] = (double) Z_DVAL_P(entry); - zend_hash_move_forward(hash); - } else { - ((double *)bind->array.elements)[i] = 0; - } - } - zend_hash_internal_pointer_reset(hash); - - return bind; -} -/* }}} */ - -/* {{{ php_oci_bind_array_helper_date() - Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection) -{ - php_oci_bind *bind; - ub4 i; - HashTable *hash; - zval *entry; - sword errstatus; - - SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */ - hash = Z_ARRVAL_P(var); - - bind = emalloc(sizeof(php_oci_bind)); - ZVAL_UNDEF(&bind->val); - bind->array.elements = (OCIDate *)safe_emalloc(max_table_length, sizeof(OCIDate), 0); - bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var)); - bind->array.old_length = bind->array.current_length; - bind->array.max_length = sizeof(OCIDate); - bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0); - memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2)); - bind->array.indicators = NULL; - - zend_hash_internal_pointer_reset(hash); - for (i = 0; i < max_table_length; i++) { - OCIDate oci_date; - if (i < bind->array.current_length) { - bind->array.element_lengths[i] = sizeof(OCIDate); - } - if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { - zend_string *entry_str = zval_try_get_string(entry); - if (UNEXPECTED(!entry_str)) { - efree(bind->array.element_lengths); - efree(bind->array.elements); - efree(bind); - return NULL; - } - - PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)ZSTR_VAL(entry_str), (ub4) ZSTR_LEN(entry_str), NULL, 0, NULL, 0, &oci_date)); - zend_string_release(entry_str); - - if (errstatus != OCI_SUCCESS) { - /* failed to convert string to date */ - efree(bind->array.element_lengths); - efree(bind->array.elements); - efree(bind); - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return NULL; - } - - ((OCIDate *)bind->array.elements)[i] = oci_date; - zend_hash_move_forward(hash); - } else { - PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)"01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0, &oci_date)); - - if (errstatus != OCI_SUCCESS) { - /* failed to convert string to date */ - efree(bind->array.element_lengths); - efree(bind->array.elements); - efree(bind); - connection->errcode = php_oci_error(connection->err, errstatus); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return NULL; - } - - ((OCIDate *)bind->array.elements)[i] = oci_date; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - } - zend_hash_internal_pointer_reset(hash); - - return bind; -} -/* }}} */ - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml deleted file mode 100644 index 63a020750623..000000000000 --- a/ext/oci8/package.xml +++ /dev/null @@ -1,1464 +0,0 @@ - - - oci8 - pecl.php.net - Extension for Oracle Database - - -The OCI8 extension lets you access Oracle Database. - -Use 'pecl install oci8' to install for PHP 8.2. - -Use 'pecl install oci8-3.2.1' to install for PHP 8.1. - -Use 'pecl install oci8-3.0.1' to install for PHP 8.0. - -Use 'pecl install oci8-2.2.0' to install for PHP 7. - -The current OCI8 extension can be linked with Oracle Client libraries from Oracle Database 11.2 or later. (OCI8 3.0 and earlier can be linked with 10g or later). The Oracle Client libraries are in the free Oracle Instant Client from https://www.oracle.com/database/technologies/instant-client.html. They are also included in your database installation. - -Oracle's standard cross-version connectivity applies. For example, PHP OCI8 linked with Oracle Client 19c can connect to Oracle Database 11.2 onward. See Oracle's note "Oracle Client / Server Interoperability Support" (ID 207303.1) for details. - - - Christopher Jones - sixd - sixd@php.net - yes - - - Tianfang Yang - tianfyan - tianfyan@php.net - no - - - Antony Dovgal - tony2001 - tony2001@php.net - no - - - Wez Furlong - wez - wez@php.net - no - - - Andi Gutmans - andi - andi@zend.com - no - - - 2023-04-22 - - - - 3.3.0 - 3.3.0 - - - stable - stable - - PHP - - This version is for PHP 8.2 only. - - Requires Oracle Client libraries from 11.2 or later. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8.1.0 - - - 1.4.0b1 - - - - oci8 - - - - - - - - 3.2.1 - 3.2.1 - - - stable - stable - - PHP - - This version is for PHP 8.1 only. - - Requires Oracle Client libraries from 11.2 or later. - - - - - - 3.2.0 - 3.2.0 - - - stable - stable - - PHP - - This version is for PHP 8.1 only. - - Added oci8.prefetch_lob_size directive and oci_set_prefetch_lob() function to improve LOB query performance. - - - - - - 3.1.0 - 3.1.0 - - - stable - stable - - PHP - - This version is for PHP 8.0 only. - - Deprecated directive oci8.old_oci_close_semantics - - - - - - 3.0.1 - 3.0.1 - - - stable - stable - - PHP - - This version is for PHP 8.0 only. - - Updated Windows build environment to build with newer Oracle Client libraries. (cmb) - - - - - - 3.0.0 - 3.0.0 - - - stable - stable - - PHP - - This version is for PHP 8.0 only. - - Deprecated old OCI8 function aliases. (Jens de Nies) - - Removed obsolete no-op function oci_internal_debug(). (Jens de Nies) - - The OCI-Lob class is now called OCILob for standards compliance. - - The OCI-Collection class is now called OCICollection for standards compliance. - - Generate arginfo from function stubs. (Jens de Nies) - - - - - - 2.2.0 - 2.2.0 - - - stable - stable - - PHP - -This version is for PHP 7 only. -Added oci_set_call_timeout() for call timeouts. (Requires Oracle client libraries 18c or later) -Added oci_set_db_operation() for the Oracle Database 'DBOP' end-to-end-tracing attribute. (Requires Oracle 12.2 or later) -Fixed bug #76804 (oci_pconnect with OCI_CRED_EXT not working). (KoenigsKind) -Fixed installation on PHP 7.3. -Internal change: Convert some parameter parsing to the Fast Parameter Parsing API. - - - - - - 2.1.8 - 2.1.8 - - - stable - stable - - PHP - -This version is for PHP 7 only. -Fixed reference counting and memory issues. (Dmitry, Tianfang) - - - - - - 2.1.7 - 2.1.7 - - - stable - stable - - PHP - -This version is for PHP 7 only. -Added oci_unregister_taf_callback() - - - - - - 2.1.6 - 2.1.6 - - - stable - stable - - PHP - -This version is for PHP 7 only. -Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge) - - - - - - 2.1.5 - 2.1.5 - - - stable - stable - - PHP - -This version is for PHP 7 only. -Added TAF callback support (PR #2459, KoenigsKind) - - - - - - 2.1.4 - 2.1.4 - - - stable - stable - - PHP - -This version is for PHP 7 only. -Fixed uninitialized data causing random crash - - - - - - 2.1.3 - 2.1.3 - - - stable - stable - - PHP - -This version is for PHP 7 only. -Fixed bug #71148 (Bind reference overwritten on PHP 7) - - - - - - 2.1.2 - 2.1.2 - - - stable - stable - - PHP - -This version is for PHP 7 only. -Fixed invalid handle error with Implicit Result Sets -Fixed bug #72524 (Binding null values triggers ORA-24816 error) - - - - - - 2.1.1 - 2.1.1 - - - stable - stable - - PHP - -This version is for PHP 7 only. -Fixed bug #71600 (oci_fetch_all segfaults when selecting more than 8 columns) - - - - - - 2.1.0 - 2.1.0 - - - stable - stable - - PHP - -This version is for PHP 7 only. -Updated driver name format. - - - - - - 2.0.10 - 2.0.10 - - - stable - stable - - PHP - -Fixed bug #68298 (OCI int overflow) - - - - - - 2.0.9 - 2.0.9 - - - stable - stable - - PHP - -Fixed oci_field_* reflection: $field can be a column name or index - - - - - - 2.0.8 - 2.0.8 - - - stable - stable - - PHP - -Enhancement - Improve performance of multi-row OCI_RETURN_LOB queries (Bug #66875) - - - - - - 2.0.7 - 2.0.7 - - - stable - stable - - PHP - -Added oci_bind_by_name() support for PL/SQL BOOLEAN type -Build change: Fix source variable definition for C89 compatibility - - - - - - 2.0.6 - 2.0.6 - - - stable - stable - - PHP - -Added a LICENSE file to make it easier for PECL binary distributions -to conform with the license. - - - - - - 2.0.5 - 2.0.5 - - - stable - stable - - PHP - -Bump PHP OCI8 2.0 minimum requirements to PHP 5.2 and Oracle client -library 10.2. (Use OCI8 1.4 for older PHP version support or if only -Oracle 9.2 client libraries are available.) - -Re-enable php_oci8.dll and php_oci8_11g.dll for Windows builds so URL -links work in the new Windows PECL infrastructure. - - - - - - 2.0.4 - 2.0.4 - - - devel - devel - - PHP - -Fix persistent memory usage with --enable-dtrace -Export get_module() for Windows php_oci8_12c.dll - - - - - - 2.0.3 - 2.0.3 - - - devel - devel - - PHP - -Add the oci_set_client_identifier() value and statement structure pointer to several DTrace probes. -Use 'phpoci' as the DTrace provider name since uniqueness is required by the Linux fasttrap module. -Update Windows builds to create only php_oci8_12c.dll. - - - - - - 2.0.2 - 2.0.2 - - - devel - devel - - PHP - -Review and improve error handling code and data types. -Fix oci_set_*($connection, ...) error handling so oci_error($connection) works. -Add DTrace oci8-connection-close probe -Add the connection handle to several DTrace probes. - - - - - - 2.0.1 - 2.0.1 - - - devel - devel - - PHP - -Fixed --enable-maintainer-zts mode. -Allow Implicit Result Set statement resources to inherit the parent's current prefetch count. -Allow OCI8 to be DTrace-enabled independently from core PHP. -Require OCI8 to be configured 'shared' when enabling DTrace support. - - - - - - 2.0.0 - 2.0.0 - - - devel - devel - - PHP - -- NEW FUNCTIONALITY: - - - Added Implicit Result Set support for Oracle Database 12c. - Streaming of all IRS's returned from a PL/SQL block is available - via oci_fetch_array, oci_fetch_assoc, oci_fetch_object and - oci_fetch_row (but not oci_fetch or oci_fetch_all). - Alternatively individual IRS statement resources can be obtained - with the new function 'oci_get_implicit_resultset' and passed to - any oci_fetch_* function. - - - Added DTrace probes enabled with PHP's generic --enable-dtrace - -- IMPROVED FUNCTIONALITY: - - - Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no - longer unnecessarily initiates an internal ROLLBACK during - connection close. This can improve overall scalability by - reducing "round trips" between PHP and the database. - -- CHANGED FUNCTIONALITY: - - - PHPINFO() CHANGES: - - - The oci8.event and oci8.connection_class values are now shown - only when the Oracle client libraries support the respective - functionality. - - - Connection statistics are now in a separate phpinfo() table. - - - Temporary LOB and Collection support status lines in - phpinfo() were removed. These features have always been - enabled since 2007. - - - OCI_INTERNAL_DEBUG() CHANGES: - - - The oci_internal_debug() function is now a no-op. Use PHP's - --enable-dtrace functionality with DTrace or SystemTap instead. - -- INTERNAL CHANGES: - - - Fixed a potential NULL pointer dereference flagged by Parfait - static code analysis. - - - Extended testing of existing OCI8 functionality. - - - Improved test output portability when using the PHP development - web server to run tests. - - - Removed no-longer necessary Unicode patterns from tests - (vestiges of PHP's previous PHP 6 project) - - - Improved build portability by removing compilation type cast - warnings with some compilers. - - - Fixed compilation warnings when building with Oracle 9.2 - client libraries. - - - Updated code to use internal macro PHP_OCI_REGISTER_RESOURCE. - - - Regularized code prototypes and fixed some in-line documentation - prototypes. - - - Fixed code folding. - - - - - - 1.4.10 - 1.4.10 - - - stable - stable - - PHP - - Bump PECL package info version check to allow PECL installs with PHP 5.5+ - - - - - - 1.4.9 - 1.4.9 - - - stable - stable - - PHP - - Re-fixed bug #60901 (Improve "tail" syntax for AIX installation) - - - - - - 1.4.8 - 1.4.8 - - - stable - stable - - PHP - - Fixed bug #63307 (Unused variable in oci8.c) - Fixed bug #63265 (Add ORA-00028 to the PHP_OCI_HANDLE_ERROR macro) - Fixed bug #60901 (Improve "tail" syntax for AIX installation) - - - - - - 1.4.7 - 1.4.7 - - - stable - stable - - PHP - - Fixed bug #59985 (show normal warning text for OCI_NO_DATA) - Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL pointer dereferences with zend_strndup) - Fixed OCI8 part of bug #55301 (multiple null pointer dereferences with calloc) - Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 size - Improve internal initialization failure error messages - - - - - - 1.4.6 - 1.4.6 - - - stable - stable - - PHP - - Added oci_client_version() returning the run time Oracle client library version - Made OCI8 extension buildable with PHP 5.4-development code - - - - - - 1.4.5 - 1.4.5 - - - stable - stable - - PHP - - Protect against null bytes in LOB filenames (http://news.php.net/php.internals/50202) - - - - - - 1.4.4 - 1.4.4 - - - stable - stable - - PHP - - Fixed bug #53284 (Valgrind warnings in oci_set_* functions) - Enhancement - improve startup failure error messages - - - - - - 1.4.3 - 1.4.3 - - - stable - stable - - PHP - - Fixed bug #51610 (Using oci_connect causes PHP to take a long time to exit). Requires Oracle 11.2.0.2 client libraries (or Oracle bug fix 9891199) for this patch to have an effect. - - - - - - 1.4.2 - 1.4.2 - - - stable - stable - - PHP - - Fixed bug #52186 (phpinfo() shows 10.1 or 11.1 when installed with ORACLE_HOME 10.2 or 11.2) - Fixed bug #51691 (Unnecessary realloc causes crashes in PHP trunk tests with interned strings) - Fixed bug #51577 (Uninitialized memory reference with oci_bind_array_by_name) - Fixed bug #51291 (oci_error doesn't report last error when called two times) - - OCI8 1.4.2 is included in PHP 5.3.3 - - - - - - 1.4.1 - 1.4.1 - - - stable - stable - - PHP - - Fixed bug #49560 (Using LOBs causes slow PHP shutdown) - Fixed bug #47281 ($php_errormsg is limited in size of characters) - - - - - - 1.4.0 - 1.4.0 - - - alpha - alpha - - PHP - - 1. Introduce connection attribute functions: - - oci_set_module_name - oci_set_action - oci_set_client_info - oci_set_client_identifier - - These set values that are visible/used by the database. They - are useful for tracing, authentication and auditing. - - 2. Introduce connection attribute function: - - oci_set_edition - - Oracle 11g R2 "editions" allow multiple versions of DB objects - to exist at one time. By setting different editions, two - different versions of an application can run concurrently, - making upgrading easier and faster. - - 3. Set the DRIVER_NAME attribute of Oracle Database 11gR2 - connections to aid application tracing. The value used is to - "PHP OCI8" followed by the OCI8 version number. Note the - version number may get truncated in DB views such as - v$session_connect_info. - - 4. Allow the oci_set_prefetch value to be 0. This is important in - some cases using REF CURSORS in Oracle 11gR2. - - 5. Introduce OCI_NO_AUTO_COMMIT as an alias for the OCI_DEFAULT - constant (which is not the default value) used by oci_execute(). - - 6. Generate an error if an invalid resource type is used in - oci_bind_by_name - - 7. Bug fixes: - PECL bug #16842 (oci_error returns false when NO_DATA_FOUND is raised) - - - - - - 1.3.5 - 1.3.4 - - - stable - stable - - PHP - -Fixed bug #47243 (Crash at end of request shutdown on Windows) -Fixed bug #46994 (CLOB size does not update when using CLOB IN OUT param in stored procedure) -Fixed bug #46623 (phpinfo doesn't show compile time ORACLE_HOME with phpize) -Fixed bug #45458 (Numeric keys for associative arrays are not handled properly) Note: not fixed when building with PHP 4 due to lack of PHP internal helper. -Fixed PECL bug #16035 (oci_connect without ORACLE_HOME defined causes segfault) -Fixed PECL bug #15988 (sqlnet.ora isn't read with older Oracle libraries) -Fixed PECL bug #14268 (Allow "pecl install oci8" command to "autodetect" an Instant Client RPM install) - - - - - - 1.3.4 - 1.3.4 - - - stable - stable - - PHP - -Enhancement - Allow External Authentication (not supported on Windows) -Enhancement - Reflection will show function and method arguments with PHP 5.x -Increase default oci8.default_prefetch from 10 to 100 -Correctly define SQLT_BDOUBLE and SQLT_BFLOAT constants with Oracle 10g ORACLE_HOME builds - - - - - - 1.3.3 - 1.3.3 - - - stable - stable - - PHP - -Changed OCI NLS initialization for consistency and technical correctness -Removed obsolete macros - - - - - - 1.3.2 - 1.3.2 - - - beta - beta - - PHP - -Refine DRCP connection pooling functionality -Do scope-end release for oci_pconnect (oci8.old_oci_close_semantics=1 gives old behavior) -Fixed bug #44372 (compilation with Oracle 10gR1 libraries) -Fixed PECL bug #12431 (PEAR install using x86_64 RPM builds) -Allow builds with PHP 4.3.9 onwards - - - - - - 1.3.1 - 1.3.1 - - - beta - beta - - PHP - Fixed bug #44113 (New collection creation can fail with OCI-22303) -Fixed bug #42841 (Crash with REF CURSORS when statement caching enabled) -Fixed bug #42496 (Cursor leak selecting LOBs -Fixed bug #43497 (Temporary LOB leak) -Fixed PECL bug #12431 (ping functionality is broken) -Allow compilation with 64bit Instant Client RPMs -Allow -with-oci8=instantclient with no directory specified look for RPM install -Refine DRCP functionality - - - - - - 1.3.0 - 1.3.0 - - - beta - beta - - PHP - Added DRCP and FAN support. - - - - - - 1.2.5 - 1.2.5 - - - stable - stable - - PHP - -This release is based on the OCI8 included in PHP 5.2.6, with the addition of the fix for http://pecl.php.net/bugs/bug.php?id=13523. --------- -Fixed bug #42496 (cursor leak selecting LOBs http://bugs.php.net/bug.php?id=42496 -Fixed bug #42841 (crash with REF CURSORS when statement caching enabled) http://bugs.php.net/bug.php?id=42841 -Fixed bug #43497 (Temporary LOB leak) http://bugs.php.net/bug.php?id=43497 -Fixed bug #44206 (OCI8 selecting ref cursors leads to ORA-1000 maximum open cursors reached). -Fixed bug #44008 (OCI8 incorrect usage of OCI-Lob->close crashes PHP). -Fixed bug #44113 (new collection creation can fail with OCI-22303) http://bugs.php.net/bug.php?id=44113 -Enhancement - make -with-oci8=instantclient with no directory specified look for RPM install -Enhancement - compile with 64bit Instant Client RPMs (bug http://bugs.php.net/bug.php?id=41941, http://pecl.php.net/bugs/bug.php?id=13523) - - - - - - 1.2.4 - 1.2.4 - - - stable - stable - - PHP - Fixed PECL bug #10194 (crash in Oracle client when memory limit reached in the callback) -Fixed bug #42173 (oci_field_type fixes for INTERVAL and TIMESTAMP types) -Fixed bug #42134 (oci_error() returns false after oci_new_collection() fails) -Fixed bug #41917 (oci_field_precision and oci_field_scale datatypes fixed) -Fixed bug #41711 (Null temporary lobs not supported) -Fixed bug #41594 (Statement cache is flushed too frequently) -Fixed bug #40415 (oci_fetch_all and nested cursors, allocate descriptors dynamically) -Fixed segfault on rebinding and re-executing a statement with LOBs. -Fixed compile failure in ZTS mode when collections support is missing. -Allowed statement cache size to be set for non-persistent connections. -Improved oci_password_change() to close persistent connections on shutdown (to update hashed connection details) -Changed oci_pconnect() to behave like oci_connect() when SYSDBA and SYSOPER privileges are used. -Various minor improvements. - - - - - - 1.2.3 - 1.2.3 - - - stable - stable - - 2007-01-25 - PHP - Fixed possible segfault in ZTS mode when statements containing sub-statements are destroyed in wrong order. -Fixed bug #40078 (ORA-01405 when fetching NULL values using oci_bind_array_by_name()). -Fixed bug #39988 (type argument of oci_define_by_name() is ignored). -Fixed bug #39732 (oci_bind_array_by_name doesn't work on Solaris 64bit). -Fixed PECL bug #8816 (issue in php_oci_statement_fetch with more than one piecewise column). -Various minor improvements. - - - - - - 1.2.2 - 1.2.2 - - - stable - stable - - 2006-08-24 - PHP - Reimplemented oci_lob_read() utilities using patch from Massimo Squillace (msquillace at sogei dot it), which should fix Unicode LOB problems. -Fixed bug #38161 (oci_bind_by_name() returns garbage when Oracle didn't set the variable) -Fixed bug #38173 (Freeing nested cursors causes OCI8 to segfault) -Fixed bug #37886 (oci_connect may crash when charset parameter is given) -Fixed bug #37931 (possible crash after database restart when using persistent connections) -Fixed bug #37531 (oci8 persistent connection corruption) -Fixed bug #37487 (oci_fetch_array() array-type should always default to OCI_BOTH) -Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of request) -Fixed bug #35973 (Error ORA-24806 occurs when trying to fetch a NCLOB field) -Fixed bug #34005 (oci_password_change() fails). Patch by pholdaway at technocom-wireless dot com. -Fixed PECL bug #8112 (Persistent connections misbehave when Apache process times out) - - - - - - 1.2.1 - 1.2.1 - - - stable - stable - - 2006-05-02 - PHP - Added support for BINARY_DOUBLE and BINARY_FLOAT (see #36764) -Changed oci_field_type() to return VARCHAR2 instead of VARCHAR (according to feature request #36800) -Fixed bug #37059 (oci_bind_by_name() doesn't support RAW and LONG RAW fields) -Fixed bug #37055 (incorrect reference counting for persistent OCI8 connections) -Fixed bug #36934 (OCILob->read() doesn't move internal pointer when reading 0's) -Fixed bug #36851 (Documentation and code discrepancies for NULL data) -Fixed bug #36820 (Privileged connection with an Oracle password file fails) - - - - - - 1.2.0 - 1.2.0 - - - stable - stable - - 2006-03-16 - PHP - Changed OCI8 code to use OCIServerVersion() instead of OCIPing(), which may crash Oracle server of version < 10.2 -Fixed bug #36235 (ocicolumnname returns false before a successful fetch) -Fixed bug #36096 (oci_result() returns garbage after oci_fetch() failed) -Fixed bug #36055 (possible OCI8 crash in multithreaded environment) -Fixed bug #36010 (Segfault when re-creating and re-executing statements with bound parameters) -Fixed PECL bug #5571 (oci_new_connect() not closed by oci_close()) -Fixed bug #33383 (crash when retrieving empty BLOBs) - - - - - - 1.1.1 - 1.1.1 - - - beta - beta - - 2005-09-22 - PHP - Fixed segfault when binding empty values. -Fixed problem with oci_error() without arguments. - - - - - - 1.1 - 1.1 - - - beta - beta - - 2005-09-07 - PHP - This release fixes a huge amount of bugs and adds support of -statement caching, external credentials etc. -See official announce for details. - - - - - - 1.0 - 1.0 - - - beta - beta - - 2004-03-19 - PHP - package.xml added to support installation using pear installer - - - - - diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h deleted file mode 100644 index c87c2084d7fd..000000000000 --- a/ext/oci8/php_oci8.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | - | Thies C. Arntzen | - | | - | Collection support by Andy Sautins | - | Temporary LOB support by David Benson | - | ZTS per process OCIPLogon by Harald Radi | - | | - | Redesigned by: Antony Dovgal | - | Andi Gutmans | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_OCI8 -# ifndef PHP_OCI8_H -# define PHP_OCI8_H - -#ifdef ZTS -# include "TSRM.h" -#endif - -/* - * The version of the OCI8 extension. - */ -#ifdef PHP_OCI8_VERSION -/* The definition of PHP_OCI8_VERSION changed in PHP 5.3 and building - * this code with PHP 5.2 (e.g. when using OCI8 from PECL) will conflict. - */ -#undef PHP_OCI8_VERSION -#endif -#define PHP_OCI8_VERSION "3.3.0" - -extern zend_module_entry oci8_module_entry; -#define phpext_oci8_ptr &oci8_module_entry -#define phpext_oci8_11g_ptr &oci8_module_entry -#define phpext_oci8_12c_ptr &oci8_module_entry -#define phpext_oci8_19_ptr &oci8_module_entry - - -PHP_MINIT_FUNCTION(oci); -PHP_RINIT_FUNCTION(oci); -PHP_MSHUTDOWN_FUNCTION(oci); -PHP_RSHUTDOWN_FUNCTION(oci); -PHP_MINFO_FUNCTION(oci); - -# endif /* !PHP_OCI8_H */ -#else /* !HAVE_OCI8 */ - -# define oci8_module_ptr NULL - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h deleted file mode 100644 index fa514ff6fede..000000000000 --- a/ext/oci8/php_oci8_int.h +++ /dev/null @@ -1,570 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken | - | Thies C. Arntzen | - | | - | Collection support by Andy Sautins | - | Temporary LOB support by David Benson | - | ZTS per process OCIPLogon by Harald Radi | - | | - | Redesigned by: Antony Dovgal | - | Andi Gutmans | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_OCI8 -# ifndef PHP_OCI8_INT_H -# define PHP_OCI8_INT_H - -/* {{{ misc defines */ -# if (defined(__osf__) && defined(__alpha)) -# ifndef A_OSF -# define A_OSF -# endif -# ifndef OSF1 -# define OSF1 -# endif -# ifndef _INTRINSICS -# define _INTRINSICS -# endif -# endif /* osf alpha */ - -#ifdef HAVE_OCI8_DTRACE -#include "oci8_dtrace_gen.h" -#endif - -#if defined(min) -#undef min -#endif -#if defined(max) -#undef max -#endif -/* }}} */ - -#include "ext/standard/php_string.h" -ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes") -#include -ZEND_DIAGNOSTIC_IGNORED_END - -#if !defined(OCI_MAJOR_VERSION) || OCI_MAJOR_VERSION < 11 || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION < 2)) -#error This version of PHP OCI8 requires Oracle Client libraries from 11.2 or later. -#endif - -extern int le_connection; -extern int le_pconnection; -extern int le_statement; -extern int le_descriptor; -extern int le_collection; -extern int le_server; -extern int le_session; - -extern zend_class_entry *oci_lob_class_entry_ptr; -extern zend_class_entry *oci_coll_class_entry_ptr; - -/* {{{ constants */ -#define PHP_OCI_SEEK_SET 0 -#define PHP_OCI_SEEK_CUR 1 -#define PHP_OCI_SEEK_END 2 - -#define PHP_OCI_MAX_NAME_LEN 64 -#define PHP_OCI_MAX_DATA_SIZE INT_MAX -#define PHP_OCI_PIECE_SIZE ((64*1024)-1) -#define PHP_OCI_LOB_BUFFER_SIZE 1048576l /* 1Mb seems to be the most reasonable buffer size for LOB reading */ - -#define PHP_OCI_ASSOC (1<<0) -#define PHP_OCI_NUM (1<<1) -#define PHP_OCI_BOTH (PHP_OCI_ASSOC|PHP_OCI_NUM) - -#define PHP_OCI_RETURN_NULLS (1<<2) -#define PHP_OCI_RETURN_LOBS (1<<3) - -#define PHP_OCI_FETCHSTATEMENT_BY_COLUMN (1<<4) -#define PHP_OCI_FETCHSTATEMENT_BY_ROW (1<<5) -#define PHP_OCI_FETCHSTATEMENT_BY (PHP_OCI_FETCHSTATEMENT_BY_COLUMN | PHP_OCI_FETCHSTATEMENT_BY_ROW) - -#define PHP_OCI_LOB_BUFFER_DISABLED 0 -#define PHP_OCI_LOB_BUFFER_ENABLED 1 -#define PHP_OCI_LOB_BUFFER_USED 2 - -#ifdef OCI_ERROR_MAXMSG_SIZE2 -/* Bigger size is defined from 11.2.0.3 onwards */ -#define PHP_OCI_ERRBUF_LEN OCI_ERROR_MAXMSG_SIZE2 -#else -#define PHP_OCI_ERRBUF_LEN OCI_ERROR_MAXMSG_SIZE -#endif - -/* The mode parameter for oci_connect() is overloaded and accepts both - * privilege and external authentication flags OR'd together. - * PHP_OCI_CRED_EXT must be distinct from the OCI_xxx privilege - * values. - */ -#define PHP_OCI_CRED_EXT (1u<<31) -#if ((PHP_OCI_CRED_EXT == OCI_DEFAULT) || (PHP_OCI_CRED_EXT & (OCI_SYSOPER | OCI_SYSDBA))) -#error Invalid value for PHP_OCI_CRED_EXT -#endif - -#define PHP_OCI_IMPRES_UNKNOWN 0 -#define PHP_OCI_IMPRES_NO_CHILDREN 1 -#define PHP_OCI_IMPRES_HAS_CHILDREN 2 -#define PHP_OCI_IMPRES_IS_CHILD 3 - -/* - * Name passed to Oracle for tracing. Note some DB views only show - * the first nine characters of the driver name. - */ -#define PHP_OCI8_DRIVER_NAME "PHP OCI8 : " PHP_OCI8_VERSION - -/* }}} */ - -/* {{{ php_oci_spool */ -typedef struct { - zend_resource *id; /* resource id */ - OCIEnv *env; /* env of this session pool */ - OCIError *err; /* pool's error handle */ - OCISPool *poolh; /* pool handle */ - void *poolname; /* session pool name */ - unsigned int poolname_len; /* length of session pool name */ - zend_string *spool_hash_key; /* Hash key for session pool in plist */ -} php_oci_spool; -/* }}} */ - -/* {{{ php_oci_connection */ -typedef struct { - zend_resource *id; /* resource ID */ - OCIEnv *env; /* private env handle */ - ub2 charset; /* charset ID */ - OCIServer *server; /* private server handle */ - OCISvcCtx *svc; /* private service context handle */ - OCISession *session; /* private session handle */ - OCIAuthInfo *authinfo; /* Cached authinfo handle for OCISessionGet */ - OCIError *err; /* private error handle */ - php_oci_spool *private_spool; /* private session pool (for persistent) */ - sb4 errcode; /* last ORA- error number */ - - HashTable *descriptors; /* descriptors hash, used to flush all the LOBs using this connection on commit */ - zend_ulong descriptor_count; /* used to index the descriptors hash table. Not an accurate count */ - unsigned is_open:1; /* hels to determine if the connection is dead or not */ - unsigned is_attached:1; /* hels to determine if we should detach from the server when closing/freeing the connection */ - unsigned is_persistent:1; /* self-descriptive */ - unsigned used_this_request:1; /* helps to determine if we should reset connection's next ping time and check its timeout */ - unsigned rb_on_disconnect:1; /* helps to determine if we should rollback this connection on close/shutdown */ - unsigned passwd_changed:1; /* helps determine if a persistent connection hash should be invalidated after a password change */ - unsigned is_stub:1; /* flag to keep track whether the connection structure has a real OCI connection associated */ - unsigned using_spool:1; /* Is this connection from session pool? */ - time_t idle_expiry; /* time when the connection will be considered as expired */ - time_t *next_pingp; /* (pointer to) time of the next ping */ - zend_string *hash_key; /* hashed details of the connection */ -#ifdef HAVE_OCI8_DTRACE - char *client_id; /* The oci_set_client_identifier() value */ -#endif - - zval taf_callback; /* The Oracle TAF callback function in the userspace */ -} php_oci_connection; -/* }}} */ - -/* {{{ php_oci_descriptor */ -typedef struct { - zend_resource *id; - zend_ulong index; /* descriptors hash table index */ - php_oci_connection *connection; /* parent connection handle */ - dvoid *descriptor; /* OCI descriptor handle */ - ub4 type; /* descriptor type (FILE/LOB) */ - ub4 lob_current_position; /* LOB internal pointer */ - int lob_size; /* cached LOB size. -1 = Lob wasn't initialized yet */ - int buffering; /* cached buffering flag. 0 - off, 1 - on, 2 - on and buffer was used */ - ub4 chunk_size; /* chunk size of the LOB. 0 - unknown */ - ub1 charset_form; /* charset form, required for NCLOBs */ - ub2 charset_id; /* charset ID */ - unsigned is_open:1; /* helps to determine if lob is open or not */ -} php_oci_descriptor; -/* }}} */ - -/* {{{ php_oci_lob_ctx */ -typedef struct { - char **lob_data; /* address of pointer to LOB data */ - ub4 *lob_len; /* address of LOB length variable (bytes) */ - ub4 alloc_len; -} php_oci_lob_ctx; -/* }}} */ - -/* {{{ php_oci_collection */ -typedef struct { - zend_resource *id; - php_oci_connection *connection; /* parent connection handle */ - OCIType *tdo; /* collection's type handle */ - OCITypeCode coll_typecode; /* collection's typecode handle */ - OCIRef *elem_ref; /* element's reference handle */ - OCIType *element_type; /* element's type handle */ - OCITypeCode element_typecode; /* element's typecode handle */ - OCIColl *collection; /* collection handle */ -} php_oci_collection; -/* }}} */ - -/* {{{ php_oci_define */ -typedef struct { - zval val; /* zval used in define */ - text *name; /* placeholder's name */ - ub4 name_len; /* placeholder's name length */ - ub4 type; /* define type */ -} php_oci_define; -/* }}} */ - -/* {{{ php_oci_statement */ -typedef struct { - zend_resource *id; - zend_resource *parent_stmtid; /* parent statement id */ - struct php_oci_statement *impres_child_stmt;/* child of current Implicit Result Set statement handle */ - ub4 impres_count; /* count of remaining Implicit Result children on parent statement handle */ - php_oci_connection *connection; /* parent connection handle */ - sb4 errcode; /* last ORA- error number */ - OCIError *err; /* private error handle */ - OCIStmt *stmt; /* statement handle */ - char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor received from Oracle */ - char impres_flag; /* PHP_OCI_IMPRES_*_ */ - zend_long last_query_len; /* last query length */ - HashTable *columns; /* hash containing all the result columns */ - HashTable *binds; /* binds hash */ - HashTable *defines; /* defines hash */ - int ncolumns; /* number of columns in the result */ - unsigned executed:1; /* statement executed flag */ - unsigned has_data:1; /* statement has more data flag */ - unsigned has_descr:1; /* statement has at least one descriptor or cursor column */ - ub2 stmttype; /* statement type */ - ub4 prefetch_count; /* row prefetch count */ - ub4 prefetch_lob_size; /* LOB prefetch size */ -} php_oci_statement; -/* }}} */ - -/* {{{ php_oci_bind */ -typedef struct { - OCIBind *bind; /* bind handle */ - zval val; /* value */ - dvoid *descriptor; /* used for binding of LOBS etc */ - OCIStmt *statement; /* used for binding REFCURSORs */ - php_oci_statement *parent_statement; /* pointer to the parent statement */ - ub2 type; /* bind type */ - struct { - void *elements; - sb2 *indicators; - ub2 *element_lengths; - ub4 current_length; - ub4 old_length; - ub4 max_length; - zend_long type; - } array; - sb2 indicator; /* -1 means NULL */ - ub2 retcode; - ub4 dummy_len; /* a dummy var to store alenpp value in bind OUT callback */ -} php_oci_bind; -/* }}} */ - -/* {{{ php_oci_out_column */ -typedef struct { - php_oci_statement *statement; /* statement handle. used when fetching REFCURSORS */ - php_oci_statement *nested_statement; /* statement handle. used when fetching REFCURSORS */ - OCIDefine *oci_define; /* define handle */ - char *name; /* column name */ - ub4 name_len; /* column name length */ - ub2 data_type; /* column data type */ - ub2 data_size; /* data size */ - ub4 storage_size4; /* size used when allocating buffers */ - sb2 indicator; - ub2 retcode; /* code returned when fetching this particular column */ - ub2 retlen; - ub4 retlen4; - ub2 is_descr; /* column contains a descriptor */ - ub2 is_cursor; /* column contains a cursor */ - zend_resource *stmtid; /* statement id for cursors */ - zend_resource *descid; /* descriptor id for descriptors */ - void *data; - php_oci_define *define; /* define handle */ - int piecewise; /* column is fetched piece-by-piece */ - ub4 cb_retlen; - sb1 scale; /* column scale */ - sb2 precision; /* column precision */ - ub1 charset_form; /* charset form, required for NCLOBs */ - ub2 charset_id; /* charset ID */ - ub4 chunk_size; /* LOB chunk size */ -} php_oci_out_column; -/* }}} */ - -/* {{{ macros */ - -#define PHP_OCI_CALL(func, params) \ - do { \ - OCI_G(in_call) = 1; \ - func params; \ - OCI_G(in_call) = 0; \ - } while (0) - -#define PHP_OCI_CALL_RETURN(__retval, func, params) \ - do { \ - OCI_G(in_call) = 1; \ - __retval = func params; \ - OCI_G(in_call) = 0; \ - } while (0) - -/* Check for errors that indicate the connection to the DB is no - * longer valid. If it isn't, then the PHP connection is marked to be - * reopened by the next PHP OCI8 connect command. This is most useful - * for persistent connections. The error number list is not - * exclusive. The error number comparisons and the - * OCI_ATTR_SERVER_STATUS check are done for maximum cross-version - * compatibility. In the far future, only the attribute check will be - * needed. - */ -#define PHP_OCI_HANDLE_ERROR(connection, errcode) \ - do { \ - ub4 serverStatus = OCI_SERVER_NORMAL; \ - switch (errcode) { \ - case 1013: \ - zend_bailout(); \ - break; \ - case 22: \ - case 28: \ - case 378: \ - case 602: \ - case 603: \ - case 604: \ - case 609: \ - case 1012: \ - case 1033: \ - case 1041: \ - case 1043: \ - case 1089: \ - case 1090: \ - case 1092: \ - case 3113: \ - case 3114: \ - case 3122: \ - case 3135: \ - case 3136: \ - case 12153: \ - case 12161: \ - case 27146: \ - case 28511: \ - (connection)->is_open = 0; \ - break; \ - default: \ - { \ - PHP_OCI_CALL(OCIAttrGet, ((dvoid *)(connection)->server, OCI_HTYPE_SERVER, (dvoid *)&serverStatus, \ - (ub4 *)0, OCI_ATTR_SERVER_STATUS, (connection)->err)); \ - if (serverStatus != OCI_SERVER_NORMAL) { \ - (connection)->is_open = 0; \ - } \ - } \ - break; \ - } \ - php_oci_dtrace_check_connection(connection, errcode, serverStatus); \ - } while (0) - -#define PHP_OCI_REGISTER_RESOURCE(resource, le_resource) \ - do { \ - resource->id = zend_register_resource(resource, le_resource); \ - } while (0) - -#define PHP_OCI_ZVAL_TO_CONNECTION(zval, connection) \ - if ((connection = (php_oci_connection *)zend_fetch_resource2(Z_RES_P(zval), "oci8 connection", le_connection, le_pconnection)) == NULL) { \ - RETURN_THROWS(); \ - } - -#define PHP_OCI_ZVAL_TO_STATEMENT(zval, statement) \ - if ((statement = (php_oci_statement *)zend_fetch_resource(Z_RES_P(zval), "oci8 statement", le_statement)) == NULL) { \ - RETURN_THROWS(); \ - } - -#define PHP_OCI_ZVAL_TO_DESCRIPTOR(zval, descriptor) \ - if ((descriptor = (php_oci_descriptor *)zend_fetch_resource(Z_RES_P(zval), "oci8 descriptor", le_descriptor)) == NULL) { \ - RETURN_THROWS(); \ - } - -#define PHP_OCI_ZVAL_TO_COLLECTION(zval, collection) \ - if ((collection = (php_oci_collection *)zend_fetch_resource(Z_RES_P(zval), "oci8 collection", le_collection)) == NULL) { \ - RETURN_THROWS(); \ - } - -#define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \ - do { \ - var = (type) zend_fetch_resource(Z_RES_P(zval), name, resource_type); \ - if (!var) { \ - return 1; \ - } \ - } while (0) - -#define PHP_OCI_ZVAL_TO_CONNECTION_EX(zval, connection) \ - PHP_OCI_FETCH_RESOURCE_EX(zval, connection, php_oci_connection *, "oci8 connection", le_connection) - -#define PHP_OCI_ZVAL_TO_STATEMENT_EX(zval, statement) \ - PHP_OCI_FETCH_RESOURCE_EX(zval, statement, php_oci_statement *, "oci8 statement", le_statement) - -#define PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(zval, descriptor) \ - PHP_OCI_FETCH_RESOURCE_EX(zval, descriptor, php_oci_descriptor *, "oci8 descriptor", le_descriptor) - -#define PHP_OCI_ZVAL_TO_COLLECTION_EX(zval, collection) \ - PHP_OCI_FETCH_RESOURCE_EX(zval, collection, php_oci_collection *, "oci8 collection", le_collection) - -/* }}} */ - -/* PROTOS */ - -/* {{{ main prototypes */ - -void php_oci_column_hash_dtor(zval *data); -void php_oci_define_hash_dtor(zval *data); -void php_oci_bind_hash_dtor(zval *data); -void php_oci_descriptor_flush_hash_dtor(zval *data); -void php_oci_connection_descriptors_free(php_oci_connection *connection); -sb4 php_oci_error(OCIError *err_p, sword status); -sb4 php_oci_fetch_errmsg(OCIError *error_handle, text *error_buf, size_t error_buf_size); -int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset); -void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclusive); -php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive); -int php_oci_connection_rollback(php_oci_connection *connection); -int php_oci_connection_commit(php_oci_connection *connection); -int php_oci_connection_release(php_oci_connection *connection); -int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len); -void php_oci_client_get_version(char *version, size_t version_size); -int php_oci_server_get_version(php_oci_connection *connection, char *version, size_t version_size); -void php_oci_fetch_row(INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_args); -int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode); -void php_oci_dtrace_check_connection(php_oci_connection *connection, sb4 errcode, ub4 serverStatus); - -/* }}} */ - -/* {{{ lob related prototypes */ - -php_oci_descriptor *php_oci_lob_create(php_oci_connection *connection, zend_long type); -int php_oci_lob_get_length(php_oci_descriptor *descriptor, ub4 *length); -int php_oci_lob_read(php_oci_descriptor *descriptor, zend_long read_length, zend_long inital_offset, char **data, ub4 *data_len); -int php_oci_lob_write(php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written); -int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag); -int php_oci_lob_set_buffering(php_oci_descriptor *descriptor, int on_off); -int php_oci_lob_get_buffering(php_oci_descriptor *descriptor); -int php_oci_lob_copy(php_oci_descriptor *descriptor, php_oci_descriptor *descriptor_from, zend_long length); -int php_oci_lob_close(php_oci_descriptor *descriptor); -int php_oci_temp_lob_close(php_oci_descriptor *descriptor); -int php_oci_lob_write_tmp(php_oci_descriptor *descriptor, zend_long type, char *data, int data_len); -void php_oci_lob_free(php_oci_descriptor *descriptor); -int php_oci_lob_import(php_oci_descriptor *descriptor, char *filename); -int php_oci_lob_append(php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from); -int php_oci_lob_truncate(php_oci_descriptor *descriptor, zend_long new_lob_length); -int php_oci_lob_erase(php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased); -int php_oci_lob_is_equal(php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result); -sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp); -/* }}} */ - -/* {{{ collection related prototypes */ - -php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len); -int php_oci_collection_size(php_oci_collection *collection, sb4 *size); -int php_oci_collection_max(php_oci_collection *collection, zend_long *max); -int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size); -int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len); -int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element); -int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len); -int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index); -int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len); -int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len); -int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len); -int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from); -void php_oci_collection_close(php_oci_collection *collection); -int php_oci_collection_append_null(php_oci_collection *collection); -int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len); -int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len); -int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len); - - -/* }}} */ - -/* {{{ statement related prototypes */ - -php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len); -php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement); -int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch); -int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows); -php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len); -int php_oci_statement_execute(php_oci_statement *statement, ub4 mode); -int php_oci_statement_cancel(php_oci_statement *statement); -void php_oci_statement_free(php_oci_statement *statement); -int php_oci_bind_pre_exec(zval *data, void *result); -int php_oci_bind_post_exec(zval *data); -int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_len, zval *var, zend_long maxlength, ub2 type); -sb4 php_oci_bind_in_callback(dvoid *ictxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp); -sb4 php_oci_bind_out_callback(dvoid *octxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp); -php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data); -int php_oci_cleanup_pre_fetch(zval *data); -int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type); -int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows); -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type); -php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length); -php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length); -php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength); -php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection); - -/* }}} */ - -ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ Module globals */ - sb4 errcode; /* global last ORA- error number. Used when connect fails, for example */ - OCIError *err; /* global error handle */ - - zend_long max_persistent; /* maximum number of persistent connections per process */ - zend_long num_persistent; /* number of existing persistent connections */ - zend_long num_links; /* non-persistent + persistent connections */ - zend_long num_statements; /* number of statements open */ - zend_long ping_interval; /* time interval between pings */ - zend_long persistent_timeout; /* time period after which idle persistent connection is considered expired */ - zend_long statement_cache_size; /* statement cache size. used with 9i+ clients only*/ - zend_long default_prefetch; /* default prefetch setting */ - zend_long prefetch_lob_size; /* amount of LOB data to read when initially getting a LOB locator */ - bool privileged_connect; /* privileged connect flag (On/Off) */ - bool old_oci_close_semantics; /* old_oci_close_semantics flag (to determine the way oci_close() should behave) */ - int shutdown; /* in shutdown flag */ - - OCIEnv *env; /* global environment handle */ - - bool in_call; - char *connection_class; - bool events; - char *edition; -ZEND_END_MODULE_GLOBALS(oci) /* }}} */ - -/* {{{ transparent failover related prototypes */ - -int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback); -int php_oci_unregister_taf_callback(php_oci_connection *connection); - -/* }}} */ - -#ifdef ZTS -#define OCI_G(v) TSRMG(oci_globals_id, zend_oci_globals *, v) -#else -#define OCI_G(v) (oci_globals.v) -#endif - -/* Allow install from PECL on PHP < 7.3 */ -#ifndef GC_ADDREF -# define GC_ADDREF(p) (++GC_REFCOUNT(p)) -#endif -#ifndef GC_DELREF -# define GC_DELREF(p) (GC_REFCOUNT(p)--) -#endif - -ZEND_EXTERN_MODULE_GLOBALS(oci) - -# endif /* !PHP_OCI8_INT_H */ -#else /* !HAVE_OCI8 */ - -# define oci8_module_ptr NULL - -#endif /* HAVE_OCI8 */ diff --git a/ext/oci8/tests/CONFLICTS b/ext/oci8/tests/CONFLICTS deleted file mode 100644 index ff6afc6fb083..000000000000 --- a/ext/oci8/tests/CONFLICTS +++ /dev/null @@ -1,2 +0,0 @@ -# OCI tests are network intensive and may cause timeouts in other tests -all diff --git a/ext/oci8/tests/array_bind_001.phpt b/ext/oci8/tests/array_bind_001.phpt deleted file mode 100644 index 1404a1593f43..000000000000 --- a/ext/oci8/tests/array_bind_001.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and invalid values 1 ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: oci_bind_array_by_name(): OCI-21560: argument 3 is null, invalid, or out of range in %s on line %d - -Warning: oci_execute(): ORA-%r(01008|57000)%r: %s in %s on line %d -array(1) { - [0]=> - string(0) "" -} -Done diff --git a/ext/oci8/tests/array_bind_002.phpt b/ext/oci8/tests/array_bind_002.phpt deleted file mode 100644 index cda2a5d3cf37..000000000000 --- a/ext/oci8/tests/array_bind_002.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and invalid values 2 ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- -getMessage(), "\n"; -} - -oci_execute($statement); - -var_dump($array); - -echo "Done\n"; -?> ---EXPECTF-- -oci_bind_array_by_name(): Argument #4 ($max_array_length) must be greater than 0 - -Warning: oci_execute(): ORA-%r(01008|57000)%r: %s in %s on line %d -array(5) { - [0]=> - string(9) "06-DEC-05" - [1]=> - string(9) "10-DEC-80" - [2]=> - string(9) "21-AUG-91" - [3]=> - string(9) "26-OCT-17" - [4]=> - string(9) "05-NOV-05" -} -Done diff --git a/ext/oci8/tests/array_bind_003.phpt b/ext/oci8/tests/array_bind_003.phpt deleted file mode 100644 index 2b6983b88cc5..000000000000 --- a/ext/oci8/tests/array_bind_003.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and invalid values 3 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Warning: oci_execute(): ORA-01403: %s -ORA-06512: at "%s.ARRAY_BIND_003_PKG", line %d -ORA-06512: at line %d in %sarray_bind_003.php on line %d -array(4) { - [0]=> - string(9) "06-DEC-05" - [1]=> - string(9) "10-DEC-80" - [2]=> - string(9) "21-AUG-91" - [3]=> - string(9) "26-OCT-17" -} -Done diff --git a/ext/oci8/tests/array_bind_004.phpt b/ext/oci8/tests/array_bind_004.phpt deleted file mode 100644 index cb2cfcae717e..000000000000 --- a/ext/oci8/tests/array_bind_004.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and invalid values 4 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Warning: oci_execute(): ORA-01403: %s -ORA-06512: at "%s.ARRAY_BIND_004_PKG", line %d -ORA-06512: at line %d in %sarray_bind_004.php on line %d -array(0) { -} -Done diff --git a/ext/oci8/tests/array_bind_005.phpt b/ext/oci8/tests/array_bind_005.phpt deleted file mode 100644 index a40dce09b3b3..000000000000 --- a/ext/oci8/tests/array_bind_005.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and invalid values 5 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - string(0) "" - [1]=> - string(0) "" - [2]=> - string(0) "" - [3]=> - string(0) "" - [4]=> - string(0) "" -} -Done diff --git a/ext/oci8/tests/array_bind_006.phpt b/ext/oci8/tests/array_bind_006.phpt deleted file mode 100644 index c0b2f007dcfa..000000000000 --- a/ext/oci8/tests/array_bind_006.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -oci_bind_array_by_name(), SQLT_CHR and default max_length ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - string(4) "five" - [1]=> - string(4) "four" - [2]=> - string(5) "three" - [3]=> - string(3) "two" - [4]=> - string(3) "one" -} -Done diff --git a/ext/oci8/tests/array_bind_007.phpt b/ext/oci8/tests/array_bind_007.phpt deleted file mode 100644 index fee6eff1177a..000000000000 --- a/ext/oci8/tests/array_bind_007.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and invalid values 7 ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: oci_bind_array_by_name(): Unknown or unsupported datatype given: -1 in %s on line %d - -Warning: oci_execute(): ORA-%r(01008|57000)%r: %s in %s on line %d -array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -Done diff --git a/ext/oci8/tests/array_bind_008.phpt b/ext/oci8/tests/array_bind_008.phpt deleted file mode 100644 index d499a05ce2c4..000000000000 --- a/ext/oci8/tests/array_bind_008.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and invalid values 8 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Warning: oci_execute(): ORA-06550: line %d, column %d: -PLS-00418: %s -ORA-06550: %s -PL/SQL: %s -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - [4]=> - string(1) "5" -} -Done diff --git a/ext/oci8/tests/array_bind_009.phpt b/ext/oci8/tests/array_bind_009.phpt deleted file mode 100644 index ecd4c46f31b5..000000000000 --- a/ext/oci8/tests/array_bind_009.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and invalid values 9 ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Uncaught TypeError: oci_bind_array_by_name(): supplied resource is not a valid oci8 statement resource in %s:%d -Stack trace: -#0 %s: oci_bind_array_by_name(%s) -#1 {main} - thrown in %s on line %d \ No newline at end of file diff --git a/ext/oci8/tests/array_bind_010.phpt b/ext/oci8/tests/array_bind_010.phpt deleted file mode 100644 index 29da0fa28f2d..000000000000 --- a/ext/oci8/tests/array_bind_010.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and invalid values 8 ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: oci_bind_array_by_name(): ORA-01036: illegal variable name/number in %s on line %d -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - [4]=> - string(1) "5" -} -Done diff --git a/ext/oci8/tests/array_bind_011.phpt b/ext/oci8/tests/array_bind_011.phpt deleted file mode 100644 index 021caa35ee47..000000000000 --- a/ext/oci8/tests/array_bind_011.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d - -Warning: oci_execute(): ORA-%r(01008|57000)%r: %s in %s on line %d -array(0) { -} -Done diff --git a/ext/oci8/tests/array_bind_012.phpt b/ext/oci8/tests/array_bind_012.phpt deleted file mode 100644 index 8086a9c0f3ab..000000000000 --- a/ext/oci8/tests/array_bind_012.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: oci_bind_array_by_name(): Invalid max length value (-10) in %s on line %d -array(0) { -} -Done diff --git a/ext/oci8/tests/array_bind_013.phpt b/ext/oci8/tests/array_bind_013.phpt deleted file mode 100644 index c697ce1bf761..000000000000 --- a/ext/oci8/tests/array_bind_013.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- -getMessage() . "\n"; -} - -var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -10)); -var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -1)); -var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, 0)); - -@oci_execute($statement); - -var_dump($array); - -echo "Done\n"; -?> ---EXPECTF-- -oci_bind_array_by_name() expects at most 6 arguments, 7 given - -Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d -bool(false) - -Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d -bool(false) - -Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d -bool(false) -array(0) { -} -Done diff --git a/ext/oci8/tests/array_bind_014.phpt b/ext/oci8/tests/array_bind_014.phpt deleted file mode 100644 index 3bfce55a9a65..000000000000 --- a/ext/oci8/tests/array_bind_014.phpt +++ /dev/null @@ -1,79 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and NUMBERs ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - int(5) - [1]=> - int(4) - [2]=> - int(3) - [3]=> - int(2) - [4]=> - int(1) -} -Done diff --git a/ext/oci8/tests/array_bind_bdouble.phpt b/ext/oci8/tests/array_bind_bdouble.phpt deleted file mode 100644 index bc95cd12ecd0..000000000000 --- a/ext/oci8/tests/array_bind_bdouble.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Unsupported type: oci_bind_array_by_name() and SQLT_BDOUBLE ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (!defined('SQLT_BDOUBLE')) die('skip SQLT_BDOUBLE type not available on older Oracle clients'); -?> ---FILE-- - ---EXPECTF-- -Warning: oci_bind_array_by_name(): Unknown or unsupported datatype given: 22 in %sarray_bind_bdouble.php on line %d -Done diff --git a/ext/oci8/tests/array_bind_bfloat.phpt b/ext/oci8/tests/array_bind_bfloat.phpt deleted file mode 100644 index b00bd56328ab..000000000000 --- a/ext/oci8/tests/array_bind_bfloat.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Unsupported type: oci_bind_array_by_name() and SQLT_BFLOAT ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (!defined('SQLT_BFLOAT')) die('skip SQLT_BFLOAT type not available on older Oracle clients'); -?> ---FILE-- - ---EXPECTF-- -Warning: oci_bind_array_by_name(): Unknown or unsupported datatype given: 21 in %sarray_bind_bfloat.php on line %d -Done diff --git a/ext/oci8/tests/array_bind_date.phpt b/ext/oci8/tests/array_bind_date.phpt deleted file mode 100644 index 2e1aced15237..000000000000 --- a/ext/oci8/tests/array_bind_date.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and SQLT_ODT ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - string(9) "05-NOV-05" - [1]=> - string(9) "26-OCT-17" - [2]=> - string(9) "21-AUG-91" - [3]=> - string(9) "10-DEC-80" - [4]=> - string(9) "06-DEC-05" -} -Done diff --git a/ext/oci8/tests/array_bind_date1.phpt b/ext/oci8/tests/array_bind_date1.phpt deleted file mode 100644 index 6b16f8096387..000000000000 --- a/ext/oci8/tests/array_bind_date1.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and SQLT_ODT ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - string(9) "05-NOV-05" - [1]=> - string(9) "26-OCT-17" - [2]=> - string(9) "21-AUG-91" - [3]=> - string(9) "10-DEC-80" - [4]=> - string(9) "06-DEC-05" -} -Done diff --git a/ext/oci8/tests/array_bind_float.phpt b/ext/oci8/tests/array_bind_float.phpt deleted file mode 100644 index f1d2b63801c7..000000000000 --- a/ext/oci8/tests/array_bind_float.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and SQLT_FLT ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -array(5) { - [0]=> - float(5.9999) - [1]=> - float(4.2123) - [2]=> - float(3.4234) - [3]=> - float(2.5658%S) - [4]=> - float(1.243) -} -Done diff --git a/ext/oci8/tests/array_bind_float1.phpt b/ext/oci8/tests/array_bind_float1.phpt deleted file mode 100644 index 5d96198f70eb..000000000000 --- a/ext/oci8/tests/array_bind_float1.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and SQLT_FLT ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -array(5) { - [0]=> - float(5.9999) - [1]=> - float(4.2123) - [2]=> - float(3.4234) - [3]=> - float(2.5658%S) - [4]=> - float(1.243) -} -Done diff --git a/ext/oci8/tests/array_bind_int.phpt b/ext/oci8/tests/array_bind_int.phpt deleted file mode 100644 index 810559e670fa..000000000000 --- a/ext/oci8/tests/array_bind_int.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and SQLT_INT ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - int(5) - [1]=> - int(4) - [2]=> - int(3) - [3]=> - int(2) - [4]=> - int(1) -} -Done diff --git a/ext/oci8/tests/array_bind_int1.phpt b/ext/oci8/tests/array_bind_int1.phpt deleted file mode 100644 index 78763fde4c40..000000000000 --- a/ext/oci8/tests/array_bind_int1.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and SQLT_INT ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - int(5) - [1]=> - int(4) - [2]=> - int(3) - [3]=> - int(2) - [4]=> - int(1) -} -Done diff --git a/ext/oci8/tests/array_bind_str.phpt b/ext/oci8/tests/array_bind_str.phpt deleted file mode 100644 index c64cb4090115..000000000000 --- a/ext/oci8/tests/array_bind_str.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and SQLT_CHR ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - string(4) "five" - [1]=> - string(4) "four" - [2]=> - string(5) "three" - [3]=> - string(3) "two" - [4]=> - string(3) "one" -} -Done diff --git a/ext/oci8/tests/array_bind_str1.phpt b/ext/oci8/tests/array_bind_str1.phpt deleted file mode 100644 index 4980116bf2dd..000000000000 --- a/ext/oci8/tests/array_bind_str1.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -oci_bind_array_by_name() and SQLT_CHR ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - string(4) "five" - [1]=> - string(4) "four" - [2]=> - string(5) "three" - [3]=> - string(3) "two" - [4]=> - string(3) "one" -} -Done diff --git a/ext/oci8/tests/array_bind_uin.phpt b/ext/oci8/tests/array_bind_uin.phpt deleted file mode 100644 index 06b87b606fbd..000000000000 --- a/ext/oci8/tests/array_bind_uin.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Unsupported type: oci_bind_array_by_name() and SQLT_UIN ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Warning: oci_bind_array_by_name(): Unknown or unsupported datatype given: 68 in %sarray_bind_uin.php on line %d -Done diff --git a/ext/oci8/tests/b47243_1.phpt b/ext/oci8/tests/b47243_1.phpt deleted file mode 100644 index 8e2a7f4145b7..000000000000 --- a/ext/oci8/tests/b47243_1.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #47243 (Crash on exit with ZTS mode) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - -===DONE=== ---EXPECT-- -===DONE=== diff --git a/ext/oci8/tests/b47243_2.phpt b/ext/oci8/tests/b47243_2.phpt deleted file mode 100644 index 45a1b57e00fa..000000000000 --- a/ext/oci8/tests/b47243_2.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #47243 (Crash on exit with ZTS mode) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - -===DONE=== ---EXPECT-- -===DONE=== diff --git a/ext/oci8/tests/b47243_3.phpt b/ext/oci8/tests/b47243_3.phpt deleted file mode 100644 index 7e2824d31958..000000000000 --- a/ext/oci8/tests/b47243_3.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #47243 (Crash on exit with ZTS mode) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - -===DONE=== ---EXPECT-- -===DONE=== diff --git a/ext/oci8/tests/bind_boolean_1.phpt b/ext/oci8/tests/bind_boolean_1.phpt deleted file mode 100644 index dbf971a28a8c..000000000000 --- a/ext/oci8/tests/bind_boolean_1.phpt +++ /dev/null @@ -1,137 +0,0 @@ ---TEST-- -Basic PL/SQL "BOOLEAN" (SQLT_BOL) bind test ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 -bool(true) -bool(false) -Test 2 -bool(true) -Test 3 -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -Test 4 -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -Test 5 -bool(true) -bool(false) -bool(false) -bool(true) diff --git a/ext/oci8/tests/bind_char_1.phpt b/ext/oci8/tests/bind_char_1.phpt deleted file mode 100644 index 7c069342ab45..000000000000 --- a/ext/oci8/tests/bind_char_1.phpt +++ /dev/null @@ -1,293 +0,0 @@ ---TEST-- -SELECT oci_bind_by_name with SQLT_AFC aka CHAR ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12)) { - die("skip expected output only valid when using Oracle 12c database"); -} -?> ---ENV-- -NLS_LANG=.AL32UTF8 ---FILE-- - ---EXPECT-- -*** Non-null Data Tests against CHAR*** -Test 1.1: Type: default. Length: default - Querying: -Test 1.2: Type: AFC. Length: default - Querying: - :1: - :abc : - :: -Test 1.3: Type: AFC: Length: 0 - Querying: - :1: - :abc : - :: -Test 1.4: Type: AFC: Length: strlen - Querying: - :1: - :abc : - :: -Test 1.5: Type: AFC. Length: strlen-1 - Querying: -Test 1.6: Type: AFC. Length: strlen+1 - Querying: - :1: - :abc : - :: - - -*** NULL data tests against CHAR *** -Test 2.1: Type: default. Length: default - Querying: -Test 2.2: Type: AFC. Length: default - Querying: -Test 2.3: Type: AFC: Length: 0 - Querying: -Test 2.4: Type: AFC: Length: strlen - Querying: -Test 2.5: Type: AFC. Length: strlen-1 - Querying: -Test 2.6: Type: AFC. Length: strlen+1 - Querying: - - -*** Non-null Data Tests against VARCHAR2*** -Test 3.1: Type: default. Length: default - Querying: - :2: - :: - :abc: -Test 3.2: Type: AFC. Length: default - Querying: - :2: - :: - :abc: -Test 3.3: Type: AFC: Length: 0 - Querying: - :2: - :: - :abc: -Test 3.4: Type: AFC: Length: strlen - Querying: - :2: - :: - :abc: -Test 3.5: Type: AFC. Length: strlen-1 - Querying: -Test 3.6: Type: AFC. Length: strlen+1 - Querying: - :2: - :: - :abc: - - -*** NULL data tests against VARCHAR2 *** -Test 4.1: Type: default. Length: default - Querying: -Test 4.2: Type: AFC. Length: default - Querying: -Test 4.3: Type: AFC: Length: 0 - Querying: -Test 4.4: Type: AFC: Length: strlen - Querying: -Test 4.5: Type: AFC. Length: strlen-1 - Querying: -Test 4.6: Type: AFC. Length: strlen+1 - Querying: -Done diff --git a/ext/oci8/tests/bind_char_2.phpt b/ext/oci8/tests/bind_char_2.phpt deleted file mode 100644 index 55bf9afee726..000000000000 --- a/ext/oci8/tests/bind_char_2.phpt +++ /dev/null @@ -1,119 +0,0 @@ ---TEST-- -SELECT oci_bind_by_name with SQLT_AFC aka CHAR and dates ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12)) { - die("skip expected output only valid when using Oracle 12c database"); -} -?> ---ENV-- -NLS_LANG=.AL32UTF8 ---FILE-- - ---EXPECT-- -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: - :1: - :2008-04-20: -Test 1.4: Type: AFC: Length: strlen - Querying: - :1: - :2008-04-20: -Test 1.5: Type: AFC. Length: strlen-1 - Querying: -Test 1.6: Type: AFC. Length: strlen+1 - Querying: - :1: - :2008-04-20: -Done diff --git a/ext/oci8/tests/bind_char_3.phpt b/ext/oci8/tests/bind_char_3.phpt deleted file mode 100644 index 16213bff3f7c..000000000000 --- a/ext/oci8/tests/bind_char_3.phpt +++ /dev/null @@ -1,338 +0,0 @@ ---TEST-- -PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to CHAR parameter ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12)) { - die("skip expected output only valid when using Oracle 12c database"); -} -?> ---ENV-- -NLS_LANG=.AL32UTF8 ---FILE-- - ---EXPECT-- -Test 1.1 In Length: default. In Type: default. Out Length: default. Out Type: default - Executing: - Oci_execute error ORA-6502 -string(3) "abc" -NULL -Test 1.2 In Length: default. In Type: default. Out Length: 10. Out Type: default - Executing: -string(3) "abc" -string(3) "abc" -Test 1.3 In Length: -1. In Type: AFC. Out Length: 10. Out Type: default - Executing: -string(3) "abc" -string(3) "abc" -Test 1.4 In Length: -1. In Type: AFC. Out Length: 10. Out Type: AFC - Executing: -string(3) "abc" -string(10) "abc " -Test 1.5 In Length: strlen. In Type: AFC. Out Length: strlen(input). Out Type: AFC - Executing: -string(3) "abc" -string(3) "abc" -Test 1.6 In Length: strlen. In Type: AFC. Out Length: strlen(input)-1. Out Type: AFC - Executing: - Oci_execute error ORA-6502 -string(3) "abc" -string(3) "abc" -Test 1.7 In Length: strlen. In Type: AFC. Out Length: strlen(input)+1. Out Type: AFC - Executing: -string(3) "abc" -string(4) "abc " - - -Tests with '' - -Test 2.1 In Length: -1. In Type: AFC. Out Length: 10. Out Type: AFC - Executing: -string(0) "" -NULL -Test 2.2 In Length: default. In Type: default. Out Length: 10. Out Type: default - Executing: -string(0) "" -NULL -Test 2.3 In Length: -1. In Type: AFC. Out Length: 10. Out Type: default - Executing: -string(0) "" -NULL -Test 2.4 In Length: -1. In Type: AFC. Out Length: 10. Out Type: AFC - Executing: -string(0) "" -NULL -Test 2.5 In Length: -1. In Type: AFC. Out Length: 0. Out Type: AFC - Executing: -string(0) "" -NULL -Test 2.6 In Length: 0. In Type: AFC. Out Length: 0. Out Type: AFC - Executing: -string(0) "" -NULL -Test 2.7 In Length: 1. In Type: AFC. Out Length: 1. Out Type: AFC - Executing: -string(0) "" -NULL - - -Tests with NULL -Test 3.1 In Length: -1. In Type: AFC. Out Length: 10. Out Type: AFC - Executing: -NULL -NULL -Test 3.2 In Length: default. In Type: default. Out Length: 10. Out Type: default - Executing: -NULL -NULL -Test 3.3 In Length: -1. In Type: AFC. Out Length: 10. Out Type: default - Executing: -NULL -NULL -Test 3.4 In Length: -1. In Type: AFC. Out Length: 10. Out Type: AFC - Executing: -NULL -NULL -Test 3.5 In Length: -1. In Type: AFC. Out Length: 0. Out Type: AFC - Executing: -NULL -NULL -Test 3.6 In Length: -1. In Type: AFC. Out Length: 1. Out Type: AFC - Executing: -NULL -NULL -Done diff --git a/ext/oci8/tests/bind_char_4.phpt b/ext/oci8/tests/bind_char_4.phpt deleted file mode 100644 index 96117f85f313..000000000000 --- a/ext/oci8/tests/bind_char_4.phpt +++ /dev/null @@ -1,340 +0,0 @@ ---TEST-- -PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to VARCHAR2 parameter ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12)) { - die("skip expected output only valid when using Oracle 12c database"); -} -?> ---ENV-- -NLS_LANG=.AL32UTF8 ---FILE-- - ---EXPECT-- -Test 1.1 In Length: default. In Type: default. Out Length: default. Out Type: default - Executing: - Oci_execute error ORA-6502 -string(3) "abc" -NULL -Test 1.2 In Length: default. In Type: default. Out Length: 10. Out Type: default - Executing: -string(3) "abc" -string(3) "abc" -Test 1.3 In Length: -1. In Type: AFC. Out Length: 10. Out Type: default - Executing: -string(3) "abc" -string(3) "abc" -Test 1.4 In Length: -1. In Type: AFC. Out Length: 10. Out Type: AFC - Executing: -string(3) "abc" -string(10) "abc " -Test 1.5 In Length: strlen. In Type: AFC. Out Length: strlen(input). Out Type: AFC - Executing: -string(3) "abc" -string(3) "abc" -Test 1.6 In Length: strlen. In Type: AFC. Out Length: strlen(input)-1. Out Type: AFC - Executing: - Oci_execute error ORA-6502 -string(3) "abc" -string(3) "abc" -Test 1.7 In Length: strlen. In Type: AFC. Out Length: strlen(input)+1. Out Type: AFC - Executing: -string(3) "abc" -string(4) "abc " - - -Tests with '' - -Test 2.1 In Length: -1. In Type: AFC. Out Length: 10. Out Type: AFC - Executing: -string(0) "" -NULL -Test 2.2 In Length: default. In Type: default. Out Length: 10. Out Type: default - Executing: -string(0) "" -NULL -Test 2.3 In Length: -1. In Type: AFC. Out Length: 10. Out Type: default - Executing: -string(0) "" -NULL -Test 2.4 In Length: -1. In Type: AFC. Out Length: 10. Out Type: AFC - Executing: -string(0) "" -NULL -Test 2.5 In Length: -1. In Type: AFC. Out Length: 0. Out Type: AFC - Executing: -string(0) "" -NULL -Test 2.6 In Length: 0. In Type: AFC. Out Length: 0. Out Type: AFC - Executing: -string(0) "" -NULL -Test 2.7 In Length: 1. In Type: AFC. Out Length: 1. Out Type: AFC - Executing: -string(0) "" -NULL - - -Tests with NULL -Test 3.1 In Length: -1. In Type: AFC. Out Length: 10. Out Type: AFC - Executing: -NULL -NULL -Test 3.2 In Length: default. In Type: default. Out Length: 10. Out Type: default - Executing: -NULL -NULL -Test 3.3 In Length: -1. In Type: AFC. Out Length: 10. Out Type: default - Executing: -NULL -NULL -Test 3.4 In Length: -1. In Type: AFC. Out Length: 10. Out Type: AFC - Executing: -NULL -NULL -Test 3.5 In Length: -1. In Type: AFC. Out Length: 0. Out Type: AFC - Executing: -NULL -NULL -Test 3.6 In Length: -1. In Type: AFC. Out Length: 1. Out Type: AFC - Executing: -NULL -NULL -Done diff --git a/ext/oci8/tests/bind_empty.phpt b/ext/oci8/tests/bind_empty.phpt deleted file mode 100644 index 9a6e39bcf2f4..000000000000 --- a/ext/oci8/tests/bind_empty.phpt +++ /dev/null @@ -1,128 +0,0 @@ ---TEST-- -binding empty values ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 -bool(true) -Test 2 -bool(true) -Test 3 -bool(true) -array(1) { - ["NAME"]=> - array(2) { - [0]=> - string(3) "def" - [1]=> - NULL - } -} -Test 4 -bool(true) -array(1) { - ["NAME"]=> - array(2) { - [0]=> - NULL - [1]=> - NULL - } -} -Test 5 -string(3) "old" -NULL -Test 6 -NULL -NULL diff --git a/ext/oci8/tests/bind_long.phpt b/ext/oci8/tests/bind_long.phpt deleted file mode 100644 index 74b38d7b07eb..000000000000 --- a/ext/oci8/tests/bind_long.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -bind LONG field ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -Test 1 -string(32) "5c7c34abf7ea51936785062dbfcaeddc" -int(394) -Test 2 - test multi chunk fetch -string(32) "ee2e98b977341cfb8e037066e5fcb909" -int(236400) -Done diff --git a/ext/oci8/tests/bind_long_raw.phpt b/ext/oci8/tests/bind_long_raw.phpt deleted file mode 100644 index feeb1d0b4532..000000000000 --- a/ext/oci8/tests/bind_long_raw.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -bind LONG RAW field ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -string(32) "614fcbba1effb7caa27ef0ef25c27fcf" -int(2523) -Done diff --git a/ext/oci8/tests/bind_misccoltypes.phpt b/ext/oci8/tests/bind_misccoltypes.phpt deleted file mode 100644 index 31adb213d932..000000000000 --- a/ext/oci8/tests/bind_misccoltypes.phpt +++ /dev/null @@ -1,366 +0,0 @@ ---TEST-- -Bind miscellaneous column types using default types ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -TEST86 insert all ORATYPE values - -TEST87 SELECT all values using DEFINEs -ID is 86 -CHAR_T is C -CHAR_T10 is char10 -VARCHAR2_T10 is varchar210 -NUMBER_T is -123.456 -NUMBER_T92 is 789.35 -NUMBER_T6 is 123456 -DATE_T is 29-MAR-10 -TIMESTAMP_T is 29-MAR-10 01.09.15.000000 PM -FLOAT_T is 12345678901234567890123456789012345679 -BINARY_FLOAT_T is 1.23456784E+037 -BINARY_DOUBLE_T is 1.2345678901234568E+037 -DECIMAL_T is 86 -INTEGER_T is 86 -NCHAR_T is nchar10 -NVARCHAR2_T10 is nvarchar2x -VARCHAR_T10 is varchar - -TEST52 insert numbers -array(1) { - ["NUMBER_T92"]=> - array(1) { - [0]=> - string(1) "3" - } -} - -TEST53 insert numbers -array(1) { - ["NUMBER_T92"]=> - array(1) { - [0]=> - string(4) "8.67" - } -} - -TEST54 insert numbers -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(4) "4.67" - } -} - -TEST55 insert numbers -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(4) "7.67" - } -} - -TEST56 insert numbers -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(5) "-5.67" - } -} - -TEST58 insert a VARCHAR2 -array(1) { - ["VARCHAR2_T10"]=> - array(1) { - [0]=> - string(4) "Hood" - } -} - -TEST59 insert a VARCHAR2 -array(1) { - ["CHAR_T10"]=> - array(1) { - [0]=> - string(10) "Hood " - } -} - -TEST60 insert a date -array(1) { - ["DATE_T"]=> - array(1) { - [0]=> - string(9) "09-APR-10" - } -} diff --git a/ext/oci8/tests/bind_misccoltypes_errs.phpt b/ext/oci8/tests/bind_misccoltypes_errs.phpt deleted file mode 100644 index d28426f511ca..000000000000 --- a/ext/oci8/tests/bind_misccoltypes_errs.phpt +++ /dev/null @@ -1,170 +0,0 @@ ---TEST-- -Bind miscellaneous column types and generating errors ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Test 1 insert numbers - -Warning: oci_execute(): ORA-01438: %s in %sbind_misccoltypes_errs.php on line %d -array(1) { - ["NUMBER_T6"]=> - array(0) { - } -} - -Test 2 insert numbers - -Warning: oci_execute(): ORA-01722: %s in %sbind_misccoltypes_errs.php on line %d -array(1) { - ["NUMBER_T6"]=> - array(0) { - } -} - -Test 3 - too long CHAR - -Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."CHAR_T" \(%s: 2, %s: 1\)|String data right truncation)%r in %sbind_misccoltypes_errs.php on line %d - -Test 4 - too long VARCHAR2 - -Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."VARCHAR2_T10" \(%s: 11, %s: 10\)|%s data right truncation)%r in %sbind_misccoltypes_errs.php on line %d - -Test 5 - invalid number - -Warning: oci_execute(): ORA-01722: %s in %sbind_misccoltypes_errs.php on line %d - -Test 6 - insert a VARCHAR2 with SQLT_BIN - -Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."VARCHAR2_T10" \(%s: 12, %s: 10\)|String data right truncation)%r in %sbind_misccoltypes_errs.php on line %d -array(1) { - ["VARCHAR2_T10"]=> - array(0) { - } -} - -Test 7 - insert a VARCHAR2 with SQLT_LBI - -Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."VARCHAR2_T10" \(%s: 12, %s: 10\)|String data right truncation)%r in %sbind_misccoltypes_errs.php on line %d -array(1) { - ["VARCHAR2_T10"]=> - array(0) { - } -} diff --git a/ext/oci8/tests/bind_number.phpt b/ext/oci8/tests/bind_number.phpt deleted file mode 100644 index 7e3c27cefd85..000000000000 --- a/ext/oci8/tests/bind_number.phpt +++ /dev/null @@ -1,214 +0,0 @@ ---TEST-- -Bind with NUMBER column variants ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -precision = 14 ---FILE-- - ---EXPECTF-- -Test 1 - invalid number - -Warning: oci_execute(): ORA-01722: %s in %sbind_number.php on line %d -array(1) { - ["NUMBER_T6"]=> - array(0) { - } -} - -TEST66 insert a float -array(1) { - ["FLOAT_T"]=> - array(1) { - [0]=> - string(7) "123.456" - } -} - -TEST67 insert a binary float -array(1) { - ["BINARY_FLOAT_T"]=> - array(1) { - [0]=> - string(%r15|8%r) "%r(5.67455994E\+002|567.4560)%r" - } -} - -TEST69 insert a binary double -array(1) { - ["BINARY_DOUBLE_T"]=> - array(1) { - [0]=> - string(%r23|16%r) "%r(5.6745600000000002E\+002|567.456000000000)%r" - } -} - -TEST71 insert a decimal -array(1) { - ["DECIMAL_T"]=> - array(1) { - [0]=> - string(3) "124" - } -} - -TEST72 insert a decimal -array(1) { - ["DECIMAL_T"]=> - array(1) { - [0]=> - string(1) "0" - } -} - -TEST73 insert a double -array(1) { - ["BINARY_DOUBLE_T"]=> - array(1) { - [0]=> - string(%r12|16%r) "%r(4.83589E\+002|483.589000000000)%r" - } -} - -TEST75 insert a INTEGER -array(1) { - ["INTEGER_T"]=> - array(1) { - [0]=> - string(3) "589" - } -} - -TEST76 insert a INTEGER -array(1) { - ["INTEGER_T"]=> - array(1) { - [0]=> - string(2) "42" - } -} diff --git a/ext/oci8/tests/bind_query.phpt b/ext/oci8/tests/bind_query.phpt deleted file mode 100644 index b390487fc35d..000000000000 --- a/ext/oci8/tests/bind_query.phpt +++ /dev/null @@ -1,79 +0,0 @@ ---TEST-- -Bind with various WHERE conditions ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - :v order by ename'); -oci_bind_by_name( $s, ":v", $v); -oci_define_by_name($s, "ENAME", $ename, 20); -oci_execute($s); -while (oci_fetch($s)) { - var_dump($ename); -} - - -echo "Test 3\n"; - -$s = oci_parse($c, 'select ename from bind_query_tab where sal > :v order by ename'); -oci_bind_by_name( $s, ":v", $v); -$v = 2000; -oci_define_by_name($s, "ENAME", $ename, 20); -oci_execute($s); -while (oci_fetch($s)) { - var_dump($ename); -} - - -// Clean up - -$stmtarray = array( - "drop table bind_query_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECT-- -Test 1 -array(1) { - [0]=> - string(6) "MILLER" -} -Test 2 -string(4) "FORD" -string(6) "MILLER" -Test 3 -string(4) "FORD" diff --git a/ext/oci8/tests/bind_raw.phpt b/ext/oci8/tests/bind_raw.phpt deleted file mode 100644 index 40b99fa1fe0a..000000000000 --- a/ext/oci8/tests/bind_raw.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -bind RAW field ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -string(32) "88b274d7a257ac6f70435b83abd4e26e" -int(300) -Done diff --git a/ext/oci8/tests/bind_raw_2.phpt b/ext/oci8/tests/bind_raw_2.phpt deleted file mode 100644 index 5d1cb080e77f..000000000000 --- a/ext/oci8/tests/bind_raw_2.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -bind RAW field with OCI_B_BIN ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -string(32) "88b274d7a257ac6f70435b83abd4e26e" -int(300) -Done diff --git a/ext/oci8/tests/bind_rowid.phpt b/ext/oci8/tests/bind_rowid.phpt deleted file mode 100644 index a701e7e20838..000000000000 --- a/ext/oci8/tests/bind_rowid.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -Test ROWID bind ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Initial Data -array(1) { - ["ADDRESS"]=> - string(16) "original text #1" -} -array(1) { - ["ADDRESS"]=> - string(16) "original text #2" -} -Verify Change -array(1) { - ["ADDRESS"]=> - string(13) "Some new text" -} -array(1) { - ["ADDRESS"]=> - string(16) "original text #2" -} -Done diff --git a/ext/oci8/tests/bind_sqltafc.phpt b/ext/oci8/tests/bind_sqltafc.phpt deleted file mode 100644 index 1ed046b5979c..000000000000 --- a/ext/oci8/tests/bind_sqltafc.phpt +++ /dev/null @@ -1,209 +0,0 @@ ---TEST-- -Bind tests with SQLT_AFC ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -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 - } -} diff --git a/ext/oci8/tests/bind_sqltchr_1.phpt b/ext/oci8/tests/bind_sqltchr_1.phpt deleted file mode 100644 index 06686423af1e..000000000000 --- a/ext/oci8/tests/bind_sqltchr_1.phpt +++ /dev/null @@ -1,229 +0,0 @@ ---TEST-- -Bind with SQLT_CHR ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -TEST241 bind SQLT_CHR -array(1) { - ["VARCHAR2_T10"]=> - array(1) { - [0]=> - string(7) "Hood241" - } -} - -TEST242 insert numbers SQLT_CHR -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(2) "42" - } -} - -TEST243 insert numbers, SQLT_CHR -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(5) "42.69" - } -} - -TEST244 insert numbers with SQLT_CHR -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(1) "0" - } -} - -TEST245 insert numbers with SQLT_CHR -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(3) "-23" - } -} - -TEST246 insert numbers -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(3) "-23" - } -} - -TEST247 insert numbers with SQLT_CHR -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(2) "23" - } -} - -TEST248 insert numbers with SQLT_CHR -array(1) { - ["NUMBER_T92"]=> - array(1) { - [0]=> - string(6) "123.56" - } -} - -TEST249 insert numbers with SQLT_CHR -array(1) { - ["NUMBER_T92"]=> - array(1) { - [0]=> - string(6) "123.56" - } -} - -TEST250 insert numbers with SQLT_CHR -array(1) { - ["NUMBER_T92"]=> - array(1) { - [0]=> - NULL - } -} diff --git a/ext/oci8/tests/bind_sqltchr_2.phpt b/ext/oci8/tests/bind_sqltchr_2.phpt deleted file mode 100644 index 463f6ad0e0c1..000000000000 --- a/ext/oci8/tests/bind_sqltchr_2.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -PL/SQL bind with SQLT_CHR ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 - PL/SQL IN and OUT variables -string(22) "Cat got your keyboard?" -string(22) "CAT GOT YOUR KEYBOARD?" diff --git a/ext/oci8/tests/bind_sqltint.phpt b/ext/oci8/tests/bind_sqltint.phpt deleted file mode 100644 index 4b5a7d76abdd..000000000000 --- a/ext/oci8/tests/bind_sqltint.phpt +++ /dev/null @@ -1,337 +0,0 @@ ---TEST-- -Bind with SQLT_INT ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -TEST141 wrong bind type SQLT_INT -array(1) { - ["VARCHAR2_T10"]=> - array(1) { - [0]=> - string(1) "0" - } -} - -TEST142 insert numbers SQLT_INT -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(2) "42" - } -} - -TEST143 insert numbers, SQLT_INT -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(2) "42" - } -} - -TEST144 insert numbers with SQLT_INT -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(1) "0" - } -} - -TEST145 insert numbers with SQLT_INT -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(3) "-23" - } -} - -TEST146 insert numbers -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(3) "-23" - } -} - -TEST147 insert numbers with SQLT_INT -array(1) { - ["NUMBER_T"]=> - array(1) { - [0]=> - string(2) "23" - } -} - -TEST148 insert numbers with SQLT_INT -array(1) { - ["NUMBER_T92"]=> - array(1) { - [0]=> - string(3) "123" - } -} - -TEST149 insert numbers with SQLT_INT -array(1) { - ["NUMBER_T92"]=> - array(1) { - [0]=> - string(3) "123" - } -} - -TEST150 insert numbers with SQLT_INT -array(1) { - ["NUMBER_T92"]=> - array(1) { - [0]=> - string(1) "0" - } -} - -TEST151 - 159 Initialization tests -NULL - -TEST152 -NULL - -TEST153 -NULL - -TEST154 -NULL - -TEST155 -NULL - -TEST156 -NULL - -TEST157 -int(3333) - -TEST158 -int(4444) - -TEST159 -int(5555) diff --git a/ext/oci8/tests/bind_sqltnum.phpt b/ext/oci8/tests/bind_sqltnum.phpt deleted file mode 100644 index bdd3b5cabf18..000000000000 --- a/ext/oci8/tests/bind_sqltnum.phpt +++ /dev/null @@ -1,278 +0,0 @@ ---TEST-- -Bind with SQLT_NUM ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 - baseline test -array(2) { - ["ID"]=> - array(1) { - [0]=> - string(3) "100" - } - ["VARCHAR2_T10"]=> - array(1) { - [0]=> - string(4) "Hood" - } -} -Test 2 - SQLT_NUM to a VARCHAR2 column - -Warning: oci_execute(): ORA-12899: %s (%s: 40, %s: 10) in %sbind_sqltnum.php on line %d -string(%d) "ORA-12899: %s" - -TEST41 wrong bind type SQLT_NUM - -Warning: oci_execute(): ORA-12899: %s "%s"."BIND_SQLTNUM_TAB"."VARCHAR2_T10" (%s: 40, %s: 10) in %sbind_sqltnum.php on line %d - -TEST42 insert numbers SQLT_NUM -array(1) { - ["DUMP(NUMBER_T)"]=> - array(1) { - [0]=> - string(29) "Typ=2 Len=8: 42,0,0,0,0,0,0,0" - } -} - -TEST43 insert numbers SQLT_NUM -array(1) { - ["DUMP(NUMBER_T)"]=> - array(1) { - [0]=> - string(29) "Typ=2 Len=8: 42,0,0,0,0,0,0,0" - } -} - -TEST44 -array(1) { - ["DUMP(NUMBER_T)"]=> - array(1) { - [0]=> - string(28) "Typ=2 Len=8: 0,0,0,0,0,0,0,0" - } -} - -TEST45 -array(1) { - ["DUMP(NUMBER_T)"]=> - array(1) { - [0]=> - string(44) "Typ=2 Len=8: 233,255,255,255,255,255,255,255" - } -} - -TEST46 insert numbers -array(1) { - ["DUMP(NUMBER_T)"]=> - array(1) { - [0]=> - string(44) "Typ=2 Len=8: 233,255,255,255,255,255,255,255" - } -} - -TEST47 -array(1) { - ["DUMP(NUMBER_T)"]=> - array(1) { - [0]=> - string(29) "Typ=2 Len=8: 23,0,0,0,0,0,0,0" - } -} - -TEST48 -array(1) { - ["DUMP(NUMBER_T92)"]=> - array(1) { - [0]=> - string(16) "Typ=2 Len=1: 128" - } -} - -TEST49 -array(1) { - ["DUMP(NUMBER_T92)"]=> - array(1) { - [0]=> - string(16) "Typ=2 Len=1: 128" - } -} - -TEST50 - -Warning: oci_execute(): ORA-01438: %s in %sbind_sqltnum.php on line %d -array(1) { - ["DUMP(NUMBER_T92)"]=> - array(0) { - } -} diff --git a/ext/oci8/tests/bind_unsupported_1.phpt b/ext/oci8/tests/bind_unsupported_1.phpt deleted file mode 100644 index a719aab62c70..000000000000 --- a/ext/oci8/tests/bind_unsupported_1.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Bind with various unsupported bind types ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - SQLT_AVC, - "SQLT_STR" => SQLT_STR, - "SQLT_VCS" => SQLT_VCS, - "SQLT_AVC" => SQLT_AVC, - "SQLT_STR" => SQLT_STR, - "SQLT_LVC" => SQLT_LVC, - "SQLT_FLT" => SQLT_FLT, - "SQLT_UIN" => SQLT_UIN, - "SQLT_ODT" => SQLT_ODT, -); - -foreach ($types as $t => $v) { - - echo "Test - $t\n"; - - $s = oci_parse($c, "select * from dual where dummy = :c1"); - $c1 = "Doug"; - oci_bind_by_name($s, ":c1", $c1, -1, $v); -} - -?> ---EXPECTF-- -Test - SQLT_AVC - -Warning: oci_bind_by_name(): Unknown or unsupported datatype given: 97 in %sbind_unsupported_1.php on line %d -Test - SQLT_STR - -Warning: oci_bind_by_name(): Unknown or unsupported datatype given: 5 in %sbind_unsupported_1.php on line %d -Test - SQLT_VCS - -Warning: oci_bind_by_name(): Unknown or unsupported datatype given: 9 in %sbind_unsupported_1.php on line %d -Test - SQLT_LVC - -Warning: oci_bind_by_name(): Unknown or unsupported datatype given: 94 in %sbind_unsupported_1.php on line %d -Test - SQLT_FLT - -Warning: oci_bind_by_name(): Unknown or unsupported datatype given: 4 in %sbind_unsupported_1.php on line %d -Test - SQLT_UIN - -Warning: oci_bind_by_name(): Unknown or unsupported datatype given: 68 in %sbind_unsupported_1.php on line %d -Test - SQLT_ODT - -Warning: oci_bind_by_name(): Unknown or unsupported datatype given: 156 in %sbind_unsupported_1.php on line %d diff --git a/ext/oci8/tests/bind_unsupported_2.phpt b/ext/oci8/tests/bind_unsupported_2.phpt deleted file mode 100644 index f2fc2c722658..000000000000 --- a/ext/oci8/tests/bind_unsupported_2.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bind with various unsupported 10g+ bind types ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - SQLT_BDOUBLE, - "SQLT_BFLOAT" => SQLT_BFLOAT, -); - -foreach ($types as $t => $v) { - - echo "Test - $t\n"; - - $s = oci_parse($c, "select * from dual where dummy = :c1"); - $c1 = "Doug"; - oci_bind_by_name($s, ":c1", $c1, -1, $v); -} - -?> ---EXPECTF-- -Test - SQLT_BDOUBLE - -Warning: oci_bind_by_name(): Unknown or unsupported datatype given: 22 in %sbind_unsupported_2.php on line %d -Test - SQLT_BFLOAT - -Warning: oci_bind_by_name(): Unknown or unsupported datatype given: 21 in %sbind_unsupported_2.php on line %d diff --git a/ext/oci8/tests/bind_unsupported_3.phpt b/ext/oci8/tests/bind_unsupported_3.phpt deleted file mode 100644 index 21a181ef48c4..000000000000 --- a/ext/oci8/tests/bind_unsupported_3.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Bind with various bind types not supported by TimesTen ---EXTENSIONS-- -oci8 ---SKIPIF-- - false, 'timesten' => true); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - SQLT_CLOB, - "SQLT_BLOB" => SQLT_BLOB, - "OCI_B_CLOB" => OCI_B_CLOB, - "OCI_B_BLOB" => OCI_B_BLOB, -); - -foreach ($types as $t => $v) { - - echo "Test - $t\n"; - - $s = oci_parse($c, "select * from dual where dummy = :c1"); - $c1 = "Doug"; - oci_bind_by_name($s, ":c1", $c1, -1, $v); -} - -?> ---EXPECTF-- -Test - SQLT_CLOB - -Warning: oci_bind_by_name(): Unable to find descriptor property in %sbind_unsupported_3.php on line %d -Test - SQLT_BLOB - -Warning: oci_bind_by_name(): Unable to find descriptor property in %sbind_unsupported_3.php on line %d -Test - OCI_B_CLOB - -Warning: oci_bind_by_name(): Unable to find descriptor property in %sbind_unsupported_3.php on line %d -Test - OCI_B_BLOB - -Warning: oci_bind_by_name(): Unable to find descriptor property in %sbind_unsupported_3.php on line %d diff --git a/ext/oci8/tests/bug26133.phpt b/ext/oci8/tests/bug26133.phpt deleted file mode 100644 index ce74a41680b7..000000000000 --- a/ext/oci8/tests/bug26133.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #26133 (ocifreedesc() segfault) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- -free(); - -// Cleanup - -$stmtarray = array( - "drop table bug26133_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -echo "Done\n"; -?> ---EXPECT-- -Done diff --git a/ext/oci8/tests/bug27303_1.phpt b/ext/oci8/tests/bug27303_1.phpt deleted file mode 100644 index 2324cb7b7637..000000000000 --- a/ext/oci8/tests/bug27303_1.phpt +++ /dev/null @@ -1,258 +0,0 @@ ---TEST-- -Bug #27303 (OCIBindByName binds numeric PHP values as characters) ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12)) { - die("skip expected output only valid when using Oracle 12c database"); -} -?> ---ENV-- -NLS_LANG= ---FILE-- - ---EXPECT-- -string(1) "1" -string(1) "2" -string(1) "3" -string(1) "4" -string(1) "5" -string(1) "6" -string(1) "7" -string(1) "8" -string(1) "9" -string(2) "10" -string(2) "11" -string(2) "12" -string(2) "13" -string(2) "14" -string(2) "15" -string(2) "16" -string(2) "17" -string(2) "18" -string(2) "19" -string(2) "20" -string(2) "21" -string(2) "22" -string(2) "23" -string(2) "24" -string(2) "25" -string(2) "26" -string(2) "27" -string(2) "28" -string(2) "29" -string(2) "30" -string(2) "31" -string(2) "32" -string(2) "33" -string(2) "34" -string(2) "35" -string(2) "36" -string(2) "37" -string(2) "38" -string(2) "39" -string(2) "40" -string(2) "41" -string(2) "42" -string(2) "43" -string(2) "44" -string(2) "45" -string(2) "46" -string(2) "47" -string(2) "48" -string(2) "49" -string(2) "50" -string(2) "51" -string(2) "52" -string(2) "53" -string(2) "54" -string(2) "55" -string(2) "56" -string(2) "57" -string(2) "58" -string(2) "59" -string(2) "60" -string(2) "61" -string(2) "62" -string(2) "63" -string(2) "64" -string(2) "65" -string(2) "66" -string(2) "67" -string(2) "68" -string(2) "69" -string(2) "70" -string(2) "71" -string(2) "72" -string(2) "73" -string(2) "74" -string(2) "75" -string(2) "76" -string(2) "77" -string(2) "78" -string(2) "79" -string(2) "80" -string(2) "81" -string(2) "82" -string(2) "83" -string(2) "84" -string(2) "85" -string(2) "86" -string(2) "87" -string(2) "88" -string(2) "89" -string(2) "90" -string(2) "91" -string(2) "92" -string(2) "93" -string(2) "94" -string(2) "95" -string(2) "96" -string(2) "97" -string(2) "98" -string(2) "99" -string(3) "100" -string(3) "101" -string(3) "102" -string(3) "103" -string(3) "104" -string(3) "105" -string(3) "106" -string(3) "107" -string(3) "108" -string(3) "109" -string(3) "110" -string(3) "111" -string(3) "112" -string(3) "113" -string(3) "114" -string(3) "115" -string(3) "116" -string(3) "117" -string(3) "118" -string(3) "119" -string(3) "120" -string(3) "121" -string(3) "122" -string(3) "123" -string(3) "124" -string(3) "125" -string(3) "126" -string(3) "127" -string(3) "128" -string(3) "129" -string(3) "130" -string(3) "131" -string(3) "132" -string(3) "133" -string(3) "134" -string(3) "135" -string(3) "136" -string(3) "137" -string(3) "138" -string(3) "139" -string(3) "140" -string(3) "141" -string(3) "142" -string(3) "143" -string(3) "144" -string(3) "145" -string(3) "146" -string(3) "147" -string(3) "148" -string(3) "149" -string(3) "150" -string(3) "151" -string(3) "152" -string(3) "153" -string(3) "154" -string(3) "155" -string(3) "156" -string(3) "157" -string(3) "158" -string(3) "159" -string(3) "160" -string(3) "161" -string(3) "162" -string(3) "163" -string(3) "164" -string(3) "165" -string(3) "166" -string(3) "167" -string(3) "168" -string(3) "169" -string(3) "170" -string(3) "171" -string(3) "172" -string(3) "173" -string(3) "174" -string(3) "175" -string(3) "176" -string(3) "177" -string(3) "178" -string(3) "179" -string(3) "180" -string(3) "181" -string(3) "182" -string(3) "183" -string(3) "184" -string(3) "185" -string(3) "186" -string(3) "187" -string(3) "188" -string(3) "189" -string(3) "190" -string(3) "191" -string(3) "192" -string(3) "193" -string(3) "194" -string(3) "195" -string(3) "196" -string(3) "197" -string(3) "198" -string(3) "199" -Done diff --git a/ext/oci8/tests/bug27303_2.phpt b/ext/oci8/tests/bug27303_2.phpt deleted file mode 100644 index 5a81fd35f5ca..000000000000 --- a/ext/oci8/tests/bug27303_2.phpt +++ /dev/null @@ -1,260 +0,0 @@ ---TEST-- -Bug #27303 (OCIBindByName binds numeric PHP values as characters) ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12)) { - die("skip expected output only valid when using Oracle 12c database"); -} -?> ---ENV-- -NLS_LANG= ---FILE-- - ---EXPECT-- -string(1) "1" -string(1) "2" -string(1) "3" -string(1) "4" -string(1) "5" -string(1) "6" -string(1) "7" -string(1) "8" -string(1) "9" -string(2) "10" -string(2) "11" -string(2) "12" -string(2) "13" -string(2) "14" -string(2) "15" -string(2) "16" -string(2) "17" -string(2) "18" -string(2) "19" -string(2) "20" -string(2) "21" -string(2) "22" -string(2) "23" -string(2) "24" -string(2) "25" -string(2) "26" -string(2) "27" -string(2) "28" -string(2) "29" -string(2) "30" -string(2) "31" -string(2) "32" -string(2) "33" -string(2) "34" -string(2) "35" -string(2) "36" -string(2) "37" -string(2) "38" -string(2) "39" -string(2) "40" -string(2) "41" -string(2) "42" -string(2) "43" -string(2) "44" -string(2) "45" -string(2) "46" -string(2) "47" -string(2) "48" -string(2) "49" -string(2) "50" -string(2) "51" -string(2) "52" -string(2) "53" -string(2) "54" -string(2) "55" -string(2) "56" -string(2) "57" -string(2) "58" -string(2) "59" -string(2) "60" -string(2) "61" -string(2) "62" -string(2) "63" -string(2) "64" -string(2) "65" -string(2) "66" -string(2) "67" -string(2) "68" -string(2) "69" -string(2) "70" -string(2) "71" -string(2) "72" -string(2) "73" -string(2) "74" -string(2) "75" -string(2) "76" -string(2) "77" -string(2) "78" -string(2) "79" -string(2) "80" -string(2) "81" -string(2) "82" -string(2) "83" -string(2) "84" -string(2) "85" -string(2) "86" -string(2) "87" -string(2) "88" -string(2) "89" -string(2) "90" -string(2) "91" -string(2) "92" -string(2) "93" -string(2) "94" -string(2) "95" -string(2) "96" -string(2) "97" -string(2) "98" -string(2) "99" -string(3) "100" -string(3) "101" -string(3) "102" -string(3) "103" -string(3) "104" -string(3) "105" -string(3) "106" -string(3) "107" -string(3) "108" -string(3) "109" -string(3) "110" -string(3) "111" -string(3) "112" -string(3) "113" -string(3) "114" -string(3) "115" -string(3) "116" -string(3) "117" -string(3) "118" -string(3) "119" -string(3) "120" -string(3) "121" -string(3) "122" -string(3) "123" -string(3) "124" -string(3) "125" -string(3) "126" -string(3) "127" -string(3) "128" -string(3) "129" -string(3) "130" -string(3) "131" -string(3) "132" -string(3) "133" -string(3) "134" -string(3) "135" -string(3) "136" -string(3) "137" -string(3) "138" -string(3) "139" -string(3) "140" -string(3) "141" -string(3) "142" -string(3) "143" -string(3) "144" -string(3) "145" -string(3) "146" -string(3) "147" -string(3) "148" -string(3) "149" -string(3) "150" -string(3) "151" -string(3) "152" -string(3) "153" -string(3) "154" -string(3) "155" -string(3) "156" -string(3) "157" -string(3) "158" -string(3) "159" -string(3) "160" -string(3) "161" -string(3) "162" -string(3) "163" -string(3) "164" -string(3) "165" -string(3) "166" -string(3) "167" -string(3) "168" -string(3) "169" -string(3) "170" -string(3) "171" -string(3) "172" -string(3) "173" -string(3) "174" -string(3) "175" -string(3) "176" -string(3) "177" -string(3) "178" -string(3) "179" -string(3) "180" -string(3) "181" -string(3) "182" -string(3) "183" -string(3) "184" -string(3) "185" -string(3) "186" -string(3) "187" -string(3) "188" -string(3) "189" -string(3) "190" -string(3) "191" -string(3) "192" -string(3) "193" -string(3) "194" -string(3) "195" -string(3) "196" -string(3) "197" -string(3) "198" -string(3) "199" -Done diff --git a/ext/oci8/tests/bug27303_3.phpt b/ext/oci8/tests/bug27303_3.phpt deleted file mode 100644 index 4454c95810a8..000000000000 --- a/ext/oci8/tests/bug27303_3.phpt +++ /dev/null @@ -1,256 +0,0 @@ ---TEST-- -Bug #27303 (OCIBindByName binds numeric PHP values as characters) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(1) -int(2) -int(3) -int(4) -int(5) -int(6) -int(7) -int(8) -int(9) -int(10) -int(11) -int(12) -int(13) -int(14) -int(15) -int(16) -int(17) -int(18) -int(19) -int(20) -int(21) -int(22) -int(23) -int(24) -int(25) -int(26) -int(27) -int(28) -int(29) -int(30) -int(31) -int(32) -int(33) -int(34) -int(35) -int(36) -int(37) -int(38) -int(39) -int(40) -int(41) -int(42) -int(43) -int(44) -int(45) -int(46) -int(47) -int(48) -int(49) -int(50) -int(51) -int(52) -int(53) -int(54) -int(55) -int(56) -int(57) -int(58) -int(59) -int(60) -int(61) -int(62) -int(63) -int(64) -int(65) -int(66) -int(67) -int(68) -int(69) -int(70) -int(71) -int(72) -int(73) -int(74) -int(75) -int(76) -int(77) -int(78) -int(79) -int(80) -int(81) -int(82) -int(83) -int(84) -int(85) -int(86) -int(87) -int(88) -int(89) -int(90) -int(91) -int(92) -int(93) -int(94) -int(95) -int(96) -int(97) -int(98) -int(99) -int(100) -int(101) -int(102) -int(103) -int(104) -int(105) -int(106) -int(107) -int(108) -int(109) -int(110) -int(111) -int(112) -int(113) -int(114) -int(115) -int(116) -int(117) -int(118) -int(119) -int(120) -int(121) -int(122) -int(123) -int(124) -int(125) -int(126) -int(127) -int(128) -int(129) -int(130) -int(131) -int(132) -int(133) -int(134) -int(135) -int(136) -int(137) -int(138) -int(139) -int(140) -int(141) -int(142) -int(143) -int(144) -int(145) -int(146) -int(147) -int(148) -int(149) -int(150) -int(151) -int(152) -int(153) -int(154) -int(155) -int(156) -int(157) -int(158) -int(159) -int(160) -int(161) -int(162) -int(163) -int(164) -int(165) -int(166) -int(167) -int(168) -int(169) -int(170) -int(171) -int(172) -int(173) -int(174) -int(175) -int(176) -int(177) -int(178) -int(179) -int(180) -int(181) -int(182) -int(183) -int(184) -int(185) -int(186) -int(187) -int(188) -int(189) -int(190) -int(191) -int(192) -int(193) -int(194) -int(195) -int(196) -int(197) -int(198) -int(199) -Done diff --git a/ext/oci8/tests/bug27303_4.phpt b/ext/oci8/tests/bug27303_4.phpt deleted file mode 100644 index 4695cb2c4264..000000000000 --- a/ext/oci8/tests/bug27303_4.phpt +++ /dev/null @@ -1,256 +0,0 @@ ---TEST-- -Bug #27303 (OCIBindByName binds numeric PHP values as characters) ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12)) { - die("skip expected output only valid when using Oracle 12c database"); -} -?> ---ENV-- -NLS_LANG= ---FILE-- - ---EXPECT-- -string(1) "1" -string(1) "2" -string(1) "3" -string(1) "4" -string(1) "5" -string(1) "6" -string(1) "7" -string(1) "8" -string(1) "9" -string(2) "10" -string(2) "11" -string(2) "12" -string(2) "13" -string(2) "14" -string(2) "15" -string(2) "16" -string(2) "17" -string(2) "18" -string(2) "19" -string(2) "20" -string(2) "21" -string(2) "22" -string(2) "23" -string(2) "24" -string(2) "25" -string(2) "26" -string(2) "27" -string(2) "28" -string(2) "29" -string(2) "30" -string(2) "31" -string(2) "32" -string(2) "33" -string(2) "34" -string(2) "35" -string(2) "36" -string(2) "37" -string(2) "38" -string(2) "39" -string(2) "40" -string(2) "41" -string(2) "42" -string(2) "43" -string(2) "44" -string(2) "45" -string(2) "46" -string(2) "47" -string(2) "48" -string(2) "49" -string(2) "50" -string(2) "51" -string(2) "52" -string(2) "53" -string(2) "54" -string(2) "55" -string(2) "56" -string(2) "57" -string(2) "58" -string(2) "59" -string(2) "60" -string(2) "61" -string(2) "62" -string(2) "63" -string(2) "64" -string(2) "65" -string(2) "66" -string(2) "67" -string(2) "68" -string(2) "69" -string(2) "70" -string(2) "71" -string(2) "72" -string(2) "73" -string(2) "74" -string(2) "75" -string(2) "76" -string(2) "77" -string(2) "78" -string(2) "79" -string(2) "80" -string(2) "81" -string(2) "82" -string(2) "83" -string(2) "84" -string(2) "85" -string(2) "86" -string(2) "87" -string(2) "88" -string(2) "89" -string(2) "90" -string(2) "91" -string(2) "92" -string(2) "93" -string(2) "94" -string(2) "95" -string(2) "96" -string(2) "97" -string(2) "98" -string(2) "99" -string(3) "100" -string(3) "101" -string(3) "102" -string(3) "103" -string(3) "104" -string(3) "105" -string(3) "106" -string(3) "107" -string(3) "108" -string(3) "109" -string(3) "110" -string(3) "111" -string(3) "112" -string(3) "113" -string(3) "114" -string(3) "115" -string(3) "116" -string(3) "117" -string(3) "118" -string(3) "119" -string(3) "120" -string(3) "121" -string(3) "122" -string(3) "123" -string(3) "124" -string(3) "125" -string(3) "126" -string(3) "127" -string(3) "128" -string(3) "129" -string(3) "130" -string(3) "131" -string(3) "132" -string(3) "133" -string(3) "134" -string(3) "135" -string(3) "136" -string(3) "137" -string(3) "138" -string(3) "139" -string(3) "140" -string(3) "141" -string(3) "142" -string(3) "143" -string(3) "144" -string(3) "145" -string(3) "146" -string(3) "147" -string(3) "148" -string(3) "149" -string(3) "150" -string(3) "151" -string(3) "152" -string(3) "153" -string(3) "154" -string(3) "155" -string(3) "156" -string(3) "157" -string(3) "158" -string(3) "159" -string(3) "160" -string(3) "161" -string(3) "162" -string(3) "163" -string(3) "164" -string(3) "165" -string(3) "166" -string(3) "167" -string(3) "168" -string(3) "169" -string(3) "170" -string(3) "171" -string(3) "172" -string(3) "173" -string(3) "174" -string(3) "175" -string(3) "176" -string(3) "177" -string(3) "178" -string(3) "179" -string(3) "180" -string(3) "181" -string(3) "182" -string(3) "183" -string(3) "184" -string(3) "185" -string(3) "186" -string(3) "187" -string(3) "188" -string(3) "189" -string(3) "190" -string(3) "191" -string(3) "192" -string(3) "193" -string(3) "194" -string(3) "195" -string(3) "196" -string(3) "197" -string(3) "198" -string(3) "199" -Done diff --git a/ext/oci8/tests/bug32325.phpt b/ext/oci8/tests/bug32325.phpt deleted file mode 100644 index 31f298ef6296..000000000000 --- a/ext/oci8/tests/bug32325.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Bug #32325 (Cannot retrieve collection using OCI8) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -size()); -var_dump($collection->getelem(1)); -var_dump($collection->getelem(2)); - -// Cleanup - -$stmtarray = array( - "drop type bug32325_t" -); - -oci8_test_sql_execute($c, $stmtarray); - -echo "Done\n"; -?> ---EXPECT-- -int(4) -float(2) -float(3) -Done diff --git a/ext/oci8/tests/bug35973.phpt b/ext/oci8/tests/bug35973.phpt deleted file mode 100644 index 2cd4db5fb3ec..000000000000 --- a/ext/oci8/tests/bug35973.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Bug #35973 (Error ORA-24806 occurs when trying to fetch a NCLOB field) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -read(5)); -var_dump($d->read(4)); - -$s1 = oci_parse($c, "drop table test_nclob"); -@oci_execute($s1); - -echo "Done\n"; -?> ---EXPECTF-- -array(1) { - ["NC"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(%d) "%s5" -string(%d) "%sa" -Done diff --git a/ext/oci8/tests/bug36010.phpt b/ext/oci8/tests/bug36010.phpt deleted file mode 100644 index ad1a4f42a797..000000000000 --- a/ext/oci8/tests/bug36010.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #36010 (Crash when executing SQL statement with lob parameter twice) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -Done diff --git a/ext/oci8/tests/bug36096.phpt b/ext/oci8/tests/bug36096.phpt deleted file mode 100644 index 713751713fbe..000000000000 --- a/ext/oci8/tests/bug36096.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #36096 (oci_result() returns garbage after oci_fetch() failed) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- -1"; -$stmt = oci_parse($c, $sql); - -if(oci_execute($stmt, OCI_COMMIT_ON_SUCCESS)){ - var_dump(oci_fetch($stmt)); - var_dump(oci_result($stmt, 1)); - var_dump(oci_field_name($stmt, 1)); - var_dump(oci_field_type($stmt, 1)); -} - -echo "Done\n"; - -?> ---EXPECTF-- -bool(false) -bool(false) -string(%r[53]%r) "%r('ABC'|EXP)%r" -string(4) "CHAR" -Done diff --git a/ext/oci8/tests/bug36403.phpt b/ext/oci8/tests/bug36403.phpt deleted file mode 100644 index b8bcba661e26..000000000000 --- a/ext/oci8/tests/bug36403.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Bug #36403 (oci_execute no longer supports OCI_DESCRIBE_ONLY) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - 0; $i--) { - echo oci_field_name($s, $i) . "\n"; -} - -echo "Test 2\n"; - -// Should generate an error: ORA-24338: statement handle not executed -// since the statement handle was only described and not executed -$row = oci_fetch_array($s); - -// Clean up - -$stmtarray = array( - "drop table bug36403_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -Test 1 -COL4 -COLUMN3 -COL2 -C1 -Test 2 - -Warning: oci_fetch_array(): ORA-%r(24338|01002)%r: %sbug36403.php on line %d diff --git a/ext/oci8/tests/bug37220.phpt b/ext/oci8/tests/bug37220.phpt deleted file mode 100644 index f73a4110d0fb..000000000000 --- a/ext/oci8/tests/bug37220.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Bug #37220 (LOB Type mismatch when using windows & oci8.dll) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -'))" -); - -oci8_test_sql_execute($c, $stmtarray); - -// Now let's update the row where myId = 1234 and change the tag -// 'THETAG' to 'MYTAG' (mycolumn is an XMLTYPE datatype and -// bug37220_tab a normal Oracle table) - -$query = "UPDATE bug37220_tab - SET bug37220_tab.mycolumn = updateXML(bug37220_tab.mycolumn,'/THETAG',xmltype.createXML(:data)) - WHERE existsNode(bug37220_tab.mycolumn,'/THETAG[@myID=\"1234\"]') = 1"; -$stmt = oci_parse ($c, $query); -$clob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($stmt, ':data', $clob, -1, OCI_B_CLOB); -$clob->writeTemporary("", OCI_TEMP_CLOB); -$success = oci_execute($stmt, OCI_COMMIT_ON_SUCCESS); -oci_free_statement($stmt); -$clob->close(); - -// Query back the change - -$query = "select * from bug37220_tab"; -$stmt = oci_parse ($c, $query); - -oci_execute($stmt); - -while ($row = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_NULLS)) { - foreach ($row as $item) { - echo trim($item)."\n"; - } - echo "\n"; -} - -// Cleanup - -$stmtarray = array( - "drop table bug37220_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -echo "Done\n"; - -?> ---EXPECT-- - - -Done diff --git a/ext/oci8/tests/bug37581.phpt b/ext/oci8/tests/bug37581.phpt deleted file mode 100644 index 47e2befd01f0..000000000000 --- a/ext/oci8/tests/bug37581.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -Bug #37581 (oci_bind_array_by_name clobbers input array when using SQLT_AFC, AVC) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - [2]=> - string(1) "C" - [3]=> - string(1) "D" - [4]=> - string(1) "E" -} -array(5) { - [0]=> - string(1) "A" - [1]=> - string(1) "B" - [2]=> - string(1) "C" - [3]=> - string(1) "D" - [4]=> - string(1) "E" -} -Done diff --git a/ext/oci8/tests/bug38161.phpt b/ext/oci8/tests/bug38161.phpt deleted file mode 100644 index 3b08f2be3bba..000000000000 --- a/ext/oci8/tests/bug38161.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #38161 (oci_bind_by_name() returns garbage when Oracle didn't set the variable) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -NULL -int(0) -Done diff --git a/ext/oci8/tests/bug38173.phpt b/ext/oci8/tests/bug38173.phpt deleted file mode 100644 index bf5434a8e4cc..000000000000 --- a/ext/oci8/tests/bug38173.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Bug #38173 (Freeing nested cursors causes OCI8 to segfault) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -Got row! -bool(true) -bool(true) -Got row! -bool(true) -bool(true) -Got row! -bool(true) -bool(true) -Got row! -bool(true) -bool(true) -Got row! -bool(true) -bool(true) -Done diff --git a/ext/oci8/tests/bug40078.phpt b/ext/oci8/tests/bug40078.phpt deleted file mode 100644 index 4c9277b6fd48..000000000000 --- a/ext/oci8/tests/bug40078.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Bug #40078 (ORA-01405 when fetching NULL values using oci_bind_array_by_name()) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - string(3) "one" - [1]=> - string(3) "two" - [2]=> - string(0) "" - [3]=> - string(4) "four" - [4]=> - string(4) "five" -} -Done diff --git a/ext/oci8/tests/bug40415.phpt b/ext/oci8/tests/bug40415.phpt deleted file mode 100644 index c0931e5b4b26..000000000000 --- a/ext/oci8/tests/bug40415.phpt +++ /dev/null @@ -1,206 +0,0 @@ ---TEST-- -Bug #40415 (Using oci_fetchall with nested cursors) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Test 1: Associate fetch of nested cursor -Got row "11". Now getting nested cursor: -bool(true) -array(1) { - ["ID2"]=> - string(2) "21" -} -array(1) { - ["ID2"]=> - string(2) "22" -} -array(1) { - ["ID2"]=> - string(2) "23" -} -Got row "12". Now getting nested cursor: -bool(true) -array(1) { - ["ID2"]=> - string(2) "21" -} -array(1) { - ["ID2"]=> - string(2) "22" -} -array(1) { - ["ID2"]=> - string(2) "23" -} -Got row "13". Now getting nested cursor: -bool(true) -array(1) { - ["ID2"]=> - string(2) "21" -} -array(1) { - ["ID2"]=> - string(2) "22" -} -array(1) { - ["ID2"]=> - string(2) "23" -} - -Test 2: fetchall of nested cursor -Rows returned 3 -array(2) { - ["ID1"]=> - array(3) { - [0]=> - string(2) "11" - [1]=> - string(2) "12" - [2]=> - string(2) "13" - } - ["CURSOR"]=> - array(3) { - [0]=> - resource(%d) of type (oci8 statement) - [1]=> - resource(%d) of type (oci8 statement) - [2]=> - resource(%d) of type (oci8 statement) - } -} -Getting nested cursor -bool(true) -array(1) { - ["ID2"]=> - array(3) { - [0]=> - string(2) "21" - [1]=> - string(2) "22" - [2]=> - string(2) "23" - } -} -Getting nested cursor -bool(true) -array(1) { - ["ID2"]=> - array(3) { - [0]=> - string(2) "21" - [1]=> - string(2) "22" - [2]=> - string(2) "23" - } -} -Getting nested cursor -bool(true) -array(1) { - ["ID2"]=> - array(3) { - [0]=> - string(2) "21" - [1]=> - string(2) "22" - [2]=> - string(2) "23" - } -} -Done diff --git a/ext/oci8/tests/bug41069.phpt b/ext/oci8/tests/bug41069.phpt deleted file mode 100644 index f3276db18ff1..000000000000 --- a/ext/oci8/tests/bug41069.phpt +++ /dev/null @@ -1,270 +0,0 @@ ---TEST-- -Bug #41069 (Oracle crash with certain data over a DB-link when prefetch memory limit used - Oracle bug 6039623) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (empty($dbase)) die ("skip requires network connection alias for DB link loopback"); -if ($test_drcp) die("skip DRCP does not support shared database links"); -?> ---INI-- -oci8.default_prefetch=5 ---FILE-- - ---EXPECT-- -Test 1: non-DB link case that always worked -array(3) { - [0]=> - array(13) { - ["C1"]=> - string(3) "111" - ["C2"]=> - string(7) "aaaaaaa" - ["C3"]=> - NULL - ["C4"]=> - NULL - ["C5"]=> - string(1) "b" - ["C6"]=> - string(1) "c" - ["C7"]=> - NULL - ["C8"]=> - NULL - ["C9"]=> - string(10) "01/17/2008" - ["C10"]=> - string(10) "01/07/2017" - ["C12"]=> - string(4) "2222" - ["C13"]=> - NULL - ["C15"]=> - string(10) "zzzzzzzzzz" - } - [1]=> - array(13) { - ["C1"]=> - string(3) "112" - ["C2"]=> - string(7) "aaaaaaa" - ["C3"]=> - string(8) "bbbbbbbb" - ["C4"]=> - string(7) "ccccccc" - ["C5"]=> - string(1) "d" - ["C6"]=> - string(1) "e" - ["C7"]=> - string(7) "rrrrrrr" - ["C8"]=> - NULL - ["C9"]=> - string(10) "04/16/2007" - ["C10"]=> - string(10) "04/16/2007" - ["C12"]=> - string(4) "2223" - ["C13"]=> - string(8) "xxxxxxxx" - ["C15"]=> - string(8) "zzzzzzzz" - } - [2]=> - array(13) { - ["C1"]=> - string(3) "113" - ["C2"]=> - string(7) "aaaaaaa" - ["C3"]=> - string(10) "bbbbbbbbbb" - ["C4"]=> - string(6) "cccccc" - ["C5"]=> - string(1) "e" - ["C6"]=> - string(1) "f" - ["C7"]=> - string(4) "dddd" - ["C8"]=> - NULL - ["C9"]=> - string(10) "12/04/2006" - ["C10"]=> - string(10) "12/04/2006" - ["C12"]=> - string(4) "2224" - ["C13"]=> - NULL - ["C15"]=> - string(7) "zzzzzzz" - } -} -Test 2: Should not crash -array(3) { - [0]=> - array(13) { - ["C1"]=> - string(3) "111" - ["C2"]=> - string(7) "aaaaaaa" - ["C3"]=> - NULL - ["C4"]=> - NULL - ["C5"]=> - string(1) "b" - ["C6"]=> - string(1) "c" - ["C7"]=> - NULL - ["C8"]=> - NULL - ["C9"]=> - string(10) "01/17/2008" - ["C10"]=> - string(10) "01/07/2017" - ["C12"]=> - string(4) "2222" - ["C13"]=> - NULL - ["C15"]=> - string(10) "zzzzzzzzzz" - } - [1]=> - array(13) { - ["C1"]=> - string(3) "112" - ["C2"]=> - string(7) "aaaaaaa" - ["C3"]=> - string(8) "bbbbbbbb" - ["C4"]=> - string(7) "ccccccc" - ["C5"]=> - string(1) "d" - ["C6"]=> - string(1) "e" - ["C7"]=> - string(7) "rrrrrrr" - ["C8"]=> - NULL - ["C9"]=> - string(10) "04/16/2007" - ["C10"]=> - string(10) "04/16/2007" - ["C12"]=> - string(4) "2223" - ["C13"]=> - string(8) "xxxxxxxx" - ["C15"]=> - string(8) "zzzzzzzz" - } - [2]=> - array(13) { - ["C1"]=> - string(3) "113" - ["C2"]=> - string(7) "aaaaaaa" - ["C3"]=> - string(10) "bbbbbbbbbb" - ["C4"]=> - string(6) "cccccc" - ["C5"]=> - string(1) "e" - ["C6"]=> - string(1) "f" - ["C7"]=> - string(4) "dddd" - ["C8"]=> - NULL - ["C9"]=> - string(10) "12/04/2006" - ["C10"]=> - string(10) "12/04/2006" - ["C12"]=> - string(4) "2224" - ["C13"]=> - NULL - ["C15"]=> - string(7) "zzzzzzz" - } -} -Done diff --git a/ext/oci8/tests/bug42134.phpt b/ext/oci8/tests/bug42134.phpt deleted file mode 100644 index 15917151c465..000000000000 --- a/ext/oci8/tests/bug42134.phpt +++ /dev/null @@ -1,106 +0,0 @@ ---TEST-- -Bug #42134 (Collection error for invalid collection name) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Warning: oci_new_collection(): OCI-22303: type ""."ABC" not found in %s on line %d -Normal connection: New Collection error -array(4) { - ["code"]=> - int(22303) - ["message"]=> - string(34) "OCI-22303: type ""."ABC" not found" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} - -Warning: oci_new_collection(): OCI-22303: type ""."DEF" not found in %s on line %d -New connection: New Collection error -array(4) { - ["code"]=> - int(22303) - ["message"]=> - string(34) "OCI-22303: type ""."DEF" not found" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} - -Warning: oci_new_collection(): OCI-22303: type ""."GHI" not found in %s on line %d -Persistent connection: New Collection error -array(4) { - ["code"]=> - int(22303) - ["message"]=> - string(34) "OCI-22303: type ""."GHI" not found" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -Done diff --git a/ext/oci8/tests/bug42173.phpt b/ext/oci8/tests/bug42173.phpt deleted file mode 100644 index 08b5ac17658e..000000000000 --- a/ext/oci8/tests/bug42173.phpt +++ /dev/null @@ -1,174 +0,0 @@ ---TEST-- -Bug #42173 (TIMESTAMP and INTERVAL query and field functions) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - $field) { - echo "\nColumn $name\n"; - var_dump(oci_field_is_null($s, $name)); - var_dump(oci_field_name($s, $name)); - var_dump(oci_field_type($s, $name)); - var_dump(oci_field_type_raw($s, $name)); - var_dump(oci_field_scale($s, $name)); - var_dump(oci_field_precision($s, $name)); - var_dump(oci_field_size($s, $name)); -} - -// Cleanup - -$s = oci_parse($c, "drop table ts_test"); -$r = @oci_execute($s); - -echo "Done\n"; - -?> ---EXPECTF-- -array(9) { - ["C1"]=> - string(28) "03-JAN-99 10.00.00.123000 AM" - ["C2"]=> - string(27) "04-JAN-99 10.00.00.12346 AM" - ["C3"]=> - string(35) "05-JAN-99 10.00.00.123456 AM +01:00" - ["C4"]=> - string(31) "06-JAN-99 10.00.00.12 AM -01:00" - ["C5"]=> - string(28) "%s" - ["C6"]=> - string(6) "+01-02" - ["C7"]=> - string(6) "+10-04" - ["C8"]=> - string(19) "+01 02:20:20.123000" - ["C9"]=> - string(16) "+01 02:20:20.123" -} - -Column C1 -bool(false) -string(2) "C1" -string(9) "TIMESTAMP" -int(187) -int(6) -int(0) -int(11) - -Column C2 -bool(false) -string(2) "C2" -string(9) "TIMESTAMP" -int(187) -int(5) -int(0) -int(11) - -Column C3 -bool(false) -string(2) "C3" -string(23) "TIMESTAMP WITH TIMEZONE" -int(188) -int(6) -int(0) -int(13) - -Column C4 -bool(false) -string(2) "C4" -string(23) "TIMESTAMP WITH TIMEZONE" -int(188) -int(2) -int(0) -int(13) - -Column C5 -bool(false) -string(2) "C5" -string(29) "TIMESTAMP WITH LOCAL TIMEZONE" -int(232) -int(6) -int(0) -int(11) - -Column C6 -bool(false) -string(2) "C6" -string(22) "INTERVAL YEAR TO MONTH" -int(189) -int(0) -int(2) -int(5) - -Column C7 -bool(false) -string(2) "C7" -string(22) "INTERVAL YEAR TO MONTH" -int(189) -int(0) -int(2) -int(5) - -Column C8 -bool(false) -string(2) "C8" -string(22) "INTERVAL DAY TO SECOND" -int(190) -int(6) -int(2) -int(11) - -Column C9 -bool(false) -string(2) "C9" -string(22) "INTERVAL DAY TO SECOND" -int(190) -int(3) -int(2) -int(11) -Done diff --git a/ext/oci8/tests/bug42496_1.phpt b/ext/oci8/tests/bug42496_1.phpt deleted file mode 100644 index fac0af5665b5..000000000000 --- a/ext/oci8/tests/bug42496_1.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -Bug #42496 (LOB fetch leaks cursors, eventually failing with ORA-1000 maximum open cursors reached) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -free(); - $arr['C2']->free(); - } - } - oci_free_statement($s); -} - -echo "Done\n"; - -// Cleanup - -$stmtarray = array( - "DROP table bug42496_1_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECT-- -Test 1 -Done diff --git a/ext/oci8/tests/bug42496_2.phpt b/ext/oci8/tests/bug42496_2.phpt deleted file mode 100644 index ae0ff09f6b92..000000000000 --- a/ext/oci8/tests/bug42496_2.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -Bug #42496 (LOB fetch leaks cursors, eventually failing with ORA-1000 maximum open cursors reached) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -free(); - $arr['C2']->free(); - } - } - oci_free_statement($s); -} - -echo "Done\n"; - -// Cleanup - -$stmtarray = array( - "DROP table bug42496_2_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECT-- -Test 2 -Done diff --git a/ext/oci8/tests/bug42841.phpt b/ext/oci8/tests/bug42841.phpt deleted file mode 100644 index 116fe2fd2988..000000000000 --- a/ext/oci8/tests/bug42841.phpt +++ /dev/null @@ -1,187 +0,0 @@ ---TEST-- -Bug #42841 (REF CURSOR and oci_new_cursor PHP crash) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---INI-- -oci8.statement_cache_size=20 ---FILE-- - ---EXPECT-- -Test bug 42841: Procedure with OUT cursor parameter -First attempt -array(3) { - [0]=> - array(1) { - [11]=> - string(2) "11" - } - [1]=> - array(1) { - [11]=> - string(2) "12" - } - [2]=> - array(1) { - [11]=> - string(2) "13" - } -} -Second attempt -array(3) { - [0]=> - array(1) { - [11]=> - string(2) "11" - } - [1]=> - array(1) { - [11]=> - string(2) "12" - } - [2]=> - array(1) { - [11]=> - string(2) "13" - } -} -Test bug 43449: Cursor as function result -array(1) { - [0]=> - array(1) { - ["DUMMY"]=> - string(1) "X" - } -} -array(1) { - [0]=> - array(1) { - ["DUMMY"]=> - string(1) "X" - } -} -Done diff --git a/ext/oci8/tests/bug43492.phpt b/ext/oci8/tests/bug43492.phpt deleted file mode 100644 index b411db637430..000000000000 --- a/ext/oci8/tests/bug43492.phpt +++ /dev/null @@ -1,376 +0,0 @@ ---TEST-- -Bug #43492 (Nested cursor leaks) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -Done diff --git a/ext/oci8/tests/bug43492_2.phpt b/ext/oci8/tests/bug43492_2.phpt deleted file mode 100644 index 8cfe95f7358b..000000000000 --- a/ext/oci8/tests/bug43492_2.phpt +++ /dev/null @@ -1,367 +0,0 @@ ---TEST-- -Bug #43492 (Nested cursor leaks after related bug #44206 fixed) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -A B C D E F G H I J -Done diff --git a/ext/oci8/tests/bug43497.phpt b/ext/oci8/tests/bug43497.phpt deleted file mode 100644 index 07226e8ed9c6..000000000000 --- a/ext/oci8/tests/bug43497.phpt +++ /dev/null @@ -1,301 +0,0 @@ ---TEST-- -Bug #43497 (OCI8 XML/getClobVal aka temporary LOBs leak UGA memory) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -?> ---FILE-- -free(); // cleanup properly - ++$cntchk; - } - } - echo "Loop count check = $cntchk\n"; -} - -// Read all XML data using explicit LOB locator but without freeing the temp lobs -function readxmltab_ex_nofree($c) -{ - $stmt = oci_parse($c, "select extract(xml, '/').getclobval() from bug43497_tab"); - - $cntchk = 0; - if (oci_execute($stmt)) { - while ($result = oci_fetch_array($stmt, OCI_NUM)) { - ++$cntchk; - } - } - echo "Loop count check = $cntchk\n"; -} - -// Read all XML data using implicit LOB locator -function readxmltab_im($c) -{ - $stmt = oci_parse($c, "select extract(xml, '/').getclobval() from bug43497_tab"); - - $cntchk = 0; - if (oci_execute($stmt)) { - while ($result = oci_fetch_array($stmt, OCI_NUM+OCI_RETURN_LOBS)) { - ++$cntchk; - } - } - echo "Loop count check = $cntchk\n"; -} - -function createxmltab($c) // create table w/ field of XML type -{ - @dropxmltab($c); - $stmt = oci_parse($c, "create table bug43497_tab (id number primary key, xml xmltype)"); - oci_execute($stmt); -} - -function dropxmltab($c) // delete table -{ - $stmt = oci_parse($c, "drop table bug43497_tab"); - oci_execute($stmt); -} - - -function fillxmltab($c) -{ - for ($id = 1; $id <= 100; $id++) { - - // create an XML element string with random data - $s = ""; - for ($j = 0; $j < 128; $j++) { - $s .= rand(); - } - $s .= "\n"; - for ($j = 0; $j < 4; $j++) { - $s .= $s; - } - $data = "" . $s . ""; - - // insert XML data into database - - $stmt = oci_parse($c, "insert into bug43497_tab(id, xml) values (:id, sys.xmltype.createxml(:xml))"); - oci_bind_by_name($stmt, ":id", $id); - $clob = oci_new_descriptor($c, OCI_D_LOB); - oci_bind_by_name($stmt, ":xml", $clob, -1, OCI_B_CLOB); - $clob->writeTemporary($data); - oci_execute($stmt); - - $clob->close(); - $clob->free(); - } -} - - -// Initialize - -createxmltab($c); -fillxmltab($c); - -// Run Test - -$sid = sessionid($c); - -echo "Explicit LOB use\n"; -for ($i = 1; $i <= 10; $i++) { - echo "\nRun = " . $i . "\n"; - echo "Temporary LOBs = " . templobs($c, $sid) . "\n"; - readxmltab_ex($c); -} - -echo "\nImplicit LOB use\n"; -for ($i = 1; $i <= 10; $i++) { - echo "\nRun = " . $i . "\n"; - echo "Temporary LOBs = " . templobs($c, $sid) . "\n"; - readxmltab_im($c); -} - -echo "\nExplicit LOB with no free\n"; -for ($i = 1; $i <= 10; $i++) { - echo "\nRun = " . $i . "\n"; - echo "Temporary LOBs = " . templobs($c, $sid) . "\n"; - readxmltab_ex_nofree($c); -} - - - -// Cleanup - -dropxmltab($c); - -oci_close($c); - -echo "Done\n"; -?> ---EXPECT-- -Explicit LOB use - -Run = 1 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 2 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 3 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 4 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 5 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 6 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 7 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 8 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 9 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 10 -Temporary LOBs = 0 -Loop count check = 100 - -Implicit LOB use - -Run = 1 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 2 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 3 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 4 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 5 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 6 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 7 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 8 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 9 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 10 -Temporary LOBs = 0 -Loop count check = 100 - -Explicit LOB with no free - -Run = 1 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 2 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 3 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 4 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 5 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 6 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 7 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 8 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 9 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 10 -Temporary LOBs = 0 -Loop count check = 100 -Done diff --git a/ext/oci8/tests/bug44008.phpt b/ext/oci8/tests/bug44008.phpt deleted file mode 100644 index 36ade04951c2..000000000000 --- a/ext/oci8/tests/bug44008.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Bug #44008 (Incorrect usage of OCILob->close crashes PHP) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -load(); -echo "$r\n"; - -// Incorrectly closing the lob doesn't cause a crash. -// OCI-LOB->close() is documented for use only with OCILob->writeTemporary() -$textLob->close(); - -// Cleanup - -$stmtarray = array( - "drop procedure bug44008_proc" -); - -oci8_test_sql_execute($c, $stmtarray); - -echo "Done\n"; - -?> ---EXPECT-- -A -Done diff --git a/ext/oci8/tests/bug44113.phpt b/ext/oci8/tests/bug44113.phpt deleted file mode 100644 index 88dc04b328f3..000000000000 --- a/ext/oci8/tests/bug44113.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Bug #44113 (New collection creation can fail with OCI-22303) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -?> ---FILE-- - ---EXPECT-- -Completed 70000 -Done diff --git a/ext/oci8/tests/bug44206.phpt b/ext/oci8/tests/bug44206.phpt deleted file mode 100644 index 29b702a11490..000000000000 --- a/ext/oci8/tests/bug44206.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Bug #44206 (Test if selecting ref cursors leads to ORA-1000 maximum open cursors reached) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -Completed 400 -Done diff --git a/ext/oci8/tests/bug45458.phpt b/ext/oci8/tests/bug45458.phpt deleted file mode 100644 index 3e8003b8bdf0..000000000000 --- a/ext/oci8/tests/bug45458.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Bug #45458 (OCI8: Numeric keys for associative arrays are not handled properly) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 -array(1) { - [0]=> - array(2) { - ["A"]=> - string(1) "X" - [20]=> - string(1) "X" - } -} -array(2) { - ["A"]=> - string(1) "X" - [20]=> - string(1) "X" -} -string(1) "X" -string(1) "X" -Test 2 -array(2) { - ["A"]=> - array(1) { - [0]=> - string(1) "X" - } - [20]=> - array(1) { - [0]=> - string(1) "X" - } -} -array(1) { - [0]=> - string(1) "X" -} -array(1) { - [0]=> - string(1) "X" -} -string(1) "X" -string(1) "X" diff --git a/ext/oci8/tests/bug46994.phpt b/ext/oci8/tests/bug46994.phpt deleted file mode 100644 index b12256206a18..000000000000 --- a/ext/oci8/tests/bug46994.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -Bug #46994 (CLOB size does not update when using CLOB IN OUT param in stored procedure) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -writeTemporary("some data", OCI_TEMP_CLOB); - -echo "Test 1\n"; - -$s = oci_parse($c, "begin bug46994_proc1(:myclob); end;"); -oci_bind_by_name($s, ":myclob", $myclob, -1, SQLT_CLOB); -oci_execute($s, OCI_DEFAULT); -var_dump($myclob->load()); - -echo "Test 2\n"; - -$s = oci_parse($c, "begin bug46994_proc2(:myclob); end;"); -oci_bind_by_name($s, ":myclob", $myclob, -1, SQLT_CLOB); -oci_execute($s, OCI_DEFAULT); -var_dump($myclob->load()); - -echo "Test 3\n"; - -$s = oci_parse($c, "begin bug46994_proc1(:myclob); end;"); -oci_bind_by_name($s, ":myclob", $myclob, -1, SQLT_CLOB); -oci_execute($s, OCI_DEFAULT); -var_dump($myclob->load()); - -echo "Test 4\n"; - -var_dump($myclob->load()); // Use cached size code path - -// Cleanup - -$stmtarray = array( - "drop procedure bug46994_proc1", - "drop procedure bug46994_proc2" -); - -oci8_test_sql_execute($c, $stmtarray); - -oci_close($c); - -?> ---EXPECT-- -Test 1 -string(26) "This should be the output." -Test 2 -string(37) "The output should be even longer now." -Test 3 -string(26) "This should be the output." -Test 4 -string(26) "This should be the output." diff --git a/ext/oci8/tests/bug47189.phpt b/ext/oci8/tests/bug47189.phpt deleted file mode 100644 index 6b9a75c3b5ec..000000000000 --- a/ext/oci8/tests/bug47189.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Bug #47189 (Multiple oci_fetch_all calls) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs: different error handling for this undefined behavior -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Test 1 -array(1) { - [0]=> - array(1) { - ["DUMMY"]=> - string(1) "X" - } -} -array(0) { -} -Test 2 -array(1) { - [0]=> - array(1) { - ["DUMMY"]=> - string(1) "X" - } -} - -Warning: oci_fetch_all(): ORA-01002: %s in %s on line %d -array(0) { -} diff --git a/ext/oci8/tests/bug47281.phpt b/ext/oci8/tests/bug47281.phpt deleted file mode 100644 index 5e968df8fd00..000000000000 --- a/ext/oci8/tests/bug47281.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -Bug #47281 ($php_errormsg is limited in size of characters) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -// error3.phpt obsoletes this test for newer Oracle client versions -// Assume runtime client version is >= compile time client version -preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); -if (!isset($matches[0]) || - ($matches[1] > 11 || ($matches[1] == 11 && $matches[2] > 2) || ($matches[1] == 11 && $matches[2] == 2 && $matches[4] >= 3) - )) { - die("skip test works only with Oracle 11.2.0.2 or earlier Oracle client libraries"); -} -?> ---ENV-- -NLS_LANG=.AL32UTF8 ---FILE-- - ---EXPECT-- -Test 1 -ORA-20000: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaBcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccDeeeeeeeeeeee -Test 2 -oci_execute(): ORA-20000: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaBcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccDeeeeeeeeeeee diff --git a/ext/oci8/tests/bug47281_tt.phpt b/ext/oci8/tests/bug47281_tt.phpt deleted file mode 100644 index 83c2cf867d7c..000000000000 --- a/ext/oci8/tests/bug47281_tt.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Bug #47281 ($php_errormsg is limited in size of characters) ---EXTENSIONS-- -oci8 ---SKIPIF-- - false, 'timesten' => true); // test runs on these DBs: shorter message length in TimesTen -require __DIR__.'/skipif.inc'; -?> ---ENV-- -NLS_LANG=.AL32UTF8 ---FILE-- - ---EXPECT-- -Test 1 -ORA-57000: TT8507: ORA-20000: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Test 2 -oci_execute(): ORA-57000: TT8507: ORA-20000: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/ext/oci8/tests/bug51253.phpt b/ext/oci8/tests/bug51253.phpt deleted file mode 100644 index 5ecc69c34ab8..000000000000 --- a/ext/oci8/tests/bug51253.phpt +++ /dev/null @@ -1,171 +0,0 @@ ---TEST-- -Bug #51253 (oci_bind_array_by_name() array references) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -Test 1 -array(5) { - [0]=> - string(3) "one" - [1]=> - string(3) "two" - [2]=> - string(5) "three" - [3]=> - string(4) "four" - [4]=> - string(4) "five" -} -array(5) { - [0]=> - string(4) "five" - [1]=> - string(4) "four" - [2]=> - string(5) "three" - [3]=> - string(3) "two" - [4]=> - string(3) "one" -} -Test 2 -array(5) { - [0]=> - string(3) "one" - [1]=> - string(3) "two" - [2]=> - string(5) "three" - [3]=> - string(4) "four" - [4]=> - string(4) "five" -} -array(5) { - [0]=> - string(3) "one" - [1]=> - string(3) "two" - [2]=> - string(5) "three" - [3]=> - string(4) "four" - [4]=> - string(4) "five" -} -Test 3 -array(5) { - [0]=> - string(4) "five" - [1]=> - string(4) "four" - [2]=> - string(5) "three" - [3]=> - string(3) "two" - [4]=> - string(3) "one" -} -array(5) { - [0]=> - string(4) "five" - [1]=> - string(4) "four" - [2]=> - string(5) "three" - [3]=> - string(3) "two" - [4]=> - string(3) "one" -} -Done diff --git a/ext/oci8/tests/bug51291_1.phpt b/ext/oci8/tests/bug51291_1.phpt deleted file mode 100644 index fee26b902ebc..000000000000 --- a/ext/oci8/tests/bug51291_1.phpt +++ /dev/null @@ -1,389 +0,0 @@ ---TEST-- -Bug #51291 (oci_error() doesn't report last error when called two times) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Test 1 - Parse -array(4) { - ["code"]=> - int(1756) - ["message"]=> - string(48) "ORA-01756: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -2nd call -array(4) { - ["code"]=> - int(1756) - ["message"]=> - string(48) "ORA-01756: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} - -Test 2 - Parse -bool(false) -array(4) { - ["code"]=> - int(1756) - ["message"]=> - string(48) "ORA-01756: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -2nd call -bool(false) -array(4) { - ["code"]=> - int(1756) - ["message"]=> - string(48) "ORA-01756: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} - -Test 3 - Execute -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} -2nd call -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} - -Test 4 - Execute - consecutive oci_error calls of different kinds -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} -2nd call -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} - -Test 5 - Execute - after oci_rollback -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} -Rollback status is true -2nd call after oci_rollback -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} - -Test 6 - Execute - after successful 2nd query with new handle -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} -Execute status is true -2nd call after successful execute -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} -bool(false) - -Test 7 - Execute - after successful 2nd query with same handle -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} -Execute status is true -2nd call after successful execute -bool(false) -bool(false) -bool(false) - -Test 8 - Execute - after unsuccessful 2nd query with new handle -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} - -Warning: oci_execute(): ORA-00904: %sREALLYNOTHERE%s in %sbug51291_1.php on line %d -Execute status is false -2nd call after unsuccessful execute -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904%sREALLYNOTHERE%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(30) "select reallynothere from dual" -} - -Test 9 - Execute - after unsuccessful 2nd query with same handle -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904:%sDOESNOTEXIST%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(29) "select doesnotexist from dual" -} - -Warning: oci_execute(): ORA-00904: %sREALLYNOTHERE%s in %sbug51291_1.php on line %d -Execute status is false -2nd call after unsuccessful execute -bool(false) -bool(false) -array(4) { - ["code"]=> - int(904) - ["message"]=> - string(%d) "ORA-00904%sREALLYNOTHERE%s" - ["offset"]=> - int(%d) - ["sqltext"]=> - string(30) "select reallynothere from dual" -} diff --git a/ext/oci8/tests/bug51291_2.phpt b/ext/oci8/tests/bug51291_2.phpt deleted file mode 100644 index 03c6af99cc0b..000000000000 --- a/ext/oci8/tests/bug51291_2.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Bug #51291 (oci_error() doesn't report last error when called two times) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs: different error messages from TimesTen -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Test 1 - Execute - after successful 2nd query with same statement -bool(false) -bool(false) -array(4) { - ["code"]=> - int(6510) - ["message"]=> - string(72) "ORA-06510: PL/SQL: %s -ORA-06512: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(64) "declare e exception; begin if :bv = 1 then raise e; end if; end;" -} -Execute status is true -2nd call after successful execute -bool(false) -bool(false) -bool(false) diff --git a/ext/oci8/tests/bug68298.phpt b/ext/oci8/tests/bug68298.phpt deleted file mode 100644 index b9f62ce75d99..000000000000 --- a/ext/oci8/tests/bug68298.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Bug #68298 (OCI int overflow) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(1) { - ["COL1"]=> - array(2) { - [0]=> - string(19) "1152921504606846975" - [1]=> - string(20) "-1152921504606846975" - } -} diff --git a/ext/oci8/tests/bug70700.phpt b/ext/oci8/tests/bug70700.phpt deleted file mode 100644 index 8dae43997627..000000000000 --- a/ext/oci8/tests/bug70700.phpt +++ /dev/null @@ -1,184 +0,0 @@ ---TEST-- -Tests for LOBs with multibyte strings, reading them out in chunks -(Doc Bug #70700) ---CREDITS-- -Chuck Burgess -ashnazg@php.net ---EXTENSIONS-- -mbstring -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---ENV-- -NLS_LANG=.AL32UTF8 ---FILE-- -writeTemporary($string1, OCI_TEMP_CLOB); -oci_execute($insert); -$desc->save($string1); -oci_commit($c); -$desc->close(); -oci_bind_by_name($select, ':id', $id); -oci_execute($select); -$row = oci_fetch_array($select, OCI_ASSOC); -$lob = $row['DATA']; -$fh = fopen('php://temp', 'rw'); -while (! $lob->eof()) { - $data = $lob->read(8192); // read($characters), not read($bytes) - fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes) -} -$lob->free(); -rewind($fh); -$stream1a = stream_get_contents($fh); -fclose($fh); -$start1a = mb_substr($stream1a, 0, 10); -$ending1a = mb_substr($stream1a, -10); -echo 'size of string1 is ', strlen($string1), ' bytes, ', mb_strlen($string1), ' chars.', PHP_EOL; -echo 'size of stream1a is ', strlen($stream1a), ' bytes, ', mb_strlen($stream1a), ' chars.', PHP_EOL; -echo 'beg of stream1a is ', $start1a, PHP_EOL; -echo 'end of stream1a is ', $ending1a, PHP_EOL; - - -echo PHP_EOL, 'Test 2: £', PHP_EOL; -$string2 = 'abc' . str_repeat('£', 4094) . 'xyz'; -$id = 2; -$desc = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB); -$desc->writeTemporary($string2, OCI_TEMP_CLOB); -oci_execute($insert); -$desc->save($string2); -oci_commit($c); -$desc->close(); -oci_bind_by_name($select, ':id', $id); -oci_execute($select); -$row = oci_fetch_array($select, OCI_ASSOC); -$lob = $row['DATA']; -$fh = fopen('php://temp', 'rw'); -while (! $lob->eof()) { - $data = $lob->read(8192); // read($characters), not read($bytes) - fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes) -} -$lob->free(); -rewind($fh); -$stream2a = stream_get_contents($fh); -fclose($fh); -$start2a = mb_substr($stream2a, 0, 10); -$ending2a = mb_substr($stream2a, -10); -echo 'size of string2 is ', strlen($string2), ' bytes, ', mb_strlen($string2), ' chars.', PHP_EOL; -echo 'size of stream2a is ', strlen($stream2a), ' bytes, ', mb_strlen($stream2a), ' chars.', PHP_EOL; -echo 'beg of stream2a is ', $start2a, PHP_EOL; -echo 'end of stream2a is ', $ending2a, PHP_EOL; - - -echo PHP_EOL, 'Test 3: Җ', PHP_EOL; -$string3 = 'abc' . str_repeat('Җ', 4094) . 'xyz'; -$id = 3; -$desc = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB); -$desc->writeTemporary($string3, OCI_TEMP_CLOB); -oci_execute($insert); -$desc->save($string3); -oci_commit($c); -$desc->close(); -oci_bind_by_name($select, ':id', $id); -oci_execute($select); -$row = oci_fetch_array($select, OCI_ASSOC); -$lob = $row['DATA']; -$fh = fopen('php://temp', 'rw'); -while (! $lob->eof()) { - $data = $lob->read(8192); // read($characters), not read($bytes) - fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes) -} -$lob->free(); -rewind($fh); -$stream3a = stream_get_contents($fh); -fclose($fh); -$start3a = mb_substr($stream3a, 0, 10); -$ending3a = mb_substr($stream3a, -10); -echo 'size of string3 is ', strlen($string3), ' bytes, ', mb_strlen($string3), ' chars.', PHP_EOL; -echo 'size of stream3a is ', strlen($stream3a), ' bytes, ', mb_strlen($stream3a), ' chars.', PHP_EOL; -echo 'beg of stream3a is ', $start3a, PHP_EOL; -echo 'end of stream3a is ', $ending3a, PHP_EOL; - - -echo PHP_EOL, 'Test 4: の', PHP_EOL; -$string4 = 'abc' . str_repeat('の', 2729) . 'xyz'; -$id = 4; -$desc = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB); -$desc->writeTemporary($string4, OCI_TEMP_CLOB); -oci_execute($insert); -$desc->save($string4); -oci_commit($c); -$desc->close(); -oci_bind_by_name($select, ':id', $id); -oci_execute($select); -$row = oci_fetch_array($select, OCI_ASSOC); -$lob = $row['DATA']; -$fh = fopen('php://temp', 'rw'); -while (! $lob->eof()) { - $data = $lob->read(8192); // read($characters), not read($bytes) - fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes) -} -$lob->free(); -rewind($fh); -$stream4a = stream_get_contents($fh); -fclose($fh); -$start4a = mb_substr($stream4a, 0, 10); -$ending4a = mb_substr($stream4a, -10); -echo 'size of string4 is ', strlen($string4), ' bytes, ', mb_strlen($string4), ' chars.', PHP_EOL; -echo 'size of stream4a is ', strlen($stream4a), ' bytes, ', mb_strlen($stream4a), ' chars.', PHP_EOL; -echo 'beg of stream4a is ', $start4a, PHP_EOL; -echo 'end of stream4a is ', $ending4a, PHP_EOL; -?> ---EXPECT-- -Test 1: j -size of string1 is 1000006 bytes, 1000006 chars. -size of stream1a is 1000006 bytes, 1000006 chars. -beg of stream1a is abcjjjjjjj -end of stream1a is jjjjjjjxyz - -Test 2: £ -size of string2 is 8194 bytes, 4100 chars. -size of stream2a is 8194 bytes, 4100 chars. -beg of stream2a is abc£££££££ -end of stream2a is £££££££xyz - -Test 3: Җ -size of string3 is 8194 bytes, 4100 chars. -size of stream3a is 8194 bytes, 4100 chars. -beg of stream3a is abcҖҖҖҖҖҖҖ -end of stream3a is ҖҖҖҖҖҖҖxyz - -Test 4: の -size of string4 is 8193 bytes, 2735 chars. -size of stream4a is 8193 bytes, 2735 chars. -beg of stream4a is abcののののののの -end of stream4a is のののののののxyz diff --git a/ext/oci8/tests/bug71148.phpt b/ext/oci8/tests/bug71148.phpt deleted file mode 100644 index e82a07336b14..000000000000 --- a/ext/oci8/tests/bug71148.phpt +++ /dev/null @@ -1,191 +0,0 @@ ---TEST-- -Bug #71448 (Binding reference overwritten on php7) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => true); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -Test 1: Bind input parameter in a local function -array(2) { - [":VAR1"]=> - string(6) "INSTR1" - [":VAR2"]=> - string(6) "INSTR2" -} - -Test 2: Bind output parameter in a local function -string(6) "xxxxxx" -string(6) "xxxxxx" - -Test 3: Bind output parameter within the same scope of execute -string(7) "OUTSTR1" -string(7) "OUTSTR2" - -Test 4: Bind output parameter within the same scope of execute -string(8) "STR1STR2" - -Test 5: Bind IN OUT parameter in a local function -string(4) "STR1" -string(4) "STR2" -string(1) " " - -Test 6: Bind IN OUT parameter within the same scope of execute -string(4) "STR1" -string(4) "STR2" -string(9) "STR1 STR2" diff --git a/ext/oci8/tests/bug71422.phpt b/ext/oci8/tests/bug71422.phpt deleted file mode 100644 index 9ff23d4d76c5..000000000000 --- a/ext/oci8/tests/bug71422.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Bug #71422 (Fix ORA-01438: value larger than specified precision allowed for this column) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(1) { - ["RAW_QUERY"]=> - string(3) "Foo" -} -array(1) { - ["NUMERIC_BIND_PARAMETER"]=> - string(3) "Foo" -} -array(1) { - ["STRING_BIND_PARAMETER"]=> - string(3) "Foo" -} diff --git a/ext/oci8/tests/bug71600.phpt b/ext/oci8/tests/bug71600.phpt deleted file mode 100644 index ba7e51d1c548..000000000000 --- a/ext/oci8/tests/bug71600.phpt +++ /dev/null @@ -1,96 +0,0 @@ ---TEST-- -Bug #71600 (oci_fetch_all result in segfault when select more than 8 columns) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => true); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -Test 1 -Executing SELECT statament... -Fetching data by columns... -2 Records Found -0|1|9 -1|11|19 -Test 2 -Re-executing SELECT statament... -Fetching data by rows... -2 Records Found -0|1|9 -1|11|19 diff --git a/ext/oci8/tests/bug72524.phpt b/ext/oci8/tests/bug72524.phpt deleted file mode 100644 index da0d0b638c5a..000000000000 --- a/ext/oci8/tests/bug72524.phpt +++ /dev/null @@ -1,95 +0,0 @@ ---TEST-- -Bug #72524 (Binding null values triggers ORA-24816 error) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => true); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default -bool(true) -Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default -bool(true) -Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default -bool(true) -Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default - -Warning: oci_execute(): ORA-24816: %s in %s on line %d -bool(false) -Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default - -Warning: oci_execute(): ORA-24816: %s in %s on line %d -bool(false) diff --git a/ext/oci8/tests/bug74625.phpt b/ext/oci8/tests/bug74625.phpt deleted file mode 100644 index ac733693b1d9..000000000000 --- a/ext/oci8/tests/bug74625.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Bug #74625 (Integer overflow in oci_bind_array_by_name) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(5) { - [0]=> - int(-2) - [1]=> - int(-4) - [2]=> - int(-6) - [3]=> - int(-8) - [4]=> - int(-10) -} diff --git a/ext/oci8/tests/calltimeout1.phpt b/ext/oci8/tests/calltimeout1.phpt deleted file mode 100644 index f0c0eab2e186..000000000000 --- a/ext/oci8/tests/calltimeout1.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -oci_set_call_timeout: test timing out ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { - die("skip needs to be run as a user with access to DBMS_LOCK"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 18)) { - die("skip works only with Oracle 18c or greater version of Oracle client libraries"); -} - -?> ---FILE-- - ---EXPECTF-- -Test 1 -Execute error was ORA-%r(03136|03156)%r: %s diff --git a/ext/oci8/tests/clientversion.phpt b/ext/oci8/tests/clientversion.phpt deleted file mode 100644 index 0b949f1ce2e4..000000000000 --- a/ext/oci8/tests/clientversion.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -oci_client_version() ---EXTENSIONS-- -oci8 ---FILE-- - ---EXPECTF-- -%d.%d.%d.%d.%d diff --git a/ext/oci8/tests/close.phpt b/ext/oci8/tests/close.phpt deleted file mode 100644 index fb5efbb8020d..000000000000 --- a/ext/oci8/tests/close.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -connect/close/connect ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Done diff --git a/ext/oci8/tests/coll_001.phpt b/ext/oci8/tests/coll_001.phpt deleted file mode 100644 index bf0191d7675e..000000000000 --- a/ext/oci8/tests/coll_001.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -oci_new_collection() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -object(OCICollection)#%d (1) { - ["collection"]=> - resource(%d) of type (oci8 collection) -} - -Warning: oci_new_collection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/coll_002.phpt b/ext/oci8/tests/coll_002.phpt deleted file mode 100644 index c6f62457e73e..000000000000 --- a/ext/oci8/tests/coll_002.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -oci_new_collection() + free() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -free()); - -try { - var_dump($coll1->size()); -} catch (TypeError $error) { - var_dump($error->getMessage()); -} - -var_dump(oci_new_collection($c, "NONEXISTENT")); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECTF-- -object(OCICollection)#%d (1) { - ["collection"]=> - resource(%d) of type (oci8 collection) -} -bool(true) -string(%d) "OCICollection::size(): supplied resource is not a valid oci8 collection resource" - -Warning: oci_new_collection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/coll_002_func.phpt b/ext/oci8/tests/coll_002_func.phpt deleted file mode 100644 index c08fdf59013b..000000000000 --- a/ext/oci8/tests/coll_002_func.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -oci_new_collection() + free() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -getMessage()); -} - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECTF-- -object(OCICollection)#%d (1) { - ["collection"]=> - resource(%d) of type (oci8 collection) -} -bool(true) -string(%d) "oci_collection_size(): supplied resource is not a valid oci8 collection resource" -Done diff --git a/ext/oci8/tests/coll_003.phpt b/ext/oci8/tests/coll_003.phpt deleted file mode 100644 index 3cc1b0121ca7..000000000000 --- a/ext/oci8/tests/coll_003.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -collection methods ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -size()); -var_dump($coll1->max()); -var_dump($coll1->trim(3)); -var_dump($coll1->append(1)); -var_dump($coll1->getElem(0)); -var_dump($coll1->assignElem(0,2)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECTF-- -int(0) -int(0) - -Warning: OCICollection::trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d -bool(false) -bool(true) -float(1) -bool(true) -Done diff --git a/ext/oci8/tests/coll_003_func.phpt b/ext/oci8/tests/coll_003_func.phpt deleted file mode 100644 index 833c6e97bf97..000000000000 --- a/ext/oci8/tests/coll_003_func.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -collection methods ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -int(0) -int(0) - -Warning: oci_collection_trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d -bool(false) -bool(true) -float(1) -bool(true) -Done diff --git a/ext/oci8/tests/coll_004.phpt b/ext/oci8/tests/coll_004.phpt deleted file mode 100644 index 88bc3843ce06..000000000000 --- a/ext/oci8/tests/coll_004.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -oci_collection_assign() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append(1)); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -float(1) -Done diff --git a/ext/oci8/tests/coll_004_func.phpt b/ext/oci8/tests/coll_004_func.phpt deleted file mode 100644 index 81addc0c6968..000000000000 --- a/ext/oci8/tests/coll_004_func.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -oci_collection_assign() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -float(1) -Done diff --git a/ext/oci8/tests/coll_009.phpt b/ext/oci8/tests/coll_009.phpt deleted file mode 100644 index 72fe8cb7f99e..000000000000 --- a/ext/oci8/tests/coll_009.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -collections and wrong dates ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append("2005-07-28")); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECTF-- -Warning: OCICollection::append(): OCI-01861: literal does not match format string in %s on line %d -bool(false) -bool(true) -bool(false) -Done diff --git a/ext/oci8/tests/coll_009_func.phpt b/ext/oci8/tests/coll_009_func.phpt deleted file mode 100644 index b8d243d2c3d1..000000000000 --- a/ext/oci8/tests/coll_009_func.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -collections and wrong dates ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Warning: oci_collection_append(): OCI-01861: literal does not match format string in %s on line %d -bool(false) -bool(true) -bool(false) -Done diff --git a/ext/oci8/tests/coll_010.phpt b/ext/oci8/tests/coll_010.phpt deleted file mode 100644 index 8820e6b14392..000000000000 --- a/ext/oci8/tests/coll_010.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -collections and nulls ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append(null)); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -NULL -Done diff --git a/ext/oci8/tests/coll_010_func.phpt b/ext/oci8/tests/coll_010_func.phpt deleted file mode 100644 index 4ee69c049fad..000000000000 --- a/ext/oci8/tests/coll_010_func.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -collections and nulls ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -NULL -Done diff --git a/ext/oci8/tests/coll_011.phpt b/ext/oci8/tests/coll_011.phpt deleted file mode 100644 index 3c27465be03e..000000000000 --- a/ext/oci8/tests/coll_011.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -collections and strings ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append("string")); -var_dump($coll1->append("string")); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -bool(true) -string(6) "string" -Done diff --git a/ext/oci8/tests/coll_011_func.phpt b/ext/oci8/tests/coll_011_func.phpt deleted file mode 100644 index 542e9e617f6f..000000000000 --- a/ext/oci8/tests/coll_011_func.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -collections and strings ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -bool(true) -string(6) "string" -Done diff --git a/ext/oci8/tests/coll_012.phpt b/ext/oci8/tests/coll_012.phpt deleted file mode 100644 index 0fdf3c986438..000000000000 --- a/ext/oci8/tests/coll_012.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -collections and correct dates ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append("28-JUL-05")); - -var_dump($coll2->assign($coll1)); - -var_dump($coll2->getElem(0)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(9) "28-JUL-05" -Done diff --git a/ext/oci8/tests/coll_012_func.phpt b/ext/oci8/tests/coll_012_func.phpt deleted file mode 100644 index 5dc2a4fd7e5e..000000000000 --- a/ext/oci8/tests/coll_012_func.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -collections and correct dates ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -string(9) "28-JUL-05" -Done diff --git a/ext/oci8/tests/coll_013.phpt b/ext/oci8/tests/coll_013.phpt deleted file mode 100644 index 82d036c8c0cc..000000000000 --- a/ext/oci8/tests/coll_013.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and correct dates (2) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append("28-JUL-05")); -var_dump($coll1->assignElem(0,"01-JAN-05")); -var_dump($coll1->getElem(0)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(9) "01-JAN-05" -Done diff --git a/ext/oci8/tests/coll_013_func.phpt b/ext/oci8/tests/coll_013_func.phpt deleted file mode 100644 index 6dc9c7a8bfe8..000000000000 --- a/ext/oci8/tests/coll_013_func.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and correct dates (2) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -string(9) "01-JAN-05" -Done diff --git a/ext/oci8/tests/coll_014.phpt b/ext/oci8/tests/coll_014.phpt deleted file mode 100644 index 70a2fcd35f51..000000000000 --- a/ext/oci8/tests/coll_014.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and strings (2) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append("striing")); -var_dump($coll1->assignElem(0,"blah")); -var_dump($coll1->getElem(0)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(4) "blah" -Done diff --git a/ext/oci8/tests/coll_014_func.phpt b/ext/oci8/tests/coll_014_func.phpt deleted file mode 100644 index 781990f0beae..000000000000 --- a/ext/oci8/tests/coll_014_func.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and strings (2) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -string(4) "blah" -Done diff --git a/ext/oci8/tests/coll_015.phpt b/ext/oci8/tests/coll_015.phpt deleted file mode 100644 index beb97001e01e..000000000000 --- a/ext/oci8/tests/coll_015.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and numbers (2) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append(1)); -var_dump($coll1->assignElem(0,2345)); -var_dump($coll1->getElem(0)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -float(2345) -Done diff --git a/ext/oci8/tests/coll_015_func.phpt b/ext/oci8/tests/coll_015_func.phpt deleted file mode 100644 index 5f7875ef11fe..000000000000 --- a/ext/oci8/tests/coll_015_func.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and numbers (2) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -float(2345) -Done diff --git a/ext/oci8/tests/coll_016.phpt b/ext/oci8/tests/coll_016.phpt deleted file mode 100644 index 4a7786238826..000000000000 --- a/ext/oci8/tests/coll_016.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -collections and negative/too big element indexes ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append(1)); -var_dump($coll1->assignElem(-1,2345)); -var_dump($coll1->assignElem(5000,2345)); -var_dump($coll1->getElem(-1)); -var_dump($coll1->getElem(-100)); -var_dump($coll1->getElem(500)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECTF-- -bool(true) - -Warning: OCICollection::assignElem(): OCI-22165: given index [%d] must be in the range of %s to [0] in %s on line %d -bool(false) - -Warning: OCICollection::assignElem(): OCI-22165: given index [5000] must be in the range of %s to [0] in %s on line %d -bool(false) -bool(false) -bool(false) -bool(false) -Done diff --git a/ext/oci8/tests/coll_016_func.phpt b/ext/oci8/tests/coll_016_func.phpt deleted file mode 100644 index 10722db5ae1b..000000000000 --- a/ext/oci8/tests/coll_016_func.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -collections and negative/too big element indexes ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -bool(true) - -Warning: oci_collection_element_assign(): OCI-22165: given index [%d] must be in the range of%s0%sto [0] in %s on line %d -bool(false) - -Warning: oci_collection_element_assign(): OCI-22165: given index [5000] must be in the range of%s0%sto [0] in %s on line %d -bool(false) -bool(false) -bool(false) -bool(false) -Done diff --git a/ext/oci8/tests/coll_017.phpt b/ext/oci8/tests/coll_017.phpt deleted file mode 100644 index 20a63cef5870..000000000000 --- a/ext/oci8/tests/coll_017.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and nulls (2) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append("string")); -var_dump($coll1->assignElem(0, null)); -var_dump($coll1->getElem(0)); - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECT-- -bool(true) -bool(true) -NULL -Done diff --git a/ext/oci8/tests/coll_017_func.phpt b/ext/oci8/tests/coll_017_func.phpt deleted file mode 100644 index fff058eb61b1..000000000000 --- a/ext/oci8/tests/coll_017_func.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -collections and nulls (2) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -NULL -Done diff --git a/ext/oci8/tests/coll_018.phpt b/ext/oci8/tests/coll_018.phpt deleted file mode 100644 index a2df12468386..000000000000 --- a/ext/oci8/tests/coll_018.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Collection trim tests ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -trim(0)); - -echo "\nTest 3.\n"; -var_dump($coll1->append(1)); -var_dump($coll1->append(2)); -var_dump($coll1->append(3)); -var_dump($coll1->append(4)); - -var_dump($coll1->getElem(-1)); // check before the beginning -var_dump($coll1->getElem(0)); -var_dump($coll1->getElem(1)); -var_dump($coll1->getElem(2)); -var_dump($coll1->getElem(3)); -var_dump($coll1->getElem(4)); // check past the end - -echo "\nTest 4.\n"; -var_dump($coll1->trim(1)); -var_dump($coll1->getElem(2)); // this should be the last element -var_dump($coll1->getElem(3)); // this element should have gone - -echo "\nTest 5.\n"; -var_dump($coll1->trim(2)); -var_dump($coll1->getElem(0)); // this should be the last element -var_dump($coll1->getElem(1)); // this element should have gone - -echo "\nTest 6.\n"; -var_dump($coll1->trim(0)); -var_dump($coll1->getElem(0)); // this should still be the last element - -echo "\nTest 7.\n"; -var_dump($coll1->trim(1)); -var_dump($coll1->getElem(0)); // this should have gone - -echo "Done\n"; - -require __DIR__."/drop_type.inc"; - -?> ---EXPECT-- -Test 2. -bool(true) - -Test 3. -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -float(1) -float(2) -float(3) -float(4) -bool(false) - -Test 4. -bool(true) -float(3) -bool(false) - -Test 5. -bool(true) -float(1) -bool(false) - -Test 6. -bool(true) -float(1) - -Test 7. -bool(true) -bool(false) -Done diff --git a/ext/oci8/tests/coll_019.phpt b/ext/oci8/tests/coll_019.phpt deleted file mode 100644 index 866c0e2f1f87..000000000000 --- a/ext/oci8/tests/coll_019.phpt +++ /dev/null @@ -1,112 +0,0 @@ ---TEST-- -Test collection Oracle error handling collections and numbers (2) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -append('a long string')); // invalid type for append -var_dump($coll1->assignElem(1, 'a long string')); // invalid type for assignelem() -var_dump($coll1->getElem(0)); - -require __DIR__."/drop_type.inc"; - -echo "Test 1\n"; -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; -$statement = oci_parse($c,$ora_sql); -oci_execute($statement); - -$coll1 = oci_new_collection($c, $type_name); - -var_dump($coll1->assignElem(1, null)); // invalid location for null -var_dump($coll1->getElem(0)); - -echo "Test 2\n"; -var_dump($coll1->assignElem(1, 1234)); // invalid location for number -var_dump($coll1->getElem(0)); - -require __DIR__."/drop_type.inc"; - -echo "Test 3\n"; -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR2(1)"; -$statement = oci_parse($c,$ora_sql); -oci_execute($statement); - -$coll1 = oci_new_collection($c, $type_name); - -var_dump($coll1->assignElem(1, 'abc')); // invalid location for string -var_dump($coll1->getElem(0)); - -require __DIR__."/drop_type.inc"; - -echo "Test 4\n"; -$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; -$statement = oci_parse($c,$ora_sql); -oci_execute($statement); - -$coll1 = oci_new_collection($c, $type_name); - -var_dump($coll1->append(1)); // invalid date format -var_dump($coll1->assignElem(1, '01-JAN-06')); // invalid location for date -var_dump($coll1->getElem(0)); - -require __DIR__."/drop_type.inc"; - -echo "Done\n"; - -?> ---EXPECTF-- -Test 0 - -Notice: OCICollection::append(): Unknown or unsupported type of element: 113 in %s on line %d -bool(false) - -Notice: OCICollection::assignElem(): Unknown or unsupported type of element: 113 in %s on line %d -bool(false) -bool(false) -Test 1 - -Warning: OCICollection::assignElem(): OCI-22165: given index [1] must be in the range of %s in %s on line %d -bool(false) -bool(false) -Test 2 - -Warning: OCICollection::assignElem(): OCI-22165: given index [1] must be in the range of %s in %s on line %d -bool(false) -bool(false) -Test 3 - -Warning: OCICollection::assignElem(): OCI-22165: given index [1] must be in the range of %s in %s on line %d -bool(false) -bool(false) -Test 4 - -Warning: OCICollection::append(): OCI-01840: input value not long enough for date format in %s on line %d -bool(false) - -Warning: OCICollection::assignElem(): OCI-22165: given index [1] must be in the range of %s in %s on line %d -bool(false) -bool(false) -Done diff --git a/ext/oci8/tests/commit_001.phpt b/ext/oci8/tests/commit_001.phpt deleted file mode 100644 index 32e024240f85..000000000000 --- a/ext/oci8/tests/commit_001.phpt +++ /dev/null @@ -1,162 +0,0 @@ ---TEST-- -Test OCI_NO_AUTO_COMMIT constant ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -bool(true) -int(0) -array(5) { - ["ID"]=> - array(0) { - } - ["VALUE"]=> - array(0) { - } - ["BLOB"]=> - array(0) { - } - ["CLOB"]=> - array(0) { - } - ["STRING"]=> - array(0) { - } -} -bool(true) -int(4) -array(5) { - ["ID"]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - [3]=> - string(1) "1" - } - ["VALUE"]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - [3]=> - string(1) "1" - } - ["BLOB"]=> - array(4) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - } - ["CLOB"]=> - array(4) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - } - ["STRING"]=> - array(4) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - [3]=> - NULL - } -} -Done diff --git a/ext/oci8/tests/commit_002.phpt b/ext/oci8/tests/commit_002.phpt deleted file mode 100644 index e04b80d08610..000000000000 --- a/ext/oci8/tests/commit_002.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Test oci_commit failure ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - 0 ) deferrable initially immediate, - y int constraint commit_002_tab_check_y check ( y > 0 ) deferrable initially deferred)" -); - -oci8_test_sql_execute($c, $stmtarray); - -// Run Test - -echo "First Insert\n"; -$s = oci_parse($c, "insert into commit_002_tab values (-1, 1)"); -$r = @oci_execute($s, OCI_DEFAULT); -if (!$r) { - $m = oci_error($s); - echo 'Could not execute: '. $m['message'] . "\n"; -} -$r = oci_commit($c); -if (!$r) { - $m = oci_error($c); - echo 'Could not commit: '. $m['message'] . "\n"; -} - - -echo "Second Insert\n"; -$s = oci_parse($c, "insert into commit_002_tab values (1, -1)"); -$r = @oci_execute($s, OCI_NO_AUTO_COMMIT); -if (!$r) { - $m = oci_error($s); - echo 'Could not execute: '. $m['message'] . "\n"; -} -$r = oci_commit($c); -if (!$r) { - $m = oci_error($c); - echo 'Could not commit: '. $m['message'] . "\n"; -} - - -// Clean up - -$stmtarray = array( - "drop table commit_002_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -First Insert -Could not execute: ORA-02290: %s (%s.COMMIT_002_TAB_CHECK_X) %s -Second Insert - -Warning: oci_commit(): ORA-02091: %s -ORA-02290: %s (%s.COMMIT_002_TAB_CHECK_Y) %s in %scommit_002.php on line %d -Could not commit: ORA-02091: %s -ORA-02290: %s (%s.COMMIT_002_TAB_CHECK_Y) %s diff --git a/ext/oci8/tests/conn_attr.inc b/ext/oci8/tests/conn_attr.inc deleted file mode 100644 index f7faf702a1f3..000000000000 --- a/ext/oci8/tests/conn_attr.inc +++ /dev/null @@ -1,149 +0,0 @@ -= 11)) { - // Server is Oracle 11.2+ - $stmtarray = array( - "drop user $testuser cascade", - "create user $testuser identified by $testpassword", // $testuser should be set by the file that includes conn_attr.inc - "grant connect,resource,dba to $testuser", - "alter user $testuser enable editions", - "drop edition myedition1 cascade", - "drop edition myedition cascade", - "grant create any edition to $testuser", - "create edition myedition", - "create edition myedition1 as child of myedition", - "grant use on edition myedition to $testuser", - "grant use on edition myedition1 to $testuser", - ); -} else { - // Server is Pre 11.2 - $stmtarray = array( - "drop user $testuser cascade", - "create user $testuser identified by $testpassword", - "grant connect,resource,dba to $testuser", - ); -} - -foreach ($stmtarray as $stmt) { - $s = oci_parse($c, $stmt); - $r = @oci_execute($s); - if (!$r) { - $m = oci_error($s); - if (!in_array($m['code'], array( // ignore expected errors - 942 // table or view does not exist - , 1918 // user does not exist - , 2289 // sequence does not exist - , 4080 // trigger does not exist - , 38802 // edition does not exist - ))) { - echo "Error:" . $stmt . PHP_EOL . $m['message'] . PHP_EOL; - if ($m['code'] == 38807) { - echo "You appear to already have an edition in use that prevents this PHP test from running. Query DBA_EDITIONS to see existing editions.". PHP_EOL; - } - die; - } - } -} - -function get_attr($conn,$attr) -{ - $sel_stmt="select " .$attr. " from v\$session where sid = - (select sid from v\$session where audsid = - sys_context('userenv','sessionid')) order by 1"; - $s2 = oci_parse($conn,$sel_stmt); - oci_execute($s2,OCI_DEFAULT); - while (oci_fetch($s2)) { - echo "The value of ".$attr ." is ".oci_result($s2,1)."\n"; - } -} - -/* Pass $conn_type=1 for a connection with oci_connect() - Pass $conn_type=2 for ooci_pconnect - Default will give a oci_new_connect */ - -function get_conn($conn_type) -{ - $user = $GLOBALS['testuser']; - $password = $GLOBALS['testpassword']; - $dbase = $GLOBALS['dbase']; - switch($conn_type) { - case 1: - echo "Testing with oci_connect()\n"; - return(oci_connect($user,$password,$dbase)); - break; - case 2: - echo "Testing with oci_pconnect()\n"; - return(oci_pconnect($user,$password,$dbase)); - break; - default: - echo "Testing with oci_new_connect()\n"; - return(oci_new_connect($user,$password,$dbase)); - break; - } -} - -function set_attr($conn,$attr,$sufix) -{ - if (!strcmp($attr,'MODULE')) - $r = oci_set_module_name($conn,'PHP TEST'.$sufix); - else if (!strcmp($attr,'ACTION')) - $r = oci_set_action($conn,'TASK'.$sufix); - else if (!strcmp($attr,'CLIENT_INFO')) - $r = oci_set_client_info($conn,'INFO1'.$sufix); - else if (!strcmp($attr,'CLIENT_IDENTIFIER')) - $r = oci_set_client_identifier($conn,'ID00'.$sufix); - else - echo "Pass one of the above four attributes!!!\n"; - if ($r) { - echo "Value of $attr has been set successfully\n"; - } - - //Do a round-trip here - oci_server_version($conn); - return $r; -} - -function set_edit_attr($value) -{ - $r = oci_set_edition($value); - if ($r) { - echo " The value of edition has been successfully set\n"; - } - return $r; -} - -function get_edit_attr ($conn) { - $sel_stmt = "select sys_context('USERENV', 'CURRENT_EDITION_NAME') from dual"; - $s2 = oci_parse($conn,$sel_stmt); - oci_execute($s2,OCI_DEFAULT); - while (oci_fetch($s2)) { - echo "The value of current EDITION is ".oci_result($s2,1)."\n"; - } -} - -function get_sys_attr($conn,$attr) -{ - $sel_stmt="select " .$attr. " from v\$session where sid = - (select sid from v\$session where audsid = sys_context('userenv','sessionid')) order by 1"; - $s2 = oci_parse($conn,$sel_stmt); - oci_execute($s2,OCI_DEFAULT); - while (oci_fetch($s2)) { - echo "The value of ".$attr ." is ".oci_result($s2,1)."\n"; - } -} - -function clean_up($c) { - $stmtarray = array( - "drop edition myedition1 cascade", - "drop edition myedition cascade", - "drop user " . $GLOBALS['testuser'] . " cascade", - ); - - foreach ($stmtarray as $stmt) { - $s = oci_parse($c, $stmt); - @oci_execute($s); - } -} diff --git a/ext/oci8/tests/conn_attr_1.phpt b/ext/oci8/tests/conn_attr_1.phpt deleted file mode 100644 index 5c7ab61d999e..000000000000 --- a/ext/oci8/tests/conn_attr_1.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -Set and get of connection attributes with all types of connections. ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; - -if (strcasecmp($user, "system") && strcasecmp($user, "sys")) - die("skip needs to be run as a DBA user"); -if ($test_drcp) die("skip output might vary with DRCP"); - -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 10)) { - die("skip expected output only valid when using Oracle 10g or greater database server"); -} -?> ---FILE-- - ---EXPECTF-- -**Test 1.1 - Default values for the attributes ************** -Testing with oci_connect() -The value of MODULE is %s -The value of ACTION is -The value of CLIENT_INFO is -The value of CLIENT_IDENTIFIER is -**Test 1.2 - Set and get values for the attributes ************** -Testing with oci_connect() -Value of MODULE has been set successfully -The value of MODULE is PHP TEST1 -Value of ACTION has been set successfully -The value of ACTION is TASK1 -Value of CLIENT_INFO has been set successfully -The value of CLIENT_INFO is INFO11 -Value of CLIENT_IDENTIFIER has been set successfully -The value of CLIENT_IDENTIFIER is ID001 -Testing with oci_pconnect() -Value of MODULE has been set successfully -The value of MODULE is PHP TEST2 -Value of ACTION has been set successfully -The value of ACTION is TASK2 -Value of CLIENT_INFO has been set successfully -The value of CLIENT_INFO is INFO12 -Value of CLIENT_IDENTIFIER has been set successfully -The value of CLIENT_IDENTIFIER is ID002 -Testing with oci_new_connect() -Value of MODULE has been set successfully -The value of MODULE is PHP TEST3 -Value of ACTION has been set successfully -The value of ACTION is TASK3 -Value of CLIENT_INFO has been set successfully -The value of CLIENT_INFO is INFO13 -Value of CLIENT_IDENTIFIER has been set successfully -The value of CLIENT_IDENTIFIER is ID003 -Done diff --git a/ext/oci8/tests/conn_attr_2.phpt b/ext/oci8/tests/conn_attr_2.phpt deleted file mode 100644 index dce6270f92cf..000000000000 --- a/ext/oci8/tests/conn_attr_2.phpt +++ /dev/null @@ -1,116 +0,0 @@ ---TEST-- -Set and get of connection attributes across persistent connections and sysdba connection. ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; - -if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); -if ($test_drcp) die("skip output might vary with DRCP"); - -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 10)) { - die("skip expected output only valid when using Oracle 10g or greater database server"); -} -?> ---INI-- -oci8.privileged_connect = On ---FILE-- - ---EXPECTF-- -**Set values using pconnect-1** -resource(%d) of type (oci8 persistent connection) -Value of MODULE has been set successfully -Value of ACTION has been set successfully -Value of CLIENT_INFO has been set successfully -Value of CLIENT_IDENTIFIER has been set successfully - -**Get values using pconnect-2** -resource(%d) of type (oci8 persistent connection) -The value of MODULE is PHP TEST100 -The value of ACTION is TASK100 -The value of CLIENT_INFO is INFO1100 -The value of CLIENT_IDENTIFIER is ID00100 - -**Get values using pconnect-3** -resource(%d) of type (oci8 persistent connection) -The value of MODULE is %s -The value of ACTION is -The value of CLIENT_INFO is -The value of CLIENT_IDENTIFIER is - -**Re-open a pconnect()** -resource(%d) of type (oci8 persistent connection) -The value of MODULE is PHP TEST100 -The value of ACTION is TASK100 -The value of CLIENT_INFO is INFO1100 -The value of CLIENT_IDENTIFIER is ID00100 - -**Test with SYSDBA connection** -bool(false) -Done diff --git a/ext/oci8/tests/conn_attr_3.phpt b/ext/oci8/tests/conn_attr_3.phpt deleted file mode 100644 index c2e62bd3ff13..000000000000 --- a/ext/oci8/tests/conn_attr_3.phpt +++ /dev/null @@ -1,94 +0,0 @@ ---TEST-- -Set and get of connection attributes with oci_close(). ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; - -if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); -if ($test_drcp) die("skip output might vary with DRCP"); - -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 10)) { - die("skip expected output only valid when using Oracle 10g or greater database server"); -} -?> ---FILE-- - ---EXPECTF-- -**Test Set and get values for the attributes with oci_close() ************ -Testing with oci_connect() -resource(%d) of type (oci8 connection) -Value of ACTION has been set successfully -The value of ACTION is TASK1 -Testing with oci_connect() -resource(%d) of type (oci8 connection) -The value of ACTION is -Testing with oci_pconnect() -resource(%d) of type (oci8 persistent connection) -Value of MODULE has been set successfully -The value of MODULE is PHP TEST2 -Testing with oci_pconnect() -resource(%d) of type (oci8 persistent connection) -The value of MODULE is PHP TEST2 -Testing with oci_new_connect() -resource(%d) of type (oci8 connection) -Value of CLIENT_INFO has been set successfully -Value of CLIENT_IDENTIFIER has been set successfully -The value of CLIENT_INFO is INFO13 -The value of CLIENT_IDENTIFIER is ID003 -Testing with oci_new_connect() -resource(%d) of type (oci8 connection) -The value of CLIENT_INFO is -The value of CLIENT_IDENTIFIER is -Done diff --git a/ext/oci8/tests/conn_attr_4.phpt b/ext/oci8/tests/conn_attr_4.phpt deleted file mode 100644 index eccbc78c0e03..000000000000 --- a/ext/oci8/tests/conn_attr_4.phpt +++ /dev/null @@ -1,132 +0,0 @@ ---TEST-- -Set and get of connection attributes with errors. ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); - -if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); -if ($test_drcp) die("skip output might vary with DRCP"); - -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] >= 2) || - ($matches[1] >= 12) - ))) { - // Bug fixed in 11.2 prevents client_info being reset - die("skip expected output only valid when using Oracle 11gR2 or greater database server"); -} -?> ---FILE-- -getMessage()); -} - -// Variable instead of a connection resource. -echo "\nInvalid Connection resource 2\n"; -$str1= 'not a conn'; -try { - oci_set_client_info($str1,$str1); -} catch (TypeError $e) { - var_dump($e->getMessage()); -} - -// Setting an Invalid value. -echo "\nInvalid Action value \n"; -$c1=oci_connect($testuser,$testpassword,$dbase); -try { - oci_set_action($c1,$c1); -} catch (TypeError $e) { - var_dump($e->getMessage()); -} - -// Setting values multiple times. -echo "\nSet Values multiple times \n"; -var_dump(oci_set_action($c1,'ACTION1')); -var_dump(oci_set_action($c1,'ACTION1')); -var_dump(oci_set_action($c1,'ACTION2')); -var_dump(oci_set_action($c1,'ACTION1')); -get_attr($c1,'ACTION'); - -// Testing with different types of values -// NB. This may diff in 11.1.0.6 due to a bug causing CLIENT_INFO of NULL to be ignored. -echo "\nSetting to different values \n"; -$values_array = array(1000,NULL,'this is a very huge string with a length > 64 !!!!!this is a very huge string with a length > 64 !!!!!this is a very huge string with a length > 64 !!!!!this is a very huge string with a length > 64 !!!!!'); - -foreach($values_array as $val ) { - oci_set_module_name($c1,$val); - oci_set_client_identifier($c1,$val); - oci_set_client_info($c1,$val); - $r = oci_set_action($c1,$val); - if ($r) { - echo "Values set successfully to $val\n"; - foreach($attr_array as $attr) { - get_attr($c1,$attr); - } - } -} - -clean_up($c); -echo "Done\n"; -?> ---EXPECTF-- -**Test Negative cases************ - -Invalid Connection resource 1 -string(%d) "oci_set_action(): Argument #1 ($connection) must be of type resource, null given" - -Invalid Connection resource 2 -string(%d) "oci_set_client_info(): Argument #1 ($connection) must be of type resource, string given" - -Invalid Action value -string(%d) "oci_set_action(): Argument #2 ($action) must be of type string, resource given" - -Set Values multiple times -bool(true) -bool(true) -bool(true) -bool(true) -The value of ACTION is ACTION1 - -Setting to different values -Values set successfully to 1000 -The value of MODULE is 1000 -The value of ACTION is 1000 -The value of CLIENT_INFO is 1000 -The value of CLIENT_IDENTIFIER is 1000 -Values set successfully to -The value of MODULE is -The value of ACTION is -The value of CLIENT_INFO is -The value of CLIENT_IDENTIFIER is - -Warning: oci_set_module_name(): ORA-24960: %s OCI_ATTR_MODULE %s on line %d - -Warning: oci_set_client_identifier(): ORA-24960: %s OCI_ATTR_CLIENT_IDENTIFIER %s on line %d - -Warning: oci_set_client_info(): ORA-24960: %s OCI_ATTR_CLIENT_INFO %s on line %d - -Warning: oci_set_action(): ORA-24960: %s OCI_ATTR_ACTION %s on line %d -Done diff --git a/ext/oci8/tests/conn_attr_5.phpt b/ext/oci8/tests/conn_attr_5.phpt deleted file mode 100644 index 6ea0796cd7c5..000000000000 --- a/ext/oci8/tests/conn_attr_5.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -Set and get connection attributes with scope end. ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; - -if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); -if ($test_drcp) die("skip output might vary with DRCP"); - -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 10)) { - die("skip expected output only valid when using Oracle 10g or greater database server"); -} -?> ---FILE-- - ---EXPECT-- -**Test - Set and get values for the attributes with scope end ************ -Testing with oci_connect() -Value of CLIENT_INFO has been set successfully -Value of CLIENT_IDENTIFIER has been set successfully -Testing with oci_new_connect() -Value of ACTION has been set successfully -Testing with oci_pconnect() -Value of MODULE has been set successfully -Get the Values from a different scope -Testing with oci_connect() -The value of CLIENT_INFO is -The value of CLIENT_IDENTIFIER is -Testing with oci_new_connect() -The value of ACTION is -Testing with oci_pconnect() -The value of MODULE is PHP TEST50 -Done diff --git a/ext/oci8/tests/connect.inc b/ext/oci8/tests/connect.inc deleted file mode 100644 index febb49b90a0c..000000000000 --- a/ext/oci8/tests/connect.inc +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/ext/oci8/tests/connect.phpt b/ext/oci8/tests/connect.phpt deleted file mode 100644 index 76b36c32bf52..000000000000 --- a/ext/oci8/tests/connect.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -oci_connect() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (oci8 connection) -Done diff --git a/ext/oci8/tests/connect_1.phpt b/ext/oci8/tests/connect_1.phpt deleted file mode 100644 index 7b5313a45e6d..000000000000 --- a/ext/oci8/tests/connect_1.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -oci_pconnect() & oci_new_connect() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 connection) -bool(true) -bool(true) -Done diff --git a/ext/oci8/tests/connect_scope1.phpt b/ext/oci8/tests/connect_scope1.phpt deleted file mode 100644 index 1c5c2b9bf1e7..000000000000 --- a/ext/oci8/tests/connect_scope1.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Test oci_connect end-of-scope when statement returned ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 - oci_connect -array(1) { - ["C1"]=> - array(0) { - } -} -array(1) { - ["C1"]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - } -} -Done diff --git a/ext/oci8/tests/connect_scope2.phpt b/ext/oci8/tests/connect_scope2.phpt deleted file mode 100644 index 311739963001..000000000000 --- a/ext/oci8/tests/connect_scope2.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Test oci_pconnect end-of-scope when statement returned ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 - oci_pconnect -array(1) { - ["C1"]=> - array(0) { - } -} -array(1) { - ["C1"]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - } -} -Done diff --git a/ext/oci8/tests/connect_scope_try1.phpt b/ext/oci8/tests/connect_scope_try1.phpt deleted file mode 100644 index c390cb54aa70..000000000000 --- a/ext/oci8/tests/connect_scope_try1.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -Check oci_connect try/catch end-of-scope with old_oci_close_semantics Off ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=0 ---FILE-- - throws exception - oci_execute($s, OCI_DEFAULT); // no commit -} -catch (Exception $e) -{ - echo "Caught Exception: ". $e->getMessage(), "\n"; - var_dump($c); - - // Verify data is not yet committed - $s1 = oci_parse($c1, "select * from scope_try1_tab"); - oci_execute($s1); - oci_fetch_all($s1, $r); - var_dump($r); - - // Now commit - oci_commit($c); -} - -// Verify data was committed in the Catch block - -$s1 = oci_parse($c1, "select * from scope_try1_tab"); -oci_execute($s1); -oci_fetch_all($s1, $r); -var_dump($r); - -// Cleanup - -$stmtarray = array( - "drop table scope_try1_tab" -); - -oci8_test_sql_execute($c1, $stmtarray); - -echo "Done\n"; - -?> ---EXPECTF-- -Test 1 -Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s -resource(%d) of type (oci8 connection) -array(1) { - ["C1"]=> - array(0) { - } -} -array(1) { - ["C1"]=> - array(1) { - [0]=> - string(1) "1" - } -} -Done diff --git a/ext/oci8/tests/connect_scope_try2.phpt b/ext/oci8/tests/connect_scope_try2.phpt deleted file mode 100644 index 73292fc3997f..000000000000 --- a/ext/oci8/tests/connect_scope_try2.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -Check oci_connect try/catch end-of-scope with old_oci_close_semantics On ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=1 ---FILE-- - throws exception - oci_execute($s, OCI_DEFAULT); // no commit -} -catch (Exception $e) -{ - echo "Caught Exception: ". $e->getMessage(), "\n"; - var_dump($c); - - // Verify data is not yet committed - $s1 = oci_parse($c1, "select * from scope_try2_tab"); - oci_execute($s1); - oci_fetch_all($s1, $r); - var_dump($r); - - // Now commit - oci_commit($c); -} - -// Verify data was committed in the Catch block - -$s1 = oci_parse($c1, "select * from scope_try2_tab"); -oci_execute($s1); -oci_fetch_all($s1, $r); -var_dump($r); - -// Cleanup - -$stmtarray = array( - "drop table scope_try2_tab" -); - -oci8_test_sql_execute($c1, $stmtarray); - -echo "Done\n"; - -?> ---EXPECTF-- -Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s -Test 1 -Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s -resource(%d) of type (oci8 connection) -array(1) { - ["C1"]=> - array(0) { - } -} -array(1) { - ["C1"]=> - array(1) { - [0]=> - string(1) "1" - } -} -Done diff --git a/ext/oci8/tests/connect_scope_try3.phpt b/ext/oci8/tests/connect_scope_try3.phpt deleted file mode 100644 index a6073e22fb5f..000000000000 --- a/ext/oci8/tests/connect_scope_try3.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -Check oci_new_connect try/catch end-of-scope with old_oci_close_semantics Off ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=0 ---FILE-- - throws exception - oci_execute($s, OCI_DEFAULT); // no commit -} -catch (Exception $e) -{ - echo "Caught Exception: ". $e->getMessage(), "\n"; - var_dump($c); - - // Verify data is not yet committed - $s1 = oci_parse($c1, "select * from scope_try3_tab"); - oci_execute($s1); - oci_fetch_all($s1, $r); - var_dump($r); - - // Now commit - oci_commit($c); -} - -// Verify data was committed in the Catch block - -$s1 = oci_parse($c1, "select * from scope_try3_tab"); -oci_execute($s1); -oci_fetch_all($s1, $r); -var_dump($r); - -// Cleanup - -$stmtarray = array( - "drop table scope_try3_tab" -); - -oci8_test_sql_execute($c1, $stmtarray); - -echo "Done\n"; - -?> ---EXPECTF-- -Test 1 -Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s -resource(%d) of type (oci8 connection) -array(1) { - ["C1"]=> - array(0) { - } -} -array(1) { - ["C1"]=> - array(1) { - [0]=> - string(1) "1" - } -} -Done diff --git a/ext/oci8/tests/connect_scope_try4.phpt b/ext/oci8/tests/connect_scope_try4.phpt deleted file mode 100644 index 37fe07e37f97..000000000000 --- a/ext/oci8/tests/connect_scope_try4.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -Check oci_new_connect try/catch end-of-scope with old_oci_close_semantics On ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=1 ---FILE-- - throws exception - oci_execute($s, OCI_DEFAULT); // no commit -} -catch (Exception $e) -{ - echo "Caught Exception: ". $e->getMessage(), "\n"; - var_dump($c); - - // Verify data is not yet committed - $s1 = oci_parse($c1, "select * from scope_try4_tab"); - oci_execute($s1); - oci_fetch_all($s1, $r); - var_dump($r); - - // Now commit - oci_commit($c); -} - -// Verify data was committed in the Catch block - -$s1 = oci_parse($c1, "select * from scope_try4_tab"); -oci_execute($s1); -oci_fetch_all($s1, $r); -var_dump($r); - -// Cleanup - -$stmtarray = array( - "drop table scope_try4_tab" -); - -oci8_test_sql_execute($c1, $stmtarray); - -echo "Done\n"; - -?> ---EXPECTF-- -Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s -Test 1 -Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s -resource(%d) of type (oci8 connection) -array(1) { - ["C1"]=> - array(0) { - } -} -array(1) { - ["C1"]=> - array(1) { - [0]=> - string(1) "1" - } -} -Done diff --git a/ext/oci8/tests/connect_scope_try5.phpt b/ext/oci8/tests/connect_scope_try5.phpt deleted file mode 100644 index 69e6c3656d07..000000000000 --- a/ext/oci8/tests/connect_scope_try5.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -Check oci_pconnect try/catch end-of-scope with old_oci_close_semantics Off ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=0 ---FILE-- - throws exception - oci_execute($s, OCI_DEFAULT); // no commit -} -catch (Exception $e) -{ - echo "Caught Exception: ". $e->getMessage(), "\n"; - var_dump($c); - - // Verify data is not yet committed - $s1 = oci_parse($c1, "select * from scope_try5_tab"); - oci_execute($s1); - oci_fetch_all($s1, $r); - var_dump($r); - - // Now commit - oci_commit($c); -} - -// Verify data was committed in the Catch block - -$s1 = oci_parse($c1, "select * from scope_try5_tab"); -oci_execute($s1); -oci_fetch_all($s1, $r); -var_dump($r); - -// Cleanup - -$stmtarray = array( - "drop table scope_try5_tab" -); - -oci8_test_sql_execute($c1, $stmtarray); - -echo "Done\n"; - -?> ---EXPECTF-- -Test 1 -Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s -resource(%d) of type (oci8 persistent connection) -array(1) { - ["C1"]=> - array(0) { - } -} -array(1) { - ["C1"]=> - array(1) { - [0]=> - string(1) "1" - } -} -Done diff --git a/ext/oci8/tests/connect_scope_try6.phpt b/ext/oci8/tests/connect_scope_try6.phpt deleted file mode 100644 index 8199d6f330c0..000000000000 --- a/ext/oci8/tests/connect_scope_try6.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -Check oci_pconnect try/catch end-of-scope with old_oci_close_semantics On ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=1 ---FILE-- - throws exception - oci_execute($s, OCI_DEFAULT); // no commit -} -catch (Exception $e) -{ - echo "Caught Exception: ". $e->getMessage(), "\n"; - var_dump($c); - - // Verify data is not yet committed - $s1 = oci_parse($c1, "select * from scope_try6_tab"); - oci_execute($s1); - oci_fetch_all($s1, $r); - var_dump($r); - - // Now commit - oci_commit($c); -} - -// Verify data was committed in the Catch block - -$s1 = oci_parse($c1, "select * from scope_try6_tab"); -oci_execute($s1); -oci_fetch_all($s1, $r); -var_dump($r); - -// Cleanup - -$stmtarray = array( - "drop table scope_try6_tab" -); - -oci8_test_sql_execute($c1, $stmtarray); - -echo "Done\n"; - -?> ---EXPECTF-- -Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s -Test 1 -Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s -resource(%d) of type (oci8 persistent connection) -array(1) { - ["C1"]=> - array(0) { - } -} -array(1) { - ["C1"]=> - array(1) { - [0]=> - string(1) "1" - } -} -Done diff --git a/ext/oci8/tests/connect_with_charset_001.phpt b/ext/oci8/tests/connect_with_charset_001.phpt deleted file mode 100644 index e1f1e49104d3..000000000000 --- a/ext/oci8/tests/connect_with_charset_001.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -oci_connect() with invalid character set ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) - -Warning: oci_connect(): Invalid character set name: blah in %s on line %d -resource(%d) of type (oci8 connection) - -Warning: oci_connect(): Invalid character set name: obviously wrong in %s on line %d -resource(%d) of type (oci8 connection) -bool(true) -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -bool(false) -Done diff --git a/ext/oci8/tests/connect_without_oracle_home.phpt b/ext/oci8/tests/connect_without_oracle_home.phpt deleted file mode 100644 index def953a438fb..000000000000 --- a/ext/oci8/tests/connect_without_oracle_home.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -oci_connect() without ORACLE_HOME set (OCIServerAttach() segfaults) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---ENV-- -ORACLE_HOME="" ---FILE-- - ---EXPECTF-- -Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and %s are set and point to the right directories in %s on line %d -bool(false) diff --git a/ext/oci8/tests/connect_without_oracle_home_11.phpt b/ext/oci8/tests/connect_without_oracle_home_11.phpt deleted file mode 100644 index ef36ed0e9678..000000000000 --- a/ext/oci8/tests/connect_without_oracle_home_11.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -oci_connect() without ORACLE_HOME set (OCIServerAttach() segfaults) ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 2) || - ($matches[1] >= 12) - ))) { - die("skip test expected to work only with Oracle 11gR2 or greater version of client"); -} -?> ---ENV-- -ORACLE_HOME="" ---FILE-- - ---EXPECTF-- -Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and %s are set and point to the right directories in %s on line %d - -Warning: oci_connect(): Error while trying to retrieve text for error ORA-01804 - in %s on line %d -bool(false) diff --git a/ext/oci8/tests/create_table.inc b/ext/oci8/tests/create_table.inc deleted file mode 100644 index 7335980682ea..000000000000 --- a/ext/oci8/tests/create_table.inc +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/ext/oci8/tests/create_type.inc b/ext/oci8/tests/create_type.inc deleted file mode 100644 index 3415e1b9cc1f..000000000000 --- a/ext/oci8/tests/create_type.inc +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/ext/oci8/tests/cursor_bind.phpt b/ext/oci8/tests/cursor_bind.phpt deleted file mode 100644 index 300441bdf5b5..000000000000 --- a/ext/oci8/tests/cursor_bind.phpt +++ /dev/null @@ -1,79 +0,0 @@ ---TEST-- -bind and fetch cursor from a statement ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -bool(false) diff --git a/ext/oci8/tests/cursor_bind_err.phpt b/ext/oci8/tests/cursor_bind_err.phpt deleted file mode 100644 index 60b6410575ef..000000000000 --- a/ext/oci8/tests/cursor_bind_err.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -binding a cursor (with errors) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Warning: oci_bind_by_name(): ORA-01036: %s in %s on line %d - -Warning: oci_fetch_assoc(): ORA-24338: %s in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/cursors.phpt b/ext/oci8/tests/cursors.phpt deleted file mode 100644 index 9556973297e2..000000000000 --- a/ext/oci8/tests/cursors.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -fetching cursor from a statement ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -array(5) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - ["BLOB"]=> - NULL - ["CLOB"]=> - NULL - ["STRING"]=> - NULL -} -bool(true) - -Warning: oci_fetch_assoc(): ORA-01002: fetch out of sequence in %s on line %d -bool(false) -bool(true) -Done diff --git a/ext/oci8/tests/db_op_1.phpt b/ext/oci8/tests/db_op_1.phpt deleted file mode 100644 index bc7e96471ce4..000000000000 --- a/ext/oci8/tests/db_op_1.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -oci_set_db_operation: basic test for end-to-end tracing ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { - die("skip needs to be run as a DBA user"); -} -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 -array(1) { - ["DUMMY"]=> - string(1) "X" -} -array(1) { - ["DBOP_NAME"]=> - string(7) "db_op_1" -} diff --git a/ext/oci8/tests/db_op_2.phpt b/ext/oci8/tests/db_op_2.phpt deleted file mode 100644 index 79ee97b5131e..000000000000 --- a/ext/oci8/tests/db_op_2.phpt +++ /dev/null @@ -1,78 +0,0 @@ ---TEST-- -oci_set_db_operation: test DBOP for end-to-end tracing ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { - die("skip needs to be run as a DBA user"); -} -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -if (!function_exists('oci_set_db_operation')) -{ - die("skip function oci_set_db_operation() does not exist"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 -array(1) { - ["DUMMY"]=> - string(1) "X" -} -array(1) { - ["DUMMY"]=> - string(1) "X" -} -array(1) { - ["DBOP_NAME"]=> - string(9) "db_op_2_b" -} -Test 2 -array(1) { - ["'DBOPTEST'"]=> - string(8) "dboptest" -} -array(2) { - ["SQL_TEXT"]=> - string(42) "select /*+ MONITOR */ 'dboptest' from dual" - ["DBOP_NAME"]=> - NULL -} diff --git a/ext/oci8/tests/dbmsoutput.phpt b/ext/oci8/tests/dbmsoutput.phpt deleted file mode 100644 index 561b65392bd1..000000000000 --- a/ext/oci8/tests/dbmsoutput.phpt +++ /dev/null @@ -1,750 +0,0 @@ ---TEST-- -PL/SQL: dbms_output ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -= $orignumlines) { - oci_bind_array_by_name($s, ":lines", $lines, $numlines, 255, SQLT_CHR); - oci_execute($s); - if ($numlines == 0) { - break; - } - $res = array_merge($res, array_slice($lines, 0, $numlines)); - unset($lines); - } - return $res; -} - -function getdbmsoutput_pl($c) -{ - $s = oci_parse($c, "select * from table(mydofetch())"); - oci_execute($s); - $res = []; - while ($row = oci_fetch_array($s, OCI_NUM)) { - $res[] = $row[0]; - } - return $res; -} - -echo "Test 1\n"; - -setserveroutputon($c); // Turn output buffering on - -$s = oci_parse($c, 'call dbmsoutput_proc()'); -oci_execute($s); -var_dump(getdbmsoutput_do($c)); - -echo "Test 2\n"; - -createoutput($c, 'test 2'); -var_dump(getdbmsoutput_do($c)); - -echo "Test 3\n"; - -createoutput($c, 'test 3'); -var_dump(getdbmsoutput_do2($c)); - -echo "Test 4\n"; - -createoutput($c, 'test 4'); -var_dump(getdbmsoutput_pl($c)); - -// Clean up - -$stmtarray = array( - "drop procedure dbmsoutput_proc" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECT-- -Test 1 -array(1) { - [0]=> - string(12) "Hello World!" -} -Test 2 -array(100) { - [0]=> - string(52) "0 test 2 Hello, world! Lots and lots and ... of text" - [1]=> - string(52) "1 test 2 Hello, world! Lots and lots and ... of text" - [2]=> - string(52) "2 test 2 Hello, world! Lots and lots and ... of text" - [3]=> - string(52) "3 test 2 Hello, world! Lots and lots and ... of text" - [4]=> - string(52) "4 test 2 Hello, world! Lots and lots and ... of text" - [5]=> - string(52) "5 test 2 Hello, world! Lots and lots and ... of text" - [6]=> - string(52) "6 test 2 Hello, world! Lots and lots and ... of text" - [7]=> - string(52) "7 test 2 Hello, world! Lots and lots and ... of text" - [8]=> - string(52) "8 test 2 Hello, world! Lots and lots and ... of text" - [9]=> - string(52) "9 test 2 Hello, world! Lots and lots and ... of text" - [10]=> - string(53) "10 test 2 Hello, world! Lots and lots and ... of text" - [11]=> - string(53) "11 test 2 Hello, world! Lots and lots and ... of text" - [12]=> - string(53) "12 test 2 Hello, world! Lots and lots and ... of text" - [13]=> - string(53) "13 test 2 Hello, world! Lots and lots and ... of text" - [14]=> - string(53) "14 test 2 Hello, world! Lots and lots and ... of text" - [15]=> - string(53) "15 test 2 Hello, world! Lots and lots and ... of text" - [16]=> - string(53) "16 test 2 Hello, world! Lots and lots and ... of text" - [17]=> - string(53) "17 test 2 Hello, world! Lots and lots and ... of text" - [18]=> - string(53) "18 test 2 Hello, world! Lots and lots and ... of text" - [19]=> - string(53) "19 test 2 Hello, world! Lots and lots and ... of text" - [20]=> - string(53) "20 test 2 Hello, world! Lots and lots and ... of text" - [21]=> - string(53) "21 test 2 Hello, world! Lots and lots and ... of text" - [22]=> - string(53) "22 test 2 Hello, world! Lots and lots and ... of text" - [23]=> - string(53) "23 test 2 Hello, world! Lots and lots and ... of text" - [24]=> - string(53) "24 test 2 Hello, world! Lots and lots and ... of text" - [25]=> - string(53) "25 test 2 Hello, world! Lots and lots and ... of text" - [26]=> - string(53) "26 test 2 Hello, world! Lots and lots and ... of text" - [27]=> - string(53) "27 test 2 Hello, world! Lots and lots and ... of text" - [28]=> - string(53) "28 test 2 Hello, world! Lots and lots and ... of text" - [29]=> - string(53) "29 test 2 Hello, world! Lots and lots and ... of text" - [30]=> - string(53) "30 test 2 Hello, world! Lots and lots and ... of text" - [31]=> - string(53) "31 test 2 Hello, world! Lots and lots and ... of text" - [32]=> - string(53) "32 test 2 Hello, world! Lots and lots and ... of text" - [33]=> - string(53) "33 test 2 Hello, world! Lots and lots and ... of text" - [34]=> - string(53) "34 test 2 Hello, world! Lots and lots and ... of text" - [35]=> - string(53) "35 test 2 Hello, world! Lots and lots and ... of text" - [36]=> - string(53) "36 test 2 Hello, world! Lots and lots and ... of text" - [37]=> - string(53) "37 test 2 Hello, world! Lots and lots and ... of text" - [38]=> - string(53) "38 test 2 Hello, world! Lots and lots and ... of text" - [39]=> - string(53) "39 test 2 Hello, world! Lots and lots and ... of text" - [40]=> - string(53) "40 test 2 Hello, world! Lots and lots and ... of text" - [41]=> - string(53) "41 test 2 Hello, world! Lots and lots and ... of text" - [42]=> - string(53) "42 test 2 Hello, world! Lots and lots and ... of text" - [43]=> - string(53) "43 test 2 Hello, world! Lots and lots and ... of text" - [44]=> - string(53) "44 test 2 Hello, world! Lots and lots and ... of text" - [45]=> - string(53) "45 test 2 Hello, world! Lots and lots and ... of text" - [46]=> - string(53) "46 test 2 Hello, world! Lots and lots and ... of text" - [47]=> - string(53) "47 test 2 Hello, world! Lots and lots and ... of text" - [48]=> - string(53) "48 test 2 Hello, world! Lots and lots and ... of text" - [49]=> - string(53) "49 test 2 Hello, world! Lots and lots and ... of text" - [50]=> - string(53) "50 test 2 Hello, world! Lots and lots and ... of text" - [51]=> - string(53) "51 test 2 Hello, world! Lots and lots and ... of text" - [52]=> - string(53) "52 test 2 Hello, world! Lots and lots and ... of text" - [53]=> - string(53) "53 test 2 Hello, world! Lots and lots and ... of text" - [54]=> - string(53) "54 test 2 Hello, world! Lots and lots and ... of text" - [55]=> - string(53) "55 test 2 Hello, world! Lots and lots and ... of text" - [56]=> - string(53) "56 test 2 Hello, world! Lots and lots and ... of text" - [57]=> - string(53) "57 test 2 Hello, world! Lots and lots and ... of text" - [58]=> - string(53) "58 test 2 Hello, world! Lots and lots and ... of text" - [59]=> - string(53) "59 test 2 Hello, world! Lots and lots and ... of text" - [60]=> - string(53) "60 test 2 Hello, world! Lots and lots and ... of text" - [61]=> - string(53) "61 test 2 Hello, world! Lots and lots and ... of text" - [62]=> - string(53) "62 test 2 Hello, world! Lots and lots and ... of text" - [63]=> - string(53) "63 test 2 Hello, world! Lots and lots and ... of text" - [64]=> - string(53) "64 test 2 Hello, world! Lots and lots and ... of text" - [65]=> - string(53) "65 test 2 Hello, world! Lots and lots and ... of text" - [66]=> - string(53) "66 test 2 Hello, world! Lots and lots and ... of text" - [67]=> - string(53) "67 test 2 Hello, world! Lots and lots and ... of text" - [68]=> - string(53) "68 test 2 Hello, world! Lots and lots and ... of text" - [69]=> - string(53) "69 test 2 Hello, world! Lots and lots and ... of text" - [70]=> - string(53) "70 test 2 Hello, world! Lots and lots and ... of text" - [71]=> - string(53) "71 test 2 Hello, world! Lots and lots and ... of text" - [72]=> - string(53) "72 test 2 Hello, world! Lots and lots and ... of text" - [73]=> - string(53) "73 test 2 Hello, world! Lots and lots and ... of text" - [74]=> - string(53) "74 test 2 Hello, world! Lots and lots and ... of text" - [75]=> - string(53) "75 test 2 Hello, world! Lots and lots and ... of text" - [76]=> - string(53) "76 test 2 Hello, world! Lots and lots and ... of text" - [77]=> - string(53) "77 test 2 Hello, world! Lots and lots and ... of text" - [78]=> - string(53) "78 test 2 Hello, world! Lots and lots and ... of text" - [79]=> - string(53) "79 test 2 Hello, world! Lots and lots and ... of text" - [80]=> - string(53) "80 test 2 Hello, world! Lots and lots and ... of text" - [81]=> - string(53) "81 test 2 Hello, world! Lots and lots and ... of text" - [82]=> - string(53) "82 test 2 Hello, world! Lots and lots and ... of text" - [83]=> - string(53) "83 test 2 Hello, world! Lots and lots and ... of text" - [84]=> - string(53) "84 test 2 Hello, world! Lots and lots and ... of text" - [85]=> - string(53) "85 test 2 Hello, world! Lots and lots and ... of text" - [86]=> - string(53) "86 test 2 Hello, world! Lots and lots and ... of text" - [87]=> - string(53) "87 test 2 Hello, world! Lots and lots and ... of text" - [88]=> - string(53) "88 test 2 Hello, world! Lots and lots and ... of text" - [89]=> - string(53) "89 test 2 Hello, world! Lots and lots and ... of text" - [90]=> - string(53) "90 test 2 Hello, world! Lots and lots and ... of text" - [91]=> - string(53) "91 test 2 Hello, world! Lots and lots and ... of text" - [92]=> - string(53) "92 test 2 Hello, world! Lots and lots and ... of text" - [93]=> - string(53) "93 test 2 Hello, world! Lots and lots and ... of text" - [94]=> - string(53) "94 test 2 Hello, world! Lots and lots and ... of text" - [95]=> - string(53) "95 test 2 Hello, world! Lots and lots and ... of text" - [96]=> - string(53) "96 test 2 Hello, world! Lots and lots and ... of text" - [97]=> - string(53) "97 test 2 Hello, world! Lots and lots and ... of text" - [98]=> - string(53) "98 test 2 Hello, world! Lots and lots and ... of text" - [99]=> - string(53) "99 test 2 Hello, world! Lots and lots and ... of text" -} -Test 3 -array(100) { - [0]=> - string(52) "0 test 3 Hello, world! Lots and lots and ... of text" - [1]=> - string(52) "1 test 3 Hello, world! Lots and lots and ... of text" - [2]=> - string(52) "2 test 3 Hello, world! Lots and lots and ... of text" - [3]=> - string(52) "3 test 3 Hello, world! Lots and lots and ... of text" - [4]=> - string(52) "4 test 3 Hello, world! Lots and lots and ... of text" - [5]=> - string(52) "5 test 3 Hello, world! Lots and lots and ... of text" - [6]=> - string(52) "6 test 3 Hello, world! Lots and lots and ... of text" - [7]=> - string(52) "7 test 3 Hello, world! Lots and lots and ... of text" - [8]=> - string(52) "8 test 3 Hello, world! Lots and lots and ... of text" - [9]=> - string(52) "9 test 3 Hello, world! Lots and lots and ... of text" - [10]=> - string(53) "10 test 3 Hello, world! Lots and lots and ... of text" - [11]=> - string(53) "11 test 3 Hello, world! Lots and lots and ... of text" - [12]=> - string(53) "12 test 3 Hello, world! Lots and lots and ... of text" - [13]=> - string(53) "13 test 3 Hello, world! Lots and lots and ... of text" - [14]=> - string(53) "14 test 3 Hello, world! Lots and lots and ... of text" - [15]=> - string(53) "15 test 3 Hello, world! Lots and lots and ... of text" - [16]=> - string(53) "16 test 3 Hello, world! Lots and lots and ... of text" - [17]=> - string(53) "17 test 3 Hello, world! Lots and lots and ... of text" - [18]=> - string(53) "18 test 3 Hello, world! Lots and lots and ... of text" - [19]=> - string(53) "19 test 3 Hello, world! Lots and lots and ... of text" - [20]=> - string(53) "20 test 3 Hello, world! Lots and lots and ... of text" - [21]=> - string(53) "21 test 3 Hello, world! Lots and lots and ... of text" - [22]=> - string(53) "22 test 3 Hello, world! Lots and lots and ... of text" - [23]=> - string(53) "23 test 3 Hello, world! Lots and lots and ... of text" - [24]=> - string(53) "24 test 3 Hello, world! Lots and lots and ... of text" - [25]=> - string(53) "25 test 3 Hello, world! Lots and lots and ... of text" - [26]=> - string(53) "26 test 3 Hello, world! Lots and lots and ... of text" - [27]=> - string(53) "27 test 3 Hello, world! Lots and lots and ... of text" - [28]=> - string(53) "28 test 3 Hello, world! Lots and lots and ... of text" - [29]=> - string(53) "29 test 3 Hello, world! Lots and lots and ... of text" - [30]=> - string(53) "30 test 3 Hello, world! Lots and lots and ... of text" - [31]=> - string(53) "31 test 3 Hello, world! Lots and lots and ... of text" - [32]=> - string(53) "32 test 3 Hello, world! Lots and lots and ... of text" - [33]=> - string(53) "33 test 3 Hello, world! Lots and lots and ... of text" - [34]=> - string(53) "34 test 3 Hello, world! Lots and lots and ... of text" - [35]=> - string(53) "35 test 3 Hello, world! Lots and lots and ... of text" - [36]=> - string(53) "36 test 3 Hello, world! Lots and lots and ... of text" - [37]=> - string(53) "37 test 3 Hello, world! Lots and lots and ... of text" - [38]=> - string(53) "38 test 3 Hello, world! Lots and lots and ... of text" - [39]=> - string(53) "39 test 3 Hello, world! Lots and lots and ... of text" - [40]=> - string(53) "40 test 3 Hello, world! Lots and lots and ... of text" - [41]=> - string(53) "41 test 3 Hello, world! Lots and lots and ... of text" - [42]=> - string(53) "42 test 3 Hello, world! Lots and lots and ... of text" - [43]=> - string(53) "43 test 3 Hello, world! Lots and lots and ... of text" - [44]=> - string(53) "44 test 3 Hello, world! Lots and lots and ... of text" - [45]=> - string(53) "45 test 3 Hello, world! Lots and lots and ... of text" - [46]=> - string(53) "46 test 3 Hello, world! Lots and lots and ... of text" - [47]=> - string(53) "47 test 3 Hello, world! Lots and lots and ... of text" - [48]=> - string(53) "48 test 3 Hello, world! Lots and lots and ... of text" - [49]=> - string(53) "49 test 3 Hello, world! Lots and lots and ... of text" - [50]=> - string(53) "50 test 3 Hello, world! Lots and lots and ... of text" - [51]=> - string(53) "51 test 3 Hello, world! Lots and lots and ... of text" - [52]=> - string(53) "52 test 3 Hello, world! Lots and lots and ... of text" - [53]=> - string(53) "53 test 3 Hello, world! Lots and lots and ... of text" - [54]=> - string(53) "54 test 3 Hello, world! Lots and lots and ... of text" - [55]=> - string(53) "55 test 3 Hello, world! Lots and lots and ... of text" - [56]=> - string(53) "56 test 3 Hello, world! Lots and lots and ... of text" - [57]=> - string(53) "57 test 3 Hello, world! Lots and lots and ... of text" - [58]=> - string(53) "58 test 3 Hello, world! Lots and lots and ... of text" - [59]=> - string(53) "59 test 3 Hello, world! Lots and lots and ... of text" - [60]=> - string(53) "60 test 3 Hello, world! Lots and lots and ... of text" - [61]=> - string(53) "61 test 3 Hello, world! Lots and lots and ... of text" - [62]=> - string(53) "62 test 3 Hello, world! Lots and lots and ... of text" - [63]=> - string(53) "63 test 3 Hello, world! Lots and lots and ... of text" - [64]=> - string(53) "64 test 3 Hello, world! Lots and lots and ... of text" - [65]=> - string(53) "65 test 3 Hello, world! Lots and lots and ... of text" - [66]=> - string(53) "66 test 3 Hello, world! Lots and lots and ... of text" - [67]=> - string(53) "67 test 3 Hello, world! Lots and lots and ... of text" - [68]=> - string(53) "68 test 3 Hello, world! Lots and lots and ... of text" - [69]=> - string(53) "69 test 3 Hello, world! Lots and lots and ... of text" - [70]=> - string(53) "70 test 3 Hello, world! Lots and lots and ... of text" - [71]=> - string(53) "71 test 3 Hello, world! Lots and lots and ... of text" - [72]=> - string(53) "72 test 3 Hello, world! Lots and lots and ... of text" - [73]=> - string(53) "73 test 3 Hello, world! Lots and lots and ... of text" - [74]=> - string(53) "74 test 3 Hello, world! Lots and lots and ... of text" - [75]=> - string(53) "75 test 3 Hello, world! Lots and lots and ... of text" - [76]=> - string(53) "76 test 3 Hello, world! Lots and lots and ... of text" - [77]=> - string(53) "77 test 3 Hello, world! Lots and lots and ... of text" - [78]=> - string(53) "78 test 3 Hello, world! Lots and lots and ... of text" - [79]=> - string(53) "79 test 3 Hello, world! Lots and lots and ... of text" - [80]=> - string(53) "80 test 3 Hello, world! Lots and lots and ... of text" - [81]=> - string(53) "81 test 3 Hello, world! Lots and lots and ... of text" - [82]=> - string(53) "82 test 3 Hello, world! Lots and lots and ... of text" - [83]=> - string(53) "83 test 3 Hello, world! Lots and lots and ... of text" - [84]=> - string(53) "84 test 3 Hello, world! Lots and lots and ... of text" - [85]=> - string(53) "85 test 3 Hello, world! Lots and lots and ... of text" - [86]=> - string(53) "86 test 3 Hello, world! Lots and lots and ... of text" - [87]=> - string(53) "87 test 3 Hello, world! Lots and lots and ... of text" - [88]=> - string(53) "88 test 3 Hello, world! Lots and lots and ... of text" - [89]=> - string(53) "89 test 3 Hello, world! Lots and lots and ... of text" - [90]=> - string(53) "90 test 3 Hello, world! Lots and lots and ... of text" - [91]=> - string(53) "91 test 3 Hello, world! Lots and lots and ... of text" - [92]=> - string(53) "92 test 3 Hello, world! Lots and lots and ... of text" - [93]=> - string(53) "93 test 3 Hello, world! Lots and lots and ... of text" - [94]=> - string(53) "94 test 3 Hello, world! Lots and lots and ... of text" - [95]=> - string(53) "95 test 3 Hello, world! Lots and lots and ... of text" - [96]=> - string(53) "96 test 3 Hello, world! Lots and lots and ... of text" - [97]=> - string(53) "97 test 3 Hello, world! Lots and lots and ... of text" - [98]=> - string(53) "98 test 3 Hello, world! Lots and lots and ... of text" - [99]=> - string(53) "99 test 3 Hello, world! Lots and lots and ... of text" -} -Test 4 -array(100) { - [0]=> - string(52) "0 test 4 Hello, world! Lots and lots and ... of text" - [1]=> - string(52) "1 test 4 Hello, world! Lots and lots and ... of text" - [2]=> - string(52) "2 test 4 Hello, world! Lots and lots and ... of text" - [3]=> - string(52) "3 test 4 Hello, world! Lots and lots and ... of text" - [4]=> - string(52) "4 test 4 Hello, world! Lots and lots and ... of text" - [5]=> - string(52) "5 test 4 Hello, world! Lots and lots and ... of text" - [6]=> - string(52) "6 test 4 Hello, world! Lots and lots and ... of text" - [7]=> - string(52) "7 test 4 Hello, world! Lots and lots and ... of text" - [8]=> - string(52) "8 test 4 Hello, world! Lots and lots and ... of text" - [9]=> - string(52) "9 test 4 Hello, world! Lots and lots and ... of text" - [10]=> - string(53) "10 test 4 Hello, world! Lots and lots and ... of text" - [11]=> - string(53) "11 test 4 Hello, world! Lots and lots and ... of text" - [12]=> - string(53) "12 test 4 Hello, world! Lots and lots and ... of text" - [13]=> - string(53) "13 test 4 Hello, world! Lots and lots and ... of text" - [14]=> - string(53) "14 test 4 Hello, world! Lots and lots and ... of text" - [15]=> - string(53) "15 test 4 Hello, world! Lots and lots and ... of text" - [16]=> - string(53) "16 test 4 Hello, world! Lots and lots and ... of text" - [17]=> - string(53) "17 test 4 Hello, world! Lots and lots and ... of text" - [18]=> - string(53) "18 test 4 Hello, world! Lots and lots and ... of text" - [19]=> - string(53) "19 test 4 Hello, world! Lots and lots and ... of text" - [20]=> - string(53) "20 test 4 Hello, world! Lots and lots and ... of text" - [21]=> - string(53) "21 test 4 Hello, world! Lots and lots and ... of text" - [22]=> - string(53) "22 test 4 Hello, world! Lots and lots and ... of text" - [23]=> - string(53) "23 test 4 Hello, world! Lots and lots and ... of text" - [24]=> - string(53) "24 test 4 Hello, world! Lots and lots and ... of text" - [25]=> - string(53) "25 test 4 Hello, world! Lots and lots and ... of text" - [26]=> - string(53) "26 test 4 Hello, world! Lots and lots and ... of text" - [27]=> - string(53) "27 test 4 Hello, world! Lots and lots and ... of text" - [28]=> - string(53) "28 test 4 Hello, world! Lots and lots and ... of text" - [29]=> - string(53) "29 test 4 Hello, world! Lots and lots and ... of text" - [30]=> - string(53) "30 test 4 Hello, world! Lots and lots and ... of text" - [31]=> - string(53) "31 test 4 Hello, world! Lots and lots and ... of text" - [32]=> - string(53) "32 test 4 Hello, world! Lots and lots and ... of text" - [33]=> - string(53) "33 test 4 Hello, world! Lots and lots and ... of text" - [34]=> - string(53) "34 test 4 Hello, world! Lots and lots and ... of text" - [35]=> - string(53) "35 test 4 Hello, world! Lots and lots and ... of text" - [36]=> - string(53) "36 test 4 Hello, world! Lots and lots and ... of text" - [37]=> - string(53) "37 test 4 Hello, world! Lots and lots and ... of text" - [38]=> - string(53) "38 test 4 Hello, world! Lots and lots and ... of text" - [39]=> - string(53) "39 test 4 Hello, world! Lots and lots and ... of text" - [40]=> - string(53) "40 test 4 Hello, world! Lots and lots and ... of text" - [41]=> - string(53) "41 test 4 Hello, world! Lots and lots and ... of text" - [42]=> - string(53) "42 test 4 Hello, world! Lots and lots and ... of text" - [43]=> - string(53) "43 test 4 Hello, world! Lots and lots and ... of text" - [44]=> - string(53) "44 test 4 Hello, world! Lots and lots and ... of text" - [45]=> - string(53) "45 test 4 Hello, world! Lots and lots and ... of text" - [46]=> - string(53) "46 test 4 Hello, world! Lots and lots and ... of text" - [47]=> - string(53) "47 test 4 Hello, world! Lots and lots and ... of text" - [48]=> - string(53) "48 test 4 Hello, world! Lots and lots and ... of text" - [49]=> - string(53) "49 test 4 Hello, world! Lots and lots and ... of text" - [50]=> - string(53) "50 test 4 Hello, world! Lots and lots and ... of text" - [51]=> - string(53) "51 test 4 Hello, world! Lots and lots and ... of text" - [52]=> - string(53) "52 test 4 Hello, world! Lots and lots and ... of text" - [53]=> - string(53) "53 test 4 Hello, world! Lots and lots and ... of text" - [54]=> - string(53) "54 test 4 Hello, world! Lots and lots and ... of text" - [55]=> - string(53) "55 test 4 Hello, world! Lots and lots and ... of text" - [56]=> - string(53) "56 test 4 Hello, world! Lots and lots and ... of text" - [57]=> - string(53) "57 test 4 Hello, world! Lots and lots and ... of text" - [58]=> - string(53) "58 test 4 Hello, world! Lots and lots and ... of text" - [59]=> - string(53) "59 test 4 Hello, world! Lots and lots and ... of text" - [60]=> - string(53) "60 test 4 Hello, world! Lots and lots and ... of text" - [61]=> - string(53) "61 test 4 Hello, world! Lots and lots and ... of text" - [62]=> - string(53) "62 test 4 Hello, world! Lots and lots and ... of text" - [63]=> - string(53) "63 test 4 Hello, world! Lots and lots and ... of text" - [64]=> - string(53) "64 test 4 Hello, world! Lots and lots and ... of text" - [65]=> - string(53) "65 test 4 Hello, world! Lots and lots and ... of text" - [66]=> - string(53) "66 test 4 Hello, world! Lots and lots and ... of text" - [67]=> - string(53) "67 test 4 Hello, world! Lots and lots and ... of text" - [68]=> - string(53) "68 test 4 Hello, world! Lots and lots and ... of text" - [69]=> - string(53) "69 test 4 Hello, world! Lots and lots and ... of text" - [70]=> - string(53) "70 test 4 Hello, world! Lots and lots and ... of text" - [71]=> - string(53) "71 test 4 Hello, world! Lots and lots and ... of text" - [72]=> - string(53) "72 test 4 Hello, world! Lots and lots and ... of text" - [73]=> - string(53) "73 test 4 Hello, world! Lots and lots and ... of text" - [74]=> - string(53) "74 test 4 Hello, world! Lots and lots and ... of text" - [75]=> - string(53) "75 test 4 Hello, world! Lots and lots and ... of text" - [76]=> - string(53) "76 test 4 Hello, world! Lots and lots and ... of text" - [77]=> - string(53) "77 test 4 Hello, world! Lots and lots and ... of text" - [78]=> - string(53) "78 test 4 Hello, world! Lots and lots and ... of text" - [79]=> - string(53) "79 test 4 Hello, world! Lots and lots and ... of text" - [80]=> - string(53) "80 test 4 Hello, world! Lots and lots and ... of text" - [81]=> - string(53) "81 test 4 Hello, world! Lots and lots and ... of text" - [82]=> - string(53) "82 test 4 Hello, world! Lots and lots and ... of text" - [83]=> - string(53) "83 test 4 Hello, world! Lots and lots and ... of text" - [84]=> - string(53) "84 test 4 Hello, world! Lots and lots and ... of text" - [85]=> - string(53) "85 test 4 Hello, world! Lots and lots and ... of text" - [86]=> - string(53) "86 test 4 Hello, world! Lots and lots and ... of text" - [87]=> - string(53) "87 test 4 Hello, world! Lots and lots and ... of text" - [88]=> - string(53) "88 test 4 Hello, world! Lots and lots and ... of text" - [89]=> - string(53) "89 test 4 Hello, world! Lots and lots and ... of text" - [90]=> - string(53) "90 test 4 Hello, world! Lots and lots and ... of text" - [91]=> - string(53) "91 test 4 Hello, world! Lots and lots and ... of text" - [92]=> - string(53) "92 test 4 Hello, world! Lots and lots and ... of text" - [93]=> - string(53) "93 test 4 Hello, world! Lots and lots and ... of text" - [94]=> - string(53) "94 test 4 Hello, world! Lots and lots and ... of text" - [95]=> - string(53) "95 test 4 Hello, world! Lots and lots and ... of text" - [96]=> - string(53) "96 test 4 Hello, world! Lots and lots and ... of text" - [97]=> - string(53) "97 test 4 Hello, world! Lots and lots and ... of text" - [98]=> - string(53) "98 test 4 Hello, world! Lots and lots and ... of text" - [99]=> - string(53) "99 test 4 Hello, world! Lots and lots and ... of text" -} diff --git a/ext/oci8/tests/default_prefetch0.phpt b/ext/oci8/tests/default_prefetch0.phpt deleted file mode 100644 index 469e44a5f9c3..000000000000 --- a/ext/oci8/tests/default_prefetch0.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -oci8.default_prefetch ini option ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.default_prefetch=20 ---FILE-- - ---EXPECT-- -bool(true) -int(1) -Done diff --git a/ext/oci8/tests/default_prefetch1.phpt b/ext/oci8/tests/default_prefetch1.phpt deleted file mode 100644 index 31241b4bbf24..000000000000 --- a/ext/oci8/tests/default_prefetch1.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -oci8.default_prefetch ini option ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.default_prefetch=100 ---FILE-- - ---EXPECT-- -bool(true) -int(1) -Done diff --git a/ext/oci8/tests/default_prefetch2.phpt b/ext/oci8/tests/default_prefetch2.phpt deleted file mode 100644 index 0222ebe9d2e7..000000000000 --- a/ext/oci8/tests/default_prefetch2.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -oci8.default_prefetch ini option ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.default_prefetch=100 ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -int(1) -Done diff --git a/ext/oci8/tests/define.phpt b/ext/oci8/tests/define.phpt deleted file mode 100644 index 5214acfc42c8..000000000000 --- a/ext/oci8/tests/define.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -oci_define_by_name() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(%d) "some" -Done diff --git a/ext/oci8/tests/define0.phpt b/ext/oci8/tests/define0.phpt deleted file mode 100644 index 8ca327506cb7..000000000000 --- a/ext/oci8/tests/define0.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -oci_define_by_name() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Test 1 -string(%d) "some" -Test 2 -string(%d) "some" diff --git a/ext/oci8/tests/define1.phpt b/ext/oci8/tests/define1.phpt deleted file mode 100644 index 1b53c0e1da88..000000000000 --- a/ext/oci8/tests/define1.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -oci_define_by_name() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- -getMessage(), "\n"; -} - -oci_execute($stmt); - -while (oci_fetch($stmt)) { - var_dump($string); -} - -// Cleanup - -$stmtarray = array( - "drop table define1_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -echo "Done\n"; - -?> ---EXPECT-- -bool(true) -bool(false) -oci_define_by_name(): Argument #2 ($column) cannot be empty -string(4) "some" -Done diff --git a/ext/oci8/tests/define2.phpt b/ext/oci8/tests/define2.phpt deleted file mode 100644 index 92c68e3df229..000000000000 --- a/ext/oci8/tests/define2.phpt +++ /dev/null @@ -1,102 +0,0 @@ ---TEST-- -Test oci_define_by_name types ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -string(32) "88b274d7a257ac6f70435b83abd4e26e" -Test 1 -bool(true) -string(300) "GIF89%s" -file md5:88b274d7a257ac6f70435b83abd4e26e -Test 2 -bool(true) -string(300) "GIF89%s" -file md5:88b274d7a257ac6f70435b83abd4e26e -Test 3 - test repeatability -bool(true) -string(600) "47494638396178004300E66A007F82B839374728252ACCCDE2A1A4CBD3D5E7B2B4D44342588386B98283B35252729092C2C2C4DEAAACD04C4B635B5C83DDDEEC3B383C6E71A56A6D9D61638D7579B17B7EB5E5E6F0999CC68C8DC1B9BAD96B6B924E4E6B7174A97A7AA3888BBD7274A37473988E90C15A5B7EE2E3EF7B7DADA4A5D06D70A27276AC9596C8BBBDD97478AE8588BB9295C3D8D9EA9292C46466926B6E9FA5A8CE9496C52E2B2F535168B3B4D76C6A8C5C5B768A8DBF666896686A9A9C9FC8312E39AEB0D39C9CCD5556789EA1CA9699C58182AF6769973F3D50BCBEDA5E60899899C88C8EBF898ABA57587CB6B7D7D5D7E8221E206C6F9ECED0E4BFC0DC777BB47678A75F5E7D9999CC6E6F987377AE221E1FFFFFFF908E8F595657C7C6C7EEEEF5D5D4D5F6F6" -file md5:80bb3201e2a8bdcb8ab3e1a44a82bb8a -Test 4 - wrong type -bool(true) - -Warning: oci_fetch(): ORA-00932: inconsistent datatypes%s on line %d -Done diff --git a/ext/oci8/tests/define3.phpt b/ext/oci8/tests/define3.phpt deleted file mode 100644 index 1cbe753a364c..000000000000 --- a/ext/oci8/tests/define3.phpt +++ /dev/null @@ -1,117 +0,0 @@ ---TEST-- -Test oci_define_by_name() LOB descriptor ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -saveFile(__DIR__."/test.gif"); -$data = $fileimage->load(); -var_dump(md5($data)); // original md5 -oci_commit($c); - -// New row with different data -$id = 2; -$data = strrev($data); -var_dump(md5($data)); -oci_execute($stmt, OCI_DEFAULT); -$fileimage->save($data); -oci_commit($c); - -echo "Test 1\n"; -$stmt = oci_parse($c, "SELECT fileimage FROM phpdefblobtable"); -var_dump(oci_define_by_name($stmt, 'FILEIMAGE', $f)); -oci_execute($stmt); - -while (oci_fetch($stmt)) { - var_dump($f); - echo "file md5:" . md5($f->load()) . "\n"; -} - -echo "Test 2\n"; -$stmt = oci_parse($c, "SELECT fileimage FROM phpdefblobtable"); -var_dump(oci_define_by_name($stmt, 'FILEIMAGE', $outdata, SQLT_STR)); -oci_execute($stmt); - -while (oci_fetch($stmt)) { - echo "file md5:" . md5($outdata) . "\n"; -} - -echo "Test 3\n"; -$stmt = oci_parse($c, "SELECT fileimage FROM phpdefblobtable"); -var_dump(oci_define_by_name($stmt, 'FILEIMAGE', $outdata, SQLT_BIN)); -oci_execute($stmt); - -while (oci_fetch($stmt)) { - echo "file md5:" . md5($outdata) . "\n"; -} - -echo "Test 4\n"; -$fid = oci_new_descriptor($c,OCI_D_LOB); -$stmt = oci_parse($c, "SELECT fileimage FROM phpdefblobtable"); -var_dump(oci_define_by_name($stmt, 'FILEIMAGE', $fid)); -oci_execute($stmt); - -while (oci_fetch($stmt)) { - echo "file md5:" . md5($fid->load()) . "\n"; -} - -$stmtarray = array( - "drop table phpdefblobtable" -); - -oci8_test_sql_execute($c, $stmtarray); - -echo "Done\n"; - -?> ---EXPECTF-- -string(32) "614fcbba1effb7caa27ef0ef25c27fcf" -string(32) "06d4f219d946c74d748d43932cd9dcb2" -Test 1 -bool(true) -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -file md5:614fcbba1effb7caa27ef0ef25c27fcf -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -file md5:06d4f219d946c74d748d43932cd9dcb2 -Test 2 -bool(true) - -Warning: oci_fetch(): ORA-00932: %s on line %d -Test 3 -bool(true) -file md5:614fcbba1effb7caa27ef0ef25c27fcf -file md5:06d4f219d946c74d748d43932cd9dcb2 -Test 4 -bool(true) -file md5:614fcbba1effb7caa27ef0ef25c27fcf -file md5:06d4f219d946c74d748d43932cd9dcb2 -Done diff --git a/ext/oci8/tests/define4.phpt b/ext/oci8/tests/define4.phpt deleted file mode 100644 index 73e363c78cef..000000000000 --- a/ext/oci8/tests/define4.phpt +++ /dev/null @@ -1,79 +0,0 @@ ---TEST-- -oci_define_by_name() on partial number of columns ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- -getMessage()); -} -// Cleanup - -$stmtarray = array( - "drop table define4_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -echo "Done\n"; - -?> ---EXPECTF-- -Test 1 -bool(true) -Test 2 -string(4) "1234" -string(4) "some" -string(4) "some" -string(4) "some" -string(4) "1234" -string(4) "some" -Test 3 -bool(true) -string(4) "some" -string(%d) "oci_result(): supplied resource is not a valid oci8 statement resource" -Done diff --git a/ext/oci8/tests/define5.phpt b/ext/oci8/tests/define5.phpt deleted file mode 100644 index 9cd19fe10c6b..000000000000 --- a/ext/oci8/tests/define5.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -oci_define_by_name() for statement re-execution ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 - must do define before execute -bool(true) -NULL -string(4) "some" -Test 2 - normal define order -bool(true) -string(4) "some" -Test 3 - no new define done -string(4) "some" -string(5) "thing" -Done diff --git a/ext/oci8/tests/define6.phpt b/ext/oci8/tests/define6.phpt deleted file mode 100644 index dc2bb19f2f81..000000000000 --- a/ext/oci8/tests/define6.phpt +++ /dev/null @@ -1,138 +0,0 @@ ---TEST-- -oci_define_by_name tests with REF CURSORs ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -Test 1 - define last -NULL -Test 2 - define last with preset var -string(0) "" -Test 3 - define before cursor execute -string(1) "1" -Test 4 - define before top level execute -string(1) "1" -Test 5 - define before bind -string(1) "1" -Test 6 - fetch on wrong handle - -Warning: oci_fetch_row(): ORA-24374: %s in %sdefine6.php on line %d diff --git a/ext/oci8/tests/descriptors.phpt b/ext/oci8/tests/descriptors.phpt deleted file mode 100644 index 6ac0b0ce0560..000000000000 --- a/ext/oci8/tests/descriptors.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -commit connection after destroying the descriptor ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -array(1) { - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -Done diff --git a/ext/oci8/tests/details.inc b/ext/oci8/tests/details.inc deleted file mode 100644 index 0040baace777..000000000000 --- a/ext/oci8/tests/details.inc +++ /dev/null @@ -1,78 +0,0 @@ - \ No newline at end of file diff --git a/ext/oci8/tests/drcp_cclass1.phpt b/ext/oci8/tests/drcp_cclass1.phpt deleted file mode 100644 index e71284a67cac..000000000000 --- a/ext/oci8/tests/drcp_cclass1.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -DRCP: Test setting connection class inline ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12) { - $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual"); - $r = @oci_execute($s); - if (!$r) - die('skip could not identify container type'); - $r = oci_fetch_array($s); - if ($r['DBTYPE'] !== 'CDB$ROOT') - die('skip cannot run test using a PDB'); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 -array(1) { - ["DUMMY"]=> - array(1) { - [0]=> - string(1) "X" - } -} -Test 2 -array(1) { - ["DUMMY"]=> - array(1) { - [0]=> - string(1) "X" - } -} -Test 3 -array(1) { - ["CCLASS_NAME"]=> - array(2) { - [0]=> - string(21) "%s.cc1_%d" - [1]=> - string(21) "%s.cc2_%d" - } -} -Done diff --git a/ext/oci8/tests/drcp_characterset.phpt b/ext/oci8/tests/drcp_characterset.phpt deleted file mode 100644 index a3039e34354a..000000000000 --- a/ext/oci8/tests/drcp_characterset.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -DRCP: oci_pconnect() and oci_connect() with different character sets ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 persistent connection) -First and third connections are different: OK -Second and fourth connections are different: OK -Done diff --git a/ext/oci8/tests/drcp_conn_close1.phpt b/ext/oci8/tests/drcp_conn_close1.phpt deleted file mode 100644 index 40cab13ce9a1..000000000000 --- a/ext/oci8/tests/drcp_conn_close1.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -DRCP: oci_connect() with oci_close() and oci8.old_oci_close_semantics ON ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=1 -oci8.connection_class=test ---FILE-- - ---EXPECTF-- -Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s -This is with a OCI_CONNECT -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -Both connections share a resource : OK -Done diff --git a/ext/oci8/tests/drcp_conn_close2.phpt b/ext/oci8/tests/drcp_conn_close2.phpt deleted file mode 100644 index 289c215dc2db..000000000000 --- a/ext/oci8/tests/drcp_conn_close2.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -DRCP: oci_connect() with oci_close() and oci8.old_oci_close_semantics OFF ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=0 -oci8.connection_class=test ---FILE-- - ---EXPECTF-- -This is with a OCI_CONNECT -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -Both connections are different : OK -Done diff --git a/ext/oci8/tests/drcp_connect1.phpt b/ext/oci8/tests/drcp_connect1.phpt deleted file mode 100644 index 3a40da9bf707..000000000000 --- a/ext/oci8/tests/drcp_connect1.phpt +++ /dev/null @@ -1,102 +0,0 @@ ---TEST-- -DRCP: oci_connect() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs (Calling PL/SQL from SQL is not supported in TimesTen) -require __DIR__.'/skipif.inc'; -?> ---INI-- -oci8.connection_class=test -oci8.old_oci_close_semantics=0 ---FILE-- - ---EXPECTF-- -Test 1a -resource(%d) of type (oci8 connection) -Test 1b - This is with OCI_CONNECT..... - The value of the package variable is 0 - Package variable value set to 1000 - Connection conn1 closed.... -Test 2 -resource(%d) of type (oci8 connection) - Select with connection 2 - The value of the package variable is 0 - Package variable value set to 100 -Test 3 -resource(%d) of type (oci8 connection) - Select with connection 3 - The value of the package variable is 100 -Test 4 - This is with oci_pconnect()..... -resource(%d) of type (oci8 persistent connection) - Package variable value set to 1000 - Connection pconn1 closed.... -Test 5 -resource(%d) of type (oci8 persistent connection) - Select with persistent connection 2 - The value of the package variable is 1000 -Done diff --git a/ext/oci8/tests/drcp_connection_class.phpt b/ext/oci8/tests/drcp_connection_class.phpt deleted file mode 100644 index e9d5fb0207cb..000000000000 --- a/ext/oci8/tests/drcp_connection_class.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -DRCP: oci8.connection_class with ini_get() and ini_set() ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 11)) { - die("skip works only with Oracle 11g or greater version of Oracle client libraries"); -} -?> ---INI-- -oci8.connection_class=test ---FILE-- - ---EXPECT-- -Setting a new connection class now -The New oci8.connection_class is New cc -Done diff --git a/ext/oci8/tests/drcp_functions.inc b/ext/oci8/tests/drcp_functions.inc deleted file mode 100644 index 595f82da1f2c..000000000000 --- a/ext/oci8/tests/drcp_functions.inc +++ /dev/null @@ -1,93 +0,0 @@ - diff --git a/ext/oci8/tests/drcp_newconnect.phpt b/ext/oci8/tests/drcp_newconnect.phpt deleted file mode 100644 index 7bdf7d785a95..000000000000 --- a/ext/oci8/tests/drcp_newconnect.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DRCP: oci_new_connect() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.connection_class=test -oci8.old_oci_close_semantics=0 ---FILE-- - ---EXPECTF-- -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -First and second connections are different OK -Done diff --git a/ext/oci8/tests/drcp_pconn_close1.phpt b/ext/oci8/tests/drcp_pconn_close1.phpt deleted file mode 100644 index 8c81e4646301..000000000000 --- a/ext/oci8/tests/drcp_pconn_close1.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -DRCP: oci_pconnect() with oci_close() and oci8.old_oci_close_semantics ON ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=1 -oci8.connection_class=test ---FILE-- - ---EXPECTF-- -Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s -This is with a OCI_PCONNECT -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 persistent connection) -Both connections share a resource : OK -Done diff --git a/ext/oci8/tests/drcp_pconn_close2.phpt b/ext/oci8/tests/drcp_pconn_close2.phpt deleted file mode 100644 index dcc14c8cc99d..000000000000 --- a/ext/oci8/tests/drcp_pconn_close2.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -DRCP: oci_pconnect() with oci_close() and oci8.old_oci_close_semantics OFF ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=0 -oci8.connection_class=test ---FILE-- - ---EXPECTF-- -This is with a OCI_PCONNECT -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 persistent connection) -Both connections are different : OK -Done diff --git a/ext/oci8/tests/drcp_privileged.phpt b/ext/oci8/tests/drcp_privileged.phpt deleted file mode 100644 index cb126605466c..000000000000 --- a/ext/oci8/tests/drcp_privileged.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -DRCP: privileged connect ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 12) { - $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual"); - $r = @oci_execute($s); - if (!$r) - die('skip could not identify container type'); - $r = oci_fetch_array($s); - if ($r['DBTYPE'] !== 'CDB$ROOT') - die('skip cannot run test using a PDB'); -} -?> ---INI-- -oci8.privileged_connect=1 ---FILE-- - ---EXPECTF-- -Warning: oci_connect(): ORA-01031: %s in %s on line %d -bool(false) - -Warning: oci_connect(): ORA-01031: %s in %s on line %d -bool(false) - -Warning: oci_new_connect(): ORA-01031: %s in %s on line %d -bool(false) - -Warning: oci_new_connect(): ORA-01031: %s in %s on line %d -bool(false) - -Warning: oci_pconnect(): ORA-01031: %s in %s on line %d -bool(false) - -Warning: oci_pconnect(): ORA-01031: %s in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/drcp_scope1.phpt b/ext/oci8/tests/drcp_scope1.phpt deleted file mode 100644 index e770aefb1711..000000000000 --- a/ext/oci8/tests/drcp_scope1.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -DRCP: oci_new_connect() and oci_connect() with scope end when oci8.old_oci_close_semantics ON ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=1 ---FILE-- - ---EXPECTF-- -Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s -This is with a OCI_NEW_CONNECT -resource(%d) of type (oci8 connection) -Update done-- DEPT value has been set to NEWDEPT -resource(%d) of type (oci8 connection) -The value of DEPT for id 105 is HR - - -This is with a OCI_CONNECT -resource(%d) of type (oci8 connection) -Update done-- DEPT value has been set to NEWDEPT -resource(%d) of type (oci8 connection) -The value of DEPT for id 105 is HR -Done diff --git a/ext/oci8/tests/drcp_scope2.phpt b/ext/oci8/tests/drcp_scope2.phpt deleted file mode 100644 index 8eece242d2fa..000000000000 --- a/ext/oci8/tests/drcp_scope2.phpt +++ /dev/null @@ -1,95 +0,0 @@ ---TEST-- -DRCP: oci_new_connect() and oci_connect with scope end when oci8.old_oci_close_semantics OFF ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=0 ---FILE-- - ---EXPECTF-- -This is with a OCI_NEW_CONNECT -resource(%d) of type (oci8 connection) -Update done-- DEPT value has been set to NEWDEPT -resource(%d) of type (oci8 connection) -The value of DEPT for id 105 is HR - - -This is with a OCI_CONNECT -resource(%d) of type (oci8 connection) -Update done-- DEPT value has been set to NEWDEPT -resource(%d) of type (oci8 connection) -The value of DEPT for id 105 is HR -Done diff --git a/ext/oci8/tests/drcp_scope3.phpt b/ext/oci8/tests/drcp_scope3.phpt deleted file mode 100644 index bf8a2729095a..000000000000 --- a/ext/oci8/tests/drcp_scope3.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -DRCP: oci_pconnect() with scope end when oci8.old_oci_close_semantics ON ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=1 ---FILE-- - ---EXPECTF-- -Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s -This is with a OCI_PCONNECT -resource(%d) of type (oci8 persistent connection) -Update done-- DEPT value has been set to NEWDEPT -resource(%d) of type (oci8 persistent connection) -The value of DEPT for id 105 is NEWDEPT - -Warning: oci_execute(): ORA-00054: %s -Done diff --git a/ext/oci8/tests/drcp_scope4.phpt b/ext/oci8/tests/drcp_scope4.phpt deleted file mode 100644 index 15bd778bdf4f..000000000000 --- a/ext/oci8/tests/drcp_scope4.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -DRCP: oci_pconnect() with scope end when oci8.old_oci_close_semantics OFF ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=0 ---FILE-- - ---EXPECTF-- -This is with a OCI_PCONNECT -resource(%d) of type (oci8 persistent connection) -Update done-- DEPT value has been set to NEWDEPT -resource(%d) of type (oci8 persistent connection) -The value of DEPT for id 105 is HR -Done diff --git a/ext/oci8/tests/drcp_scope5.phpt b/ext/oci8/tests/drcp_scope5.phpt deleted file mode 100644 index 733ac8a84756..000000000000 --- a/ext/oci8/tests/drcp_scope5.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -DRCP: oci_pconnect() with scope end when oci8.old_oci_close_semantics ON ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=1 ---FILE-- - ---EXPECTF-- -Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s -This is with a OCI_PCONNECT -resource(%d) of type (oci8 persistent connection) -Update done-- DEPT value has been set to NEWDEPT -resource(%d) of type (oci8 persistent connection) -The value of DEPT for id 105 is NEWDEPT -Done diff --git a/ext/oci8/tests/driver_name.phpt b/ext/oci8/tests/driver_name.phpt deleted file mode 100644 index 0e72c98f8c2b..000000000000 --- a/ext/oci8/tests/driver_name.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -Verify that the Driver Name attribute is set ---EXTENSIONS-- -oci8 ---SKIPIF-- - 12 || - ($matches[1] == 12 && $matches[2] == 1 && $matches[3] >= 0 - && $matches[4] >= 2) || ($matches[1] == 12 && $matches[2] > 1)))) { - die("skip test expected to work only with Oracle 12.1.0.2 database or its later patchsets"); -} - -preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); -if (!(isset($matches[0]) && ($matches[1] == 11 && $matches[2] >= 2) || ($matches[1] > 11))) { - die("skip test expected to work only with Oracle 11.2 or greater version of client"); -} - -?> ---FILE-- - ---EXPECT-- -**Test 1.1 - Default values for the attribute ************** -The value of DRIVER_NAME is PHP OCI8 : 3.3.0 - -***Test 1.2 - Get the values from different connections ************** -Testing with oci_pconnect() -The value of DRIVER_NAME is PHP OCI8 : 3.3.0 -Testing with oci_new_connect() -The value of DRIVER_NAME is PHP OCI8 : 3.3.0 -Done diff --git a/ext/oci8/tests/driver_name_11gR2.phpt b/ext/oci8/tests/driver_name_11gR2.phpt deleted file mode 100644 index a91855c87426..000000000000 --- a/ext/oci8/tests/driver_name_11gR2.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -Verify that the Driver Name attribute is set ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 2))) { - die("skip expected output only valid when using Oracle 11.2 database or its later patchsets"); -} -preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); -if (!(isset($matches[0]) && ($matches[1] == 11 && $matches[2] >= 2) || ($matches[1] > 11))) { - die("skip test expected to work only with Oracle 11.2 or greater version of client"); -} - -?> ---FILE-- - ---EXPECT-- -**Test 1.1 - Default values for the attribute ************** -The value of DRIVER_NAME is PHP OCI8 - -***Test 1.2 - Get the values from different connections ************** -Testing with oci_pconnect() -The value of DRIVER_NAME is PHP OCI8 -Testing with oci_new_connect() -The value of DRIVER_NAME is PHP OCI8 -Done diff --git a/ext/oci8/tests/drop_table.inc b/ext/oci8/tests/drop_table.inc deleted file mode 100644 index b45330bf66c8..000000000000 --- a/ext/oci8/tests/drop_table.inc +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/ext/oci8/tests/drop_type.inc b/ext/oci8/tests/drop_type.inc deleted file mode 100644 index 98542a808593..000000000000 --- a/ext/oci8/tests/drop_type.inc +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/ext/oci8/tests/dupcolnames.phpt b/ext/oci8/tests/dupcolnames.phpt deleted file mode 100644 index 64b4514865e9..000000000000 --- a/ext/oci8/tests/dupcolnames.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -SELECT tests with duplicate column anmes ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 - OCI_ASSOC -array(3) { - ["C1"]=> - string(1) "1" - ["DUPNAMECOL"]=> - string(5) "jones" - ["C2"]=> - string(1) "2" -} - -Test 2 - OCI_NUM -array(4) { - [0]=> - string(1) "1" - [1]=> - string(5) "chris" - [2]=> - string(1) "2" - [3]=> - string(5) "jones" -} - -Test 3 - OCI_ASSOC+OCI_NUM -array(7) { - [0]=> - string(1) "1" - ["C1"]=> - string(1) "1" - [1]=> - string(5) "chris" - ["DUPNAMECOL"]=> - string(5) "jones" - [2]=> - string(1) "2" - ["C2"]=> - string(1) "2" - [3]=> - string(5) "jones" -} diff --git a/ext/oci8/tests/edition_1.phpt b/ext/oci8/tests/edition_1.phpt deleted file mode 100644 index c467bb18fa2d..000000000000 --- a/ext/oci8/tests/edition_1.phpt +++ /dev/null @@ -1,158 +0,0 @@ ---TEST-- -Basic test for setting Oracle 11gR2 "edition" attribute ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 2) || - ($matches[1] >= 12) - ))) { - die("skip expected output only valid when using Oracle 11gR2 or greater database server"); -} -preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] >= 2) || - ($matches[1] >= 12) - ))) { - die("skip test expected to work only with Oracle 11gR2 or greater version of client"); -} -?> ---FILE-- - ---EXPECTF-- -The value of edition has been successfully set -The value of current EDITION is MYEDITION -array(3) { - [0]=> - string(%d) "mike" - [1]=> - string(%d) "30" - [2]=> - string(%d) "Senior engineer" -} -array(3) { - [0]=> - string(%d) "juan" - [1]=> - string(%d) "25" - [2]=> - string(%d) "engineer" -} - The value of edition has been successfully set -The value of current EDITION is MYEDITION1 -array(4) { - [0]=> - string(%d) "mike" - [1]=> - string(%d) "30" - [2]=> - string(%d) "Senior engineer" - [3]=> - string(%d) "200" -} -array(4) { - [0]=> - string(%d) "juan" - [1]=> - string(%d) "25" - [2]=> - string(%d) "engineer" - [3]=> - string(%d) "100" -} -version of view_ed in MYEDITION -The value of current EDITION is MYEDITION -array(3) { - [0]=> - string(%d) "mike" - [1]=> - string(%d) "30" - [2]=> - string(%d) "Senior engineer" -} -array(3) { - [0]=> - string(%d) "juan" - [1]=> - string(%d) "25" - [2]=> - string(%d) "engineer" -} -Done diff --git a/ext/oci8/tests/edition_2.phpt b/ext/oci8/tests/edition_2.phpt deleted file mode 100644 index 2a5ef0a25357..000000000000 --- a/ext/oci8/tests/edition_2.phpt +++ /dev/null @@ -1,251 +0,0 @@ ---TEST-- -Set and check Oracle 11gR2 "edition" attribute ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 2) || - ($matches[1] >= 12) - ))) { - die("skip expected output only valid when using Oracle 11gR2 or greater database server"); -} -preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] >= 2) || - ($matches[1] >= 12) - ))) { - die("skip test expected to work only with Oracle 11gR2 or greater version of client"); -} - -?> ---FILE-- - ---EXPECTF-- -**Test 1.1 - Default value for the attribute ************** -The value of current EDITION is ORA$BASE - - -**Test 1.2 - Set a value and get the same with different connections ********* - The value of edition has been successfully set -Testing with oci_connect() -The value of current EDITION is MYEDITION -Testing with oci_pconnect() -The value of current EDITION is MYEDITION -Testing with oci_new_connect() -The value of current EDITION is MYEDITION -The value of current EDITION is MYEDITION - - -**Test 1.3 change the value and verify with existing connections.********* - The value of edition has been successfully set -The value of current EDITION is MYEDITION -The value of current EDITION is MYEDITION -Testing with oci_new_connect() -The value of current EDITION is MYEDITION1 -Testing with oci_pconnect() -The value of current EDITION is MYEDITION1 -Testing with oci_connect() -The value of current EDITION is MYEDITION1 - - -**Test 1.4 - with different type of values ********* - The value of edition has been successfully set -Testing with oci_connect() - -Warning: oci_connect(): ORA-38801: %s ORA_EDITION in %s on line %d - The value of edition has been successfully set -Testing with oci_connect() -The value of current EDITION is ORA$BASE - The value of edition has been successfully set -Testing with oci_connect() - -Warning: oci_connect(): ORA-38801: %s ORA_EDITION in %s on line %d - The value of edition has been successfully set -Testing with oci_connect() - -Warning: oci_connect(): ORA-38801: %s ORA_EDITION in %s on line %d - - -**Test 1.5 - Negative case with an invalid string value. ********* -Testing with oci_new_connect() - -Warning: oci_new_connect(): ORA-38801: %s ORA_EDITION in %s on line %d - The value of edition has been successfully set - - -**Test 1.6 - Set Multiple times.***** - The value of edition has been successfully set - The value of edition has been successfully set -Testing with oci_connect() -The value of current EDITION is MYEDITION1 - - -**Test 1.7 - Test with ALTER SESSION statement to change the edition ******* - The value of edition has been successfully set -Testing with oci_new_connect() -get the value set to MYEDITION with oci_set_edition -The value of current EDITION is MYEDITION -Get the value set to MYEDITION1 with alter session -The value of current EDITION is MYEDITION1 - Get the value with a new connection -Testing with oci_connect() -The value of current EDITION is MYEDITION - Set the value back using oci-set_edition - The value of edition has been successfully set -The value of current EDITION is MYEDITION - Get the value with a new connection -Testing with oci_connect() -The value of current EDITION is MYEDITION - - -**Test 1.8 - Test setting the attribute with scope ends******* - The value of edition has been successfully set -The value of current EDITION is MYEDITION1 -Done diff --git a/ext/oci8/tests/error.phpt b/ext/oci8/tests/error.phpt deleted file mode 100644 index 8560803f9890..000000000000 --- a/ext/oci8/tests/error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -oci_error() error message for parsing error ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs: different error messages from TimesTen -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -resource(%s) of type (oci8 connection) -resource(%s) of type (oci8 statement) - -Warning: oci_execute(): ORA-00900: %s in %s on line %d -bool(false) -array(4) { - ["code"]=> - int(900) - ["message"]=> - string(%d) "ORA-00900: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(12) "WRONG SYNTAX" -} -Done diff --git a/ext/oci8/tests/error1.phpt b/ext/oci8/tests/error1.phpt deleted file mode 100644 index 22d8a6eaf3b2..000000000000 --- a/ext/oci8/tests/error1.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -oci_error() when oci_connect() fails ---EXTENSIONS-- -oci8 ---FILE-- - ---EXPECTF-- -Warning: oci_connect(): ORA-12154: %s in %s on line %d -bool(false) -array(4) { - ["code"]=> - int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -Done diff --git a/ext/oci8/tests/error2.phpt b/ext/oci8/tests/error2.phpt deleted file mode 100644 index e6ccb39b267a..000000000000 --- a/ext/oci8/tests/error2.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Exercise error code for SUCCESS_WITH_INFO ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -?> ---FILE-- - ---EXPECTF-- -ORA-24344: %s -Done diff --git a/ext/oci8/tests/error3.phpt b/ext/oci8/tests/error3.phpt deleted file mode 100644 index ade60edf4dd1..000000000000 --- a/ext/oci8/tests/error3.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Maximum Oracle error length ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -// Assume runtime client version is >= compile time client version -$cv = explode('.', oci_client_version()); -if ($cv[0] < 11 || ($cv[0] == 11 && $cv[1] < 2) || ($cv[0] == 11 && $cv[1] == 2 && $cv[3] < 3)) { - die("skip test works only with Oracle 11.2.0.3 or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 - -Warning: oci_execute(): ORA-20333: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBab in %serror3.php on line %d diff --git a/ext/oci8/tests/error_bind.phpt b/ext/oci8/tests/error_bind.phpt deleted file mode 100644 index 79b003b17df4..000000000000 --- a/ext/oci8/tests/error_bind.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Test some oci_bind_by_name error conditions ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Insert value -bool(true) -Test 1 - Assign a resource to the bind variable and execute - -Warning: oci_execute(): Invalid variable used for bind in %s on line %d -bool(false) -Test 2 - Re-bind a resource - -Warning: oci_bind_by_name(): Invalid variable used for bind in %s on line %d - -Warning: oci_execute(): Invalid variable used for bind in %s on line %d -bool(false) -resource(%d) of type (oci8 connection) -Test 3 - Resource mismatch !! - -Warning: oci_bind_by_name(): Invalid variable used for bind in %s on line %d - -Warning: oci_execute(): ORA-%r(01008|57000)%r: %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/error_bind_2.phpt b/ext/oci8/tests/error_bind_2.phpt deleted file mode 100644 index 4f7a72bcb758..000000000000 --- a/ext/oci8/tests/error_bind_2.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -Test some more oci_bind_by_name error conditions ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => true); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 - SQLT_BOL - -Warning: oci_execute(): Invalid variable used for bind in %s on line %d -bool(false) -Test 2 - SQLT_BOL - -Warning: oci_bind_by_name(): Invalid variable used for bind in %s on line %d -Done diff --git a/ext/oci8/tests/error_bind_3.phpt b/ext/oci8/tests/error_bind_3.phpt deleted file mode 100644 index b6e5b1fbbb0a..000000000000 --- a/ext/oci8/tests/error_bind_3.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Test some more oci_bind_by_name error conditions ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => true); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Warning: oci_execute(): ORA-06550: line %d, column %d: -PLS-00382: %s -ORA-06550: line %d, column %d: -PL/SQL: %s -ORA-06550: line %d, column %d: -PLS-00382: %s -ORA-06550: line %d, column %d: -PL/SQL: %s in %s on line %d -bool(false) -bool(false) -Done diff --git a/ext/oci8/tests/error_parse.phpt b/ext/oci8/tests/error_parse.phpt deleted file mode 100644 index a7906eb4f8dc..000000000000 --- a/ext/oci8/tests/error_parse.phpt +++ /dev/null @@ -1,146 +0,0 @@ ---TEST-- -Test error handling when persistent connection is passed to oci_error() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Normal connection: Parse error -array(4) { - ["code"]=> - int(1756) - ["message"]=> - string(48) "ORA-01756: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -New connection: Parse error -array(4) { - ["code"]=> - int(1756) - ["message"]=> - string(48) "ORA-01756: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -Persistent connection: Parse error -array(4) { - ["code"]=> - int(1756) - ["message"]=> - string(48) "ORA-01756: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -No connection: error: bool(false) -Normal connection (take #2): Parse error: ORA-01756: %s -New connection (take #2): Parse error: ORA-01756: %s -Persistent connection (take #2): Parse error: ORA-01756: %s -Normal connection: New Collection error: OCI-22303: type ""."ABC" not found -New connection (take #3): Parse error: ORA-01756: %s -Persistent connection (take #3): Parse error: ORA-01756: %s -Done diff --git a/ext/oci8/tests/error_set.phpt b/ext/oci8/tests/error_set.phpt deleted file mode 100644 index e6e150426530..000000000000 --- a/ext/oci8/tests/error_set.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -Check oci_set_{action,client_identifier,module_name,client_info} error handling ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 -bool(false) -24960 -bool(false) -24960 -bool(false) -24960 -bool(false) -24960 - -Test 2 -bool(true) -bool(true) -bool(true) -bool(true) diff --git a/ext/oci8/tests/exec_fetch.phpt b/ext/oci8/tests/exec_fetch.phpt deleted file mode 100644 index 9788353e835b..000000000000 --- a/ext/oci8/tests/exec_fetch.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -fetch after failed oci_execute() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: oci_execute(): ORA-00942: %s in %s on line %d -bool(false) - -Warning: oci_fetch_array(): ORA-24374: %s in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/execute_mode.phpt b/ext/oci8/tests/execute_mode.phpt deleted file mode 100644 index a36bc34d48c3..000000000000 --- a/ext/oci8/tests/execute_mode.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -oci_execute() and invalid execute mode ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: oci_execute(): Invalid execute mode given: -1 in %s on line %d -Done diff --git a/ext/oci8/tests/existence_aliases.phpt b/ext/oci8/tests/existence_aliases.phpt deleted file mode 100644 index 1988b2329af6..000000000000 --- a/ext/oci8/tests/existence_aliases.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -Test if function aliases still exist. ---EXTENSIONS-- -oci8 ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) diff --git a/ext/oci8/tests/extauth_01.phpt b/ext/oci8/tests/extauth_01.phpt deleted file mode 100644 index 3d5ebe9775ec..000000000000 --- a/ext/oci8/tests/extauth_01.phpt +++ /dev/null @@ -1,197 +0,0 @@ ---TEST-- -Test External Authentication errors with oci_connect ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.privileged_connect=1 ---FILE-- - ---EXPECTF-- -Test 1 - -Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 2 - -Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 3 - -Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 4 - -Warning: oci_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d -bool(false) -bool(false) -Test 5 - -Warning: oci_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d -bool(false) -bool(false) -Test 6 - -Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 7 - -Warning: oci_connect(): ORA-12154: %s in %s on line %d -array(4) { - ["code"]=> - int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) -Test 8 - -Warning: oci_connect(): ORA-12154: %s in %s on line %d -array(4) { - ["code"]=> - int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) -Test 9 - -Warning: oci_connect(): ORA-%d: TNS:%s in %s on line %d -array(4) { - ["code"]=> - int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) -Test 10 - -Warning: oci_connect(): ORA-%d: TNS:%s in %s on line %d -array(4) { - ["code"]=> - int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) diff --git a/ext/oci8/tests/extauth_02.phpt b/ext/oci8/tests/extauth_02.phpt deleted file mode 100644 index 0ba21e491820..000000000000 --- a/ext/oci8/tests/extauth_02.phpt +++ /dev/null @@ -1,197 +0,0 @@ ---TEST-- -Test External Authentication errors with oci_new_connect ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.privileged_connect=1 ---FILE-- - ---EXPECTF-- -Test 1 - -Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 2 - -Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 3 - -Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 4 - -Warning: oci_new_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d -bool(false) -bool(false) -Test 5 - -Warning: oci_new_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d -bool(false) -bool(false) -Test 6 - -Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 7 - -Warning: oci_new_connect(): ORA-12154: %s in %s on line %d -array(4) { - ["code"]=> - int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) -Test 8 - -Warning: oci_new_connect(): ORA-12154: %s in %s on line %d -array(4) { - ["code"]=> - int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) -Test 9 - -Warning: oci_new_connect(): ORA-%d: TNS:%s %s on line %d -array(4) { - ["code"]=> - int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) -Test 10 - -Warning: oci_new_connect(): ORA-%d: TNS:%s %s on line %d -array(4) { - ["code"]=> - int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) diff --git a/ext/oci8/tests/extauth_03.phpt b/ext/oci8/tests/extauth_03.phpt deleted file mode 100644 index 5fb6d4306812..000000000000 --- a/ext/oci8/tests/extauth_03.phpt +++ /dev/null @@ -1,197 +0,0 @@ ---TEST-- -Test External Authentication errors with oci_pconnect ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.privileged_connect=1 ---FILE-- - ---EXPECTF-- -Test 1 - -Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 2 - -Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 3 - -Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 4 - -Warning: oci_pconnect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d -bool(false) -bool(false) -Test 5 - -Warning: oci_pconnect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d -bool(false) -bool(false) -Test 6 - -Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d -bool(false) -bool(false) -Test 7 - -Warning: oci_pconnect(): ORA-12154: %s in %s on line %d -array(4) { - ["code"]=> - int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) -Test 8 - -Warning: oci_pconnect(): ORA-12154: %s in %s on line %d -array(4) { - ["code"]=> - int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) -Test 9 - -Warning: oci_pconnect(): ORA-%d: TNS:%s in %s on line %d -array(4) { - ["code"]=> - int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) -Test 10 - -Warning: oci_pconnect(): ORA-%d: TNS:%s in %s on line %d -array(4) { - ["code"]=> - int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> - int(0) - ["sqltext"]=> - string(0) "" -} -bool(false) diff --git a/ext/oci8/tests/extauth_04.phpt b/ext/oci8/tests/extauth_04.phpt deleted file mode 100644 index dfd97dbf4e89..000000000000 --- a/ext/oci8/tests/extauth_04.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test External Authentication errors on Windows ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.privileged_connect=1 ---FILE-- - ---EXPECTF-- -Test 1 - -Warning: oci_connect(): External Authentication is not supported on Windows in %s on line %d -bool(false) -bool(false) -Test 2 - -Warning: oci_new_connect(): External Authentication is not supported on Windows in %s on line %d -bool(false) -bool(false) -Test 3 - -Warning: oci_pconnect(): External Authentication is not supported on Windows in %s on line %d -bool(false) -bool(false) diff --git a/ext/oci8/tests/fetch.phpt b/ext/oci8/tests/fetch.phpt deleted file mode 100644 index ca045ef6a3e4..000000000000 --- a/ext/oci8/tests/fetch.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -ocifetch() & ociresult() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -Done diff --git a/ext/oci8/tests/fetch_all1.phpt b/ext/oci8/tests/fetch_all1.phpt deleted file mode 100644 index beb906efc440..000000000000 --- a/ext/oci8/tests/fetch_all1.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -oci_fetch_all() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(3) -array(2) { - ["ID"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - } - ["VALUE"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - } -} -Done diff --git a/ext/oci8/tests/fetch_all2.phpt b/ext/oci8/tests/fetch_all2.phpt deleted file mode 100644 index 92bc224569fc..000000000000 --- a/ext/oci8/tests/fetch_all2.phpt +++ /dev/null @@ -1,248 +0,0 @@ ---TEST-- -oci_fetch_all() - 2 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -int(3) -array(5) { - ["ID"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - } - ["VALUE"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - string(1) "1" - } - ["BLOB"]=> - array(3) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - } - ["CLOB"]=> - array(3) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - } - ["STRING"]=> - array(3) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL - } -} -int(3) -array(3) { - [0]=> - array(5) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - ["BLOB"]=> - NULL - ["CLOB"]=> - NULL - ["STRING"]=> - NULL - } - [1]=> - array(5) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - ["BLOB"]=> - NULL - ["CLOB"]=> - NULL - ["STRING"]=> - NULL - } - [2]=> - array(5) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - ["BLOB"]=> - NULL - ["CLOB"]=> - NULL - ["STRING"]=> - NULL - } -} -int(0) -array(0) { -} -int(2) -array(2) { - [0]=> - array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL - } - [1]=> - array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL - } -} -int(2) -array(5) { - [0]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - } - [1]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - } - [2]=> - array(2) { - [0]=> - NULL - [1]=> - NULL - } - [3]=> - array(2) { - [0]=> - NULL - [1]=> - NULL - } - [4]=> - array(2) { - [0]=> - NULL - [1]=> - NULL - } -} -int(1) -array(5) { - [0]=> - array(1) { - [0]=> - string(1) "1" - } - [1]=> - array(1) { - [0]=> - string(1) "1" - } - [2]=> - array(1) { - [0]=> - NULL - } - [3]=> - array(1) { - [0]=> - NULL - } - [4]=> - array(1) { - [0]=> - NULL - } -} -Done diff --git a/ext/oci8/tests/fetch_all3.phpt b/ext/oci8/tests/fetch_all3.phpt deleted file mode 100644 index f292a2f8ee1e..000000000000 --- a/ext/oci8/tests/fetch_all3.phpt +++ /dev/null @@ -1,597 +0,0 @@ ---TEST-- -oci_fetch_all() - all combinations of flags ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -None -int(4) -array(2) { - ["ID"]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - } - ["VALUE"]=> - array(4) { - [0]=> - string(2) "-1" - [1]=> - string(2) "-2" - [2]=> - string(2) "-3" - [3]=> - string(2) "-4" - } -} -OCI_ASSOC -int(4) -array(2) { - ["ID"]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - } - ["VALUE"]=> - array(4) { - [0]=> - string(2) "-1" - [1]=> - string(2) "-2" - [2]=> - string(2) "-3" - [3]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_COLUMN -int(4) -array(2) { - ["ID"]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - } - ["VALUE"]=> - array(4) { - [0]=> - string(2) "-1" - [1]=> - string(2) "-2" - [2]=> - string(2) "-3" - [3]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_COLUMN|OCI_ASSOC -int(4) -array(2) { - ["ID"]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - } - ["VALUE"]=> - array(4) { - [0]=> - string(2) "-1" - [1]=> - string(2) "-2" - [2]=> - string(2) "-3" - [3]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_COLUMN|OCI_NUM -int(4) -array(2) { - [0]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - } - [1]=> - array(4) { - [0]=> - string(2) "-1" - [1]=> - string(2) "-2" - [2]=> - string(2) "-3" - [3]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_COLUMN|OCI_NUM|OCI_ASSOC -int(4) -array(2) { - [0]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - } - [1]=> - array(4) { - [0]=> - string(2) "-1" - [1]=> - string(2) "-2" - [2]=> - string(2) "-3" - [3]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_ROW -int(4) -array(4) { - [0]=> - array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(2) "-1" - } - [1]=> - array(2) { - ["ID"]=> - string(1) "2" - ["VALUE"]=> - string(2) "-2" - } - [2]=> - array(2) { - ["ID"]=> - string(1) "3" - ["VALUE"]=> - string(2) "-3" - } - [3]=> - array(2) { - ["ID"]=> - string(1) "4" - ["VALUE"]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_ROW|OCI_ASSOC -int(4) -array(4) { - [0]=> - array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(2) "-1" - } - [1]=> - array(2) { - ["ID"]=> - string(1) "2" - ["VALUE"]=> - string(2) "-2" - } - [2]=> - array(2) { - ["ID"]=> - string(1) "3" - ["VALUE"]=> - string(2) "-3" - } - [3]=> - array(2) { - ["ID"]=> - string(1) "4" - ["VALUE"]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_ROW|OCI_FETCHSTATEMENT_BY_COLUMN -int(4) -array(4) { - [0]=> - array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(2) "-1" - } - [1]=> - array(2) { - ["ID"]=> - string(1) "2" - ["VALUE"]=> - string(2) "-2" - } - [2]=> - array(2) { - ["ID"]=> - string(1) "3" - ["VALUE"]=> - string(2) "-3" - } - [3]=> - array(2) { - ["ID"]=> - string(1) "4" - ["VALUE"]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_ROW|OCI_FETCHSTATEMENT_BY_COLUMN|OCI_ASSOC -int(4) -array(4) { - [0]=> - array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(2) "-1" - } - [1]=> - array(2) { - ["ID"]=> - string(1) "2" - ["VALUE"]=> - string(2) "-2" - } - [2]=> - array(2) { - ["ID"]=> - string(1) "3" - ["VALUE"]=> - string(2) "-3" - } - [3]=> - array(2) { - ["ID"]=> - string(1) "4" - ["VALUE"]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_ROW|OCI_FETCHSTATEMENT_BY_COLUMN|OCI_NUM -int(4) -array(4) { - [0]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(2) "-1" - } - [1]=> - array(2) { - [0]=> - string(1) "2" - [1]=> - string(2) "-2" - } - [2]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - string(2) "-3" - } - [3]=> - array(2) { - [0]=> - string(1) "4" - [1]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_ROW|OCI_FETCHSTATEMENT_BY_COLUMN|OCI_NUM|OCI_ASSOC -int(4) -array(4) { - [0]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(2) "-1" - } - [1]=> - array(2) { - [0]=> - string(1) "2" - [1]=> - string(2) "-2" - } - [2]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - string(2) "-3" - } - [3]=> - array(2) { - [0]=> - string(1) "4" - [1]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_ROW|OCI_NUM -int(4) -array(4) { - [0]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(2) "-1" - } - [1]=> - array(2) { - [0]=> - string(1) "2" - [1]=> - string(2) "-2" - } - [2]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - string(2) "-3" - } - [3]=> - array(2) { - [0]=> - string(1) "4" - [1]=> - string(2) "-4" - } -} -OCI_FETCHSTATEMENT_BY_ROW|OCI_NUM|OCI_ASSOC -int(4) -array(4) { - [0]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(2) "-1" - } - [1]=> - array(2) { - [0]=> - string(1) "2" - [1]=> - string(2) "-2" - } - [2]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - string(2) "-3" - } - [3]=> - array(2) { - [0]=> - string(1) "4" - [1]=> - string(2) "-4" - } -} -OCI_NUM -int(4) -array(2) { - [0]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - } - [1]=> - array(4) { - [0]=> - string(2) "-1" - [1]=> - string(2) "-2" - [2]=> - string(2) "-3" - [3]=> - string(2) "-4" - } -} -OCI_NUM|OCI_ASSOC -int(4) -array(2) { - [0]=> - array(4) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - } - [1]=> - array(4) { - [0]=> - string(2) "-1" - [1]=> - string(2) "-2" - [2]=> - string(2) "-3" - [3]=> - string(2) "-4" - } -} -Done diff --git a/ext/oci8/tests/fetch_all4.phpt b/ext/oci8/tests/fetch_all4.phpt deleted file mode 100644 index 5b084c1e32e9..000000000000 --- a/ext/oci8/tests/fetch_all4.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Test oci_fetch_* array overwriting when query returns no rows ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 -int(0) -array(2) { - ["MYCOL1"]=> - array(0) { - } - ["MYCOL2"]=> - array(0) { - } -} -Test 2 -bool(false) diff --git a/ext/oci8/tests/fetch_all5.phpt b/ext/oci8/tests/fetch_all5.phpt deleted file mode 100644 index 6446d99114a3..000000000000 --- a/ext/oci8/tests/fetch_all5.phpt +++ /dev/null @@ -1,111 +0,0 @@ ---TEST-- -Test oci_fetch_all with 0 and -1 skip & maxrows ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 -int(3) -array(2) { - ["MYCOL1"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - } - ["MYCOL2"]=> - array(3) { - [0]=> - string(3) "abc" - [1]=> - string(3) "def" - [2]=> - string(3) "ghi" - } -} -Test 1 -int(3) -array(2) { - ["MYCOL1"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - } - ["MYCOL2"]=> - array(3) { - [0]=> - string(3) "abc" - [1]=> - string(3) "def" - [2]=> - string(3) "ghi" - } -} -Test 3 -int(0) -array(0) { -} diff --git a/ext/oci8/tests/fetch_array.phpt b/ext/oci8/tests/fetch_array.phpt deleted file mode 100644 index 1b5c2aa80914..000000000000 --- a/ext/oci8/tests/fetch_array.phpt +++ /dev/null @@ -1,378 +0,0 @@ ---TEST-- -oci_fetch_array() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -Test 1 -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(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(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 -} -Test 2 -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -Test 3 -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -Test 4 -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -Test 5 -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -array(4) { - [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" - [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" -} -Test 6 -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(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(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 -} -Test 7 -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -Done diff --git a/ext/oci8/tests/fetch_assoc.phpt b/ext/oci8/tests/fetch_assoc.phpt deleted file mode 100644 index 729dfe35ba70..000000000000 --- a/ext/oci8/tests/fetch_assoc.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -oci_fetch_assoc() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(3) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - ["DUMMY"]=> - NULL -} -array(3) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - ["DUMMY"]=> - NULL -} -array(3) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" - ["DUMMY"]=> - NULL -} -Done diff --git a/ext/oci8/tests/fetch_object.phpt b/ext/oci8/tests/fetch_object.phpt deleted file mode 100644 index 56b570f1d61e..000000000000 --- a/ext/oci8/tests/fetch_object.phpt +++ /dev/null @@ -1,123 +0,0 @@ ---TEST-- -oci_fetch_object() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -caseSensitive . "\n"; - echo $row->SECONDCOL . "\n"; - echo $row->ANOTHERCOL . "\n"; -} - -echo "Test 3\n"; - -if (!($s = oci_parse($c, 'select * from fetch_object_tab where rownum < 2 order by "caseSensitive"'))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -$row = oci_fetch_object($s); -echo $row->caseSensitive . "\n"; -echo $row->CASESENSITIVE . "\n"; - -// Clean up - -$stmtarray = array( - "drop table fetch_object_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -Test 1 -object(stdClass)#1 (3) { - ["caseSensitive"]=> - string(3) "123" - ["SECONDCOL"]=> - string(19) "1st row col2 string" - ["ANOTHERCOL"]=> - string(15) "1 more text " -} -object(stdClass)#2 (3) { - ["caseSensitive"]=> - string(3) "456" - ["SECONDCOL"]=> - string(19) "2nd row col2 string" - ["ANOTHERCOL"]=> - string(15) "2 more text " -} -object(stdClass)#1 (3) { - ["caseSensitive"]=> - string(3) "789" - ["SECONDCOL"]=> - string(19) "3rd row col2 string" - ["ANOTHERCOL"]=> - string(15) "3 more text " -} -Test 2 -123 -1st row col2 string -1 more text -456 -2nd row col2 string -2 more text -789 -3rd row col2 string -3 more text -Test 3 -123 - -Warning: Undefined property: stdClass::$CASESENSITIVE in %sfetch_object.php on line %d - diff --git a/ext/oci8/tests/fetch_object_1.phpt b/ext/oci8/tests/fetch_object_1.phpt deleted file mode 100644 index 48c8a289bc57..000000000000 --- a/ext/oci8/tests/fetch_object_1.phpt +++ /dev/null @@ -1,123 +0,0 @@ ---TEST-- -oci_fetch_object() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -caseSensitive . "\n"; - echo $row->SECONDCOL . "\n"; - echo $row->ANOTHERCOL . "\n"; -} - -echo "Test 3\n"; - -if (!($s = oci_parse($c, 'select * from fetch_object_tab where rownum < 2 order by "caseSensitive"'))) { - die("oci_parse(select) failed!\n"); -} - -if (!oci_execute($s)) { - die("oci_execute(select) failed!\n"); -} - -$row = oci_fetch_object($s); -echo $row->caseSensitive . "\n"; -echo $row->CASESENSITIVE . "\n"; - -// Clean up - -$stmtarray = array( - "drop table fetch_object_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -Test 1 -object(stdClass)#%d (3) { - ["caseSensitive"]=> - string(3) "123" - ["SECONDCOL"]=> - string(19) "1st row col2 string" - ["ANOTHERCOL"]=> - string(15) "1 more text " -} -object(stdClass)#%d (3) { - ["caseSensitive"]=> - string(3) "456" - ["SECONDCOL"]=> - string(19) "2nd row col2 string" - ["ANOTHERCOL"]=> - string(15) "2 more text " -} -object(stdClass)#%d (3) { - ["caseSensitive"]=> - string(3) "789" - ["SECONDCOL"]=> - string(19) "3rd row col2 string" - ["ANOTHERCOL"]=> - string(15) "3 more text " -} -Test 2 -123 -1st row col2 string -1 more text -456 -2nd row col2 string -2 more text -789 -3rd row col2 string -3 more text -Test 3 -123 - -Warning: Undefined property: stdClass::$CASESENSITIVE in %sfetch_object_1.php on line %d - diff --git a/ext/oci8/tests/fetch_object_2.phpt b/ext/oci8/tests/fetch_object_2.phpt deleted file mode 100644 index e16274fc4815..000000000000 --- a/ext/oci8/tests/fetch_object_2.phpt +++ /dev/null @@ -1,113 +0,0 @@ ---TEST-- -oci_fetch_object() with CLOB and NULL ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -COL1 . "\n"; - echo $row->COL2->load() . "\n"; - echo $row->COL3 . "\n"; -} - -// Clean up - -$stmtarray = array( - "drop table fetch_object_2_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -Test 1 -object(stdClass)#%d (3) { - ["COL1"]=> - string(3) "123" - ["COL2"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["COL3"]=> - string(11) "1 more text" -} -object(stdClass)#%d (3) { - ["COL1"]=> - string(3) "456" - ["COL2"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["COL3"]=> - NULL -} -object(stdClass)#%d (3) { - ["COL1"]=> - string(3) "789" - ["COL2"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["COL3"]=> - string(11) "3 more text" -} -Test 2 -123 -1st row col2 string -1 more text -456 -2nd row col2 string - -789 -3rd row col2 string -3 more text diff --git a/ext/oci8/tests/fetch_row.phpt b/ext/oci8/tests/fetch_row.phpt deleted file mode 100644 index 01f9b3eaee5d..000000000000 --- a/ext/oci8/tests/fetch_row.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -oci_fetch_row() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -Done diff --git a/ext/oci8/tests/field_funcs.phpt b/ext/oci8/tests/field_funcs.phpt deleted file mode 100644 index a521c69f9a0e..000000000000 --- a/ext/oci8/tests/field_funcs.phpt +++ /dev/null @@ -1,111 +0,0 @@ ---TEST-- -oci_field_*() family ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - $field) { - $num++; - var_dump(oci_field_is_null($s, $num)); - var_dump(oci_field_name($s, $num)); - var_dump(oci_field_type($s, $num)); - var_dump(oci_field_type_raw($s, $num)); - var_dump(oci_field_scale($s, $num)); - var_dump(oci_field_precision($s, $num)); - var_dump(oci_field_size($s, $num)); -} - - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -array(5) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" - [2]=> - NULL - [3]=> - NULL - [4]=> - NULL -} -bool(false) -string(2) "ID" -string(6) "NUMBER" -int(2) -int(-127) -int(0) -int(22) -bool(false) -string(5) "VALUE" -string(6) "NUMBER" -int(2) -int(-127) -int(0) -int(22) -bool(true) -string(4) "BLOB" -string(4) "BLOB" -int(113) -int(0) -int(0) -int(4000) -bool(true) -string(4) "CLOB" -string(4) "CLOB" -int(112) -int(0) -int(0) -int(4000) -bool(true) -string(6) "STRING" -string(8) "VARCHAR2" -int(1) -int(0) -int(0) -int(10) -Done diff --git a/ext/oci8/tests/field_funcs1.phpt b/ext/oci8/tests/field_funcs1.phpt deleted file mode 100644 index b48c0377b585..000000000000 --- a/ext/oci8/tests/field_funcs1.phpt +++ /dev/null @@ -1,119 +0,0 @@ ---TEST-- -oci_field_*() family: error cases ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} -Test 1 - -Warning: oci_field_is_null(): Invalid column index "-1" in %s on line %d -bool(false) - -Warning: oci_field_name(): Invalid column index "-1" in %s on line %d -bool(false) - -Warning: oci_field_type(): Invalid column index "-1" in %s on line %d -bool(false) - -Warning: oci_field_type_raw(): Invalid column index "-1" in %s on line %d -bool(false) - -Warning: oci_field_scale(): Invalid column index "-1" in %s on line %d -bool(false) - -Warning: oci_field_precision(): Invalid column index "-1" in %s on line %d -bool(false) - -Warning: oci_field_size(): Invalid column index "-1" in %s on line %d -bool(false) -Test 2 - -Warning: oci_field_is_null(): Invalid column name "none" in %s on line %d -bool(false) - -Warning: oci_field_name(): Invalid column name "none" in %s on line %d -bool(false) - -Warning: oci_field_type(): Invalid column name "none" in %s on line %d -bool(false) - -Warning: oci_field_type_raw(): Invalid column name "none" in %s on line %d -bool(false) - -Warning: oci_field_scale(): Invalid column name "none" in %s on line %d -bool(false) - -Warning: oci_field_precision(): Invalid column name "none" in %s on line %d -bool(false) - -Warning: oci_field_size(): Invalid column name "none" in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/field_funcs2.phpt b/ext/oci8/tests/field_funcs2.phpt deleted file mode 100644 index bbf436b669c5..000000000000 --- a/ext/oci8/tests/field_funcs2.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -Bug #41917 (invalid scale and precision) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - "NUMBER", - "C02" => "NUMBER(*,1)", - "C03" => "NUMBER(9)", - "C04" => "NUMBER(9,2)", - "C05" => "NUMBER(9,1)", - "C06" => "NUMBER(7,-2)", - "C07" => "DECIMAL(4,9)", - "C08" => "NUMERIC(4,9)", - "C09" => "DECIMAL(4)", - "C10" => "INTEGER", - "C11" => "INT", - "C12" => "SMALLINT", - "C13" => "FLOAT", - "C14" => "FLOAT(9)", - "C15" => "DOUBLE PRECISION", - "C16" => "REAL", - ); - -$stmt = "create table field_funcs2_tab (\n"; -foreach ($t as $colname => $type) { - $stmt .= "$colname $type,\n"; -} -$stmt[strlen($stmt)-2] = ")"; - -$s = oci_parse($c, $stmt); -oci_execute($s); - -$s = oci_parse($c, "select * from field_funcs2_tab"); -oci_execute($s); - -for ($i = 1; $i <= oci_num_fields($s); $i++) { - $name = oci_field_name($s, $i); - $precision = oci_field_precision($s, $i); - $scale = oci_field_scale($s, $i); - echo "$name ".$t[$name] .": precision $precision, scale $scale\n"; -} - -echo "Done\n"; -?> ---EXPECT-- -C01 NUMBER: precision 0, scale -127 -C02 NUMBER(*,1): precision 38, scale 1 -C03 NUMBER(9): precision 9, scale 0 -C04 NUMBER(9,2): precision 9, scale 2 -C05 NUMBER(9,1): precision 9, scale 1 -C06 NUMBER(7,-2): precision 7, scale -2 -C07 DECIMAL(4,9): precision 4, scale 9 -C08 NUMERIC(4,9): precision 4, scale 9 -C09 DECIMAL(4): precision 4, scale 0 -C10 INTEGER: precision 38, scale 0 -C11 INT: precision 38, scale 0 -C12 SMALLINT: precision 38, scale 0 -C13 FLOAT: precision 126, scale -127 -C14 FLOAT(9): precision 9, scale -127 -C15 DOUBLE PRECISION: precision 126, scale -127 -C16 REAL: precision 63, scale -127 -Done diff --git a/ext/oci8/tests/field_funcs3.phpt b/ext/oci8/tests/field_funcs3.phpt deleted file mode 100644 index df92c5806eca..000000000000 --- a/ext/oci8/tests/field_funcs3.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -oci_field_*() family: basic column types ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - $field) { - $num++; - var_dump(oci_field_is_null($s, $num)); - var_dump(oci_field_name($s, $num)); - var_dump(oci_field_type($s, $num)); - var_dump(oci_field_type_raw($s, $num)); - var_dump(oci_field_scale($s, $num)); - var_dump(oci_field_precision($s, $num)); - var_dump(oci_field_size($s, $num)); -} - -// Clean up - -$stmtarray = array( - "drop table field_funcs3_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -array(4) { - [0]=> - string(2) "c1" - [1]=> - string(2) "c2" - [2]=> - string(1) "3" - [3]=> - string(1%r[19]%r) "%r(01-JAN-2010|0001-01-20 10:00:00)%r" -} -bool(false) -string(4) "C1_C" -string(4) "CHAR" -int(96) -int(0) -int(0) -int(2) -bool(false) -string(4) "C2_V" -string(8) "VARCHAR2" -int(1) -int(0) -int(0) -int(2) -bool(false) -string(4) "C3_N" -string(6) "NUMBER" -int(2) -int(-127) -int(0) -int(22) -bool(false) -string(4) "C4_D" -string(4) "DATE" -int(12) -int(0) -int(0) -int(7) diff --git a/ext/oci8/tests/imp_res_1.phpt b/ext/oci8/tests/imp_res_1.phpt deleted file mode 100644 index ff7dddd6875c..000000000000 --- a/ext/oci8/tests/imp_res_1.phpt +++ /dev/null @@ -1,629 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: basic test ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 - oci_fetch_assoc -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} -array(1) { - ["C3"]=> - string(1) "t" -} -array(1) { - ["C3"]=> - string(1) "u" -} -array(1) { - [99]=> - string(2) "99" -} -array(2) { - ["NULL"]=> - NULL - ["'Z'"]=> - string(1) "Z" -} -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} - -Test 2 - oci_fetch_object -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} -object(stdClass)#%d (1) { - ["C3"]=> - string(1) "t" -} -object(stdClass)#%d (1) { - ["C3"]=> - string(1) "u" -} -object(stdClass)#%d (1) { - [99]=> - string(2) "99" -} -object(stdClass)#%d (2) { - ["NULL"]=> - NULL - ["'Z'"]=> - string(1) "Z" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} - -Test 3 - oci_fetch_row -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} -array(1) { - [0]=> - string(1) "t" -} -array(1) { - [0]=> - string(1) "u" -} -array(1) { - [0]=> - string(2) "99" -} -array(2) { - [0]=> - NULL - [1]=> - string(1) "Z" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} - -Test 4 - oci_fetch_array(OCI_ASSOC+OCI_RETURN_NULLS) -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} -array(1) { - ["C3"]=> - string(1) "t" -} -array(1) { - ["C3"]=> - string(1) "u" -} -array(1) { - [99]=> - string(2) "99" -} -array(2) { - ["NULL"]=> - NULL - ["'Z'"]=> - string(1) "Z" -} -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} - -Test 5 - oci_fetch_array(OCI_ASSOC) -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} -array(1) { - ["C3"]=> - string(1) "t" -} -array(1) { - ["C3"]=> - string(1) "u" -} -array(1) { - [99]=> - string(2) "99" -} -array(1) { - ["'Z'"]=> - string(1) "Z" -} -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} - -Test 6 - oci_fetch_array(OCI_NUM) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} -array(1) { - [0]=> - string(1) "t" -} -array(1) { - [0]=> - string(1) "u" -} -array(1) { - [0]=> - string(2) "99" -} -array(1) { - [1]=> - string(1) "Z" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} - -Test 7 - oci_fetch_array(OCI_BOTH) -array(4) { - [0]=> - string(1) "1" - ["C1"]=> - string(1) "1" - [1]=> - string(5) "abcde" - ["C2"]=> - string(5) "abcde" -} -array(4) { - [0]=> - string(1) "2" - ["C1"]=> - string(1) "2" - [1]=> - string(5) "fghij" - ["C2"]=> - string(5) "fghij" -} -array(4) { - [0]=> - string(1) "3" - ["C1"]=> - string(1) "3" - [1]=> - string(5) "klmno" - ["C2"]=> - string(5) "klmno" -} -array(2) { - [0]=> - string(1) "t" - ["C3"]=> - string(1) "t" -} -array(2) { - [0]=> - string(1) "u" - ["C3"]=> - string(1) "u" -} -array(2) { - [0]=> - string(2) "99" - [99]=> - string(2) "99" -} -array(2) { - [1]=> - string(1) "Z" - ["'Z'"]=> - string(1) "Z" -} -array(4) { - [0]=> - string(1) "1" - ["C1"]=> - string(1) "1" - [1]=> - string(5) "abcde" - ["C2"]=> - string(5) "abcde" -} -array(4) { - [0]=> - string(1) "2" - ["C1"]=> - string(1) "2" - [1]=> - string(5) "fghij" - ["C2"]=> - string(5) "fghij" -} -array(4) { - [0]=> - string(1) "3" - ["C1"]=> - string(1) "3" - [1]=> - string(5) "klmno" - ["C2"]=> - string(5) "klmno" -} - -Test 8 - oci_fetch_array(OCI_BOTH+OCI_RETURN_NULLS) -array(4) { - [0]=> - string(1) "1" - ["C1"]=> - string(1) "1" - [1]=> - string(5) "abcde" - ["C2"]=> - string(5) "abcde" -} -array(4) { - [0]=> - string(1) "2" - ["C1"]=> - string(1) "2" - [1]=> - string(5) "fghij" - ["C2"]=> - string(5) "fghij" -} -array(4) { - [0]=> - string(1) "3" - ["C1"]=> - string(1) "3" - [1]=> - string(5) "klmno" - ["C2"]=> - string(5) "klmno" -} -array(2) { - [0]=> - string(1) "t" - ["C3"]=> - string(1) "t" -} -array(2) { - [0]=> - string(1) "u" - ["C3"]=> - string(1) "u" -} -array(2) { - [0]=> - string(2) "99" - [99]=> - string(2) "99" -} -array(4) { - [0]=> - NULL - ["NULL"]=> - NULL - [1]=> - string(1) "Z" - ["'Z'"]=> - string(1) "Z" -} -array(4) { - [0]=> - string(1) "1" - ["C1"]=> - string(1) "1" - [1]=> - string(5) "abcde" - ["C2"]=> - string(5) "abcde" -} -array(4) { - [0]=> - string(1) "2" - ["C1"]=> - string(1) "2" - [1]=> - string(5) "fghij" - ["C2"]=> - string(5) "fghij" -} -array(4) { - [0]=> - string(1) "3" - ["C1"]=> - string(1) "3" - [1]=> - string(5) "klmno" - ["C2"]=> - string(5) "klmno" -} diff --git a/ext/oci8/tests/imp_res_2.phpt b/ext/oci8/tests/imp_res_2.phpt deleted file mode 100644 index 8c4f39e7a379..000000000000 --- a/ext/oci8/tests/imp_res_2.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: Zero Rows ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 -Test 2 -array(1) { - [0]=> - string(1) "X" -} -Test 2 -array(1) { - [0]=> - string(1) "X" -} diff --git a/ext/oci8/tests/imp_res_3.phpt b/ext/oci8/tests/imp_res_3.phpt deleted file mode 100644 index df90b15f0c02..000000000000 --- a/ext/oci8/tests/imp_res_3.phpt +++ /dev/null @@ -1,1256 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: bigger data size ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X diff --git a/ext/oci8/tests/imp_res_4.phpt b/ext/oci8/tests/imp_res_4.phpt deleted file mode 100644 index 8d258decb900..000000000000 --- a/ext/oci8/tests/imp_res_4.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_fetch ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 - -Warning: oci_fetch(): ORA-24374: %s in %simp_res_4.php on line %d -bool(false) - -Test 2 -array(1) { - [0]=> - string(1) "1" -} - -Warning: oci_fetch(): ORA-24374: %s in %simp_res_4.php on line %d -bool(false) -array(1) { - [0]=> - string(1) "2" -} diff --git a/ext/oci8/tests/imp_res_5.phpt b/ext/oci8/tests/imp_res_5.phpt deleted file mode 100644 index eea39927afcf..000000000000 --- a/ext/oci8/tests/imp_res_5.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_fetch_all ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 - -Warning: oci_fetch_all(): ORA-24374: %s in %simp_res_5.php on line %d -array(0) { -} - -Test 2 -array(1) { - [0]=> - string(1) "1" -} - -Warning: oci_fetch_all(): ORA-24374: %s in %simp_res_5.php on line %d -array(0) { -} -array(1) { - [0]=> - string(1) "2" -} diff --git a/ext/oci8/tests/imp_res_6.phpt b/ext/oci8/tests/imp_res_6.phpt deleted file mode 100644 index b6355bc60ec0..000000000000 --- a/ext/oci8/tests/imp_res_6.phpt +++ /dev/null @@ -1,117 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: alternating oci_fetch_* calls ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(1) "a" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(1) "b" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(1) "c" -} -array(4) { - [0]=> - string(1) "4" - ["C1"]=> - string(1) "4" - [1]=> - string(1) "d" - ["C2"]=> - string(1) "d" -} -array(2) { - [0]=> - string(1) "5" - [1]=> - string(1) "e" -} -array(2) { - ["C1"]=> - string(1) "6" - ["C2"]=> - string(1) "f" -} diff --git a/ext/oci8/tests/imp_res_7.phpt b/ext/oci8/tests/imp_res_7.phpt deleted file mode 100644 index 945953f2390d..000000000000 --- a/ext/oci8/tests/imp_res_7.phpt +++ /dev/null @@ -1,872 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: bigger data size ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 105 - 106 - 107 - 108 - 109 - 110 - 111 - 112 - 113 - 114 - 115 - 116 - 117 - 118 - 119 - 120 - 121 - 122 - 123 - 124 - 125 - 126 - 127 - 128 - 129 - 130 - 131 - 132 - 133 - 134 - 135 - 136 - 137 - 138 - 139 - 140 - 141 - 142 - 143 - 144 - 145 - 146 - 147 - 148 - 149 - 150 - 151 - 152 - 153 - 154 - 155 - 156 - 157 - 158 - 159 - 160 - 161 - 162 - 163 - 164 - 165 - 166 - 167 - 168 - 169 - 170 - 171 - 172 - 173 - 174 - 175 - 176 - 177 - 178 - 179 - 180 - 181 - 182 - 183 - 184 - 185 - 186 - 187 - 188 - 189 - 190 - 191 - 192 - 193 - 194 - 195 - 196 - 197 - 198 - 199 - 200 - 201 - 202 - 203 - 204 - 205 - 206 - 207 - 208 - 209 - 210 - 211 - 212 - 213 - 214 - 215 - 216 - 217 - 218 - 219 - 220 - 221 - 222 - 223 - 224 - 225 - 226 - 227 - 228 - 229 - 230 - 231 - 232 - 233 - 234 - 235 - 236 - 237 - 238 - 239 - 240 - 241 - 242 - 243 - 244 - 245 - 246 - 247 - 248 - 249 - 250 - 251 - 252 - 253 - 254 - 255 - 256 - 257 - 258 - 259 - 260 - 261 - 262 - 263 - 264 - 265 - 266 - 267 - 268 - 269 - 270 - 271 - 272 - 273 - 274 - 275 diff --git a/ext/oci8/tests/imp_res_call_error.phpt b/ext/oci8/tests/imp_res_call_error.phpt deleted file mode 100644 index c26046e46a5a..000000000000 --- a/ext/oci8/tests/imp_res_call_error.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: using SQL 'CALL' ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 - -Warning: oci_execute(): ORA-29478: %s -ORA-06512: at "SYS.DBMS_SQL", line %d -ORA-06512: at "SYS.DBMS_SQL", line %d -ORA-06512: at "%s.IMP_RES_CALL_ERR_PROC", line %d in %simp_res_call_error.php on line %d diff --git a/ext/oci8/tests/imp_res_cancel.phpt b/ext/oci8/tests/imp_res_cancel.phpt deleted file mode 100644 index 5f0a3e1a6298..000000000000 --- a/ext/oci8/tests/imp_res_cancel.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_cancel ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - 1 -bool(true) - 2 -bool(true) - 3 -bool(true) diff --git a/ext/oci8/tests/imp_res_close.phpt b/ext/oci8/tests/imp_res_close.phpt deleted file mode 100644 index f696731b6f42..000000000000 --- a/ext/oci8/tests/imp_res_close.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_free_statement #1 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- -getMessage()); -} - -// Clean up - -$stmtarray = array( - "drop procedure imp_res_close_proc" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -Test 1 - 1 -string(%d) "oci_fetch_array(): supplied resource is not a valid oci8 statement resource" diff --git a/ext/oci8/tests/imp_res_cursor.phpt b/ext/oci8/tests/imp_res_cursor.phpt deleted file mode 100644 index 7d44c781f2ae..000000000000 --- a/ext/oci8/tests/imp_res_cursor.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: nested cursor ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - X - 1 abcde - 2 fghij - 3 klmno - - t - u diff --git a/ext/oci8/tests/imp_res_dbmsoutput.phpt b/ext/oci8/tests/imp_res_dbmsoutput.phpt deleted file mode 100644 index 0f5aa5e57dc4..000000000000 --- a/ext/oci8/tests/imp_res_dbmsoutput.phpt +++ /dev/null @@ -1,135 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: interleaved with DBMS_OUTPUT ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 -array(2) { - [0]=> - string(18) "dbms_output Line 1" - [1]=> - string(18) "dbms_output Line 2" -} - 1 abcde - 2 fghij - 3 klmno - t - u - v - -Test 2 - 1 abcde - 2 fghij - 3 klmno - t - u - v -array(2) { - [0]=> - string(18) "dbms_output Line 1" - [1]=> - string(18) "dbms_output Line 2" -} diff --git a/ext/oci8/tests/imp_res_field.phpt b/ext/oci8/tests/imp_res_field.phpt deleted file mode 100644 index 2e363cff6ea5..000000000000 --- a/ext/oci8/tests/imp_res_field.phpt +++ /dev/null @@ -1,226 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: field tests ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - Result set ".++$i."\n"; - print_fields($s1); - while (($r = oci_fetch_row($s1)) !== false) { - var_dump($r); - } -} - -echo "\nTest 5 - get IRS fields when fetching rows\n"; -$s = oci_parse($c, "begin imp_res_field_proc(); end;"); -oci_execute($s); -$i = 0; -while (($s1 = oci_get_implicit_resultset($s))) { - echo "===> Result set ".++$i."\n"; - while (($r = oci_fetch_row($s1)) !== false) { - var_dump($r); - print_fields($s1); - } -} - -// Clean up - -$stmtarray = array( - "drop procedure imp_res_field_proc", - "drop table imp_res_field_tab_1", - "drop table imp_res_field_tab_2", - "drop table imp_res_field_tab_3" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECT-- -Test 1 - can't get IRS fields from parent -num fields : 0 - -Test 2 - can't get IRS fields from parent when fetching -array(2) { - [0]=> - string(4) "1111" - [1]=> - string(5) "abcde" -} -num fields : 0 -array(1) { - [0]=> - string(4) "tttt" -} -num fields : 0 -array(1) { - [0]=> - string(2) "33" -} -num fields : 0 -array(1) { - [0]=> - NULL -} -num fields : 0 - -Test 3 - get IRS fields -num fields : 2 -C1_NUMBER : is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER -C2_VARCHAR210 : is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2 -num fields : 1 -C3_VARCHAR21 : is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2 -num fields : 1 -C4_NUMBER52 : is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER - -Test 4 - get IRS fields before fetching rows -===> Result set 1 -num fields : 2 -C1_NUMBER : is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER -C2_VARCHAR210 : is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2 -array(2) { - [0]=> - string(4) "1111" - [1]=> - string(5) "abcde" -} -===> Result set 2 -num fields : 1 -C3_VARCHAR21 : is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2 -array(1) { - [0]=> - string(4) "tttt" -} -===> Result set 3 -num fields : 1 -C4_NUMBER52 : is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER -array(1) { - [0]=> - string(2) "33" -} -array(1) { - [0]=> - NULL -} - -Test 5 - get IRS fields when fetching rows -===> Result set 1 -array(2) { - [0]=> - string(4) "1111" - [1]=> - string(5) "abcde" -} -num fields : 2 -C1_NUMBER : is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER -C2_VARCHAR210 : is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2 -===> Result set 2 -array(1) { - [0]=> - string(4) "tttt" -} -num fields : 1 -C3_VARCHAR21 : is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2 -===> Result set 3 -array(1) { - [0]=> - string(2) "33" -} -num fields : 1 -C4_NUMBER52 : is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER -array(1) { - [0]=> - NULL -} -num fields : 1 -C4_NUMBER52 : is_null T, precision 5, scale 2, size 22, typeraw 2, type NUMBER diff --git a/ext/oci8/tests/imp_res_func_error.phpt b/ext/oci8/tests/imp_res_func_error.phpt deleted file mode 100644 index d1bf63b8d3cd..000000000000 --- a/ext/oci8/tests/imp_res_func_error.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: test with a PL/SQL function ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 - -Warning: oci_execute(): ORA-29478: %s -ORA-06512: %s -ORA-06512: %s -ORA-06512: %s diff --git a/ext/oci8/tests/imp_res_get_1.phpt b/ext/oci8/tests/imp_res_get_1.phpt deleted file mode 100644 index a80e6bd27f68..000000000000 --- a/ext/oci8/tests/imp_res_get_1.phpt +++ /dev/null @@ -1,108 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: basic test ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - 1 abcde - 2 fghij - 3 klmno - t - u - X - -Test 2 - with execute - 1 abcde - 2 fghij - 3 klmno - t - u - X diff --git a/ext/oci8/tests/imp_res_get_2.phpt b/ext/oci8/tests/imp_res_get_2.phpt deleted file mode 100644 index 51fe0fda292e..000000000000 --- a/ext/oci8/tests/imp_res_get_2.phpt +++ /dev/null @@ -1,106 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: similar to imp_res_get_1 but with unrolled loop ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - 1 abcde - 2 fghij - 3 klmno - t - u - X diff --git a/ext/oci8/tests/imp_res_get_3.phpt b/ext/oci8/tests/imp_res_get_3.phpt deleted file mode 100644 index 252d2d775492..000000000000 --- a/ext/oci8/tests/imp_res_get_3.phpt +++ /dev/null @@ -1,266 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: basic test 3 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---INI-- -oci8.statement_cache_size = 0 ---FILE-- - ---EXPECT-- -Test 1 - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X diff --git a/ext/oci8/tests/imp_res_get_4.phpt b/ext/oci8/tests/imp_res_get_4.phpt deleted file mode 100644 index fdd57c67bbd1..000000000000 --- a/ext/oci8/tests/imp_res_get_4.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: interleaved fetches ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECTF-- -Test 1 - 1 abcde - t - 2 fghij - u - 3 klmno - v -Test 2 - too many fetches - 1 abcde - t - 2 fghij - u - 3 klmno - v -Return is false -Return is false - -Warning: oci_fetch_array(): ORA-01002: %s in %simp_res_get_4.php on line %d -Return is false - -Warning: oci_fetch_array(): ORA-01002: %s in %simp_res_get_4.php on line %d -Return is false diff --git a/ext/oci8/tests/imp_res_get_5.phpt b/ext/oci8/tests/imp_res_get_5.phpt deleted file mode 100644 index 0ece571f0e3b..000000000000 --- a/ext/oci8/tests/imp_res_get_5.phpt +++ /dev/null @@ -1,123 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: get from wrong statement ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - 3 - 4 - 5 - 6 - -Test 2 - fetch first IRS explicitly - 1 - 2 - 3 - 4 - 5 - 6 - -Test 3 - fetch part of IRS explicitly - 1 - 2 - 3 - 5 - 6 - 4 - -Test 4 - skip IRSs - 5 - 6 diff --git a/ext/oci8/tests/imp_res_get_all.phpt b/ext/oci8/tests/imp_res_get_all.phpt deleted file mode 100644 index 15d01fd30e8a..000000000000 --- a/ext/oci8/tests/imp_res_get_all.phpt +++ /dev/null @@ -1,119 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_fetch_all ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 -array(1) { - [1]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - } -} -array(1) { - [3]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - string(1) "4" - } -} -array(1) { - [5]=> - array(2) { - [0]=> - string(1) "5" - [1]=> - string(1) "6" - } -} - -Test 2 -array(1) { - [1]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - } -} -array(1) { - [3]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - string(1) "4" - } -} -array(1) { - [5]=> - array(2) { - [0]=> - string(1) "5" - [1]=> - string(1) "6" - } -} diff --git a/ext/oci8/tests/imp_res_get_cancel.phpt b/ext/oci8/tests/imp_res_get_cancel.phpt deleted file mode 100644 index 53affad00a21..000000000000 --- a/ext/oci8/tests/imp_res_get_cancel.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_cancel ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - 1 - 3 diff --git a/ext/oci8/tests/imp_res_get_close_1.phpt b/ext/oci8/tests/imp_res_get_close_1.phpt deleted file mode 100644 index 84ce03316164..000000000000 --- a/ext/oci8/tests/imp_res_get_close_1.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_free_statement #1 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- -getMessage()); -} - -?> ---EXPECTF-- -Test 1 - 1 -string(%d) "oci_fetch_array(): supplied resource is not a valid oci8 statement resource" \ No newline at end of file diff --git a/ext/oci8/tests/imp_res_get_close_2.phpt b/ext/oci8/tests/imp_res_get_close_2.phpt deleted file mode 100644 index 43296d2927b7..000000000000 --- a/ext/oci8/tests/imp_res_get_close_2.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_free_statement #2 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- -getMessage()); -} - -?> ---EXPECTF-- -Test 1 - 1 - -Warning: oci_fetch_array(): OCI_INVALID_HANDLE in %s on line %d -string(%d) "oci_get_implicit_resultset(): supplied resource is not a valid oci8 statement resource" \ No newline at end of file diff --git a/ext/oci8/tests/imp_res_get_close_3.phpt b/ext/oci8/tests/imp_res_get_close_3.phpt deleted file mode 100644 index b2dd34ed0a43..000000000000 --- a/ext/oci8/tests/imp_res_get_close_3.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_free_statement #3 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - 1 - 2 - 3 - 4 - 5 - 6 diff --git a/ext/oci8/tests/imp_res_get_cursor.phpt b/ext/oci8/tests/imp_res_get_cursor.phpt deleted file mode 100644 index be3fc4a5e042..000000000000 --- a/ext/oci8/tests/imp_res_get_cursor.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: nested cursor ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - 1 abcde - 2 fghij - 3 klmno - - t - u - X diff --git a/ext/oci8/tests/imp_res_get_dbmsoutput.phpt b/ext/oci8/tests/imp_res_get_dbmsoutput.phpt deleted file mode 100644 index c3922f4f7e4b..000000000000 --- a/ext/oci8/tests/imp_res_get_dbmsoutput.phpt +++ /dev/null @@ -1,154 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: interleaved with DBMS_OUTPUT ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 -array(3) { - [0]=> - string(6) "Line 1" - [1]=> - string(6) "Line 2" - [2]=> - string(6) "Line 3" -} - 1 abcde - 2 fghij - 3 klmno - t - u - v - X -Test 2 - 1 abcde - 2 fghij - 3 klmno - t - u - v - X -array(3) { - [0]=> - string(6) "Line 1" - [1]=> - string(6) "Line 2" - [2]=> - string(6) "Line 3" -} diff --git a/ext/oci8/tests/imp_res_get_exec.phpt b/ext/oci8/tests/imp_res_get_exec.phpt deleted file mode 100644 index fd4385068826..000000000000 --- a/ext/oci8/tests/imp_res_get_exec.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: Execute twice ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - 1 - 2 diff --git a/ext/oci8/tests/imp_res_get_none.phpt b/ext/oci8/tests/imp_res_get_none.phpt deleted file mode 100644 index fe1ce308c015..000000000000 --- a/ext/oci8/tests/imp_res_get_none.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: no implicit results ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 -bool(false) diff --git a/ext/oci8/tests/imp_res_insert.phpt b/ext/oci8/tests/imp_res_insert.phpt deleted file mode 100644 index dacd8c1bf062..000000000000 --- a/ext/oci8/tests/imp_res_insert.phpt +++ /dev/null @@ -1,151 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: Commit modes ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - No commit in procedure, OCI_COMMIT_ON_SUCCESS mode -111 -array(1) { - [0]=> - string(3) "111" -} - -Test 2 - No commit in procedure, OCI_NO_AUTO_COMMIT mode -111 -222 -array(1) { - [0]=> - string(3) "111" -} - -Test 3 - Commit in procedure, OCI_COMMIT_ON_SUCCESS mode -111 -222 -333 -array(3) { - [0]=> - string(3) "111" - [1]=> - string(3) "222" - [2]=> - string(3) "333" -} - -Test 4 - Commit in procedure, OCI_NO_AUTO_COMMIT mode -111 -222 -333 -444 -array(4) { - [0]=> - string(3) "111" - [1]=> - string(3) "222" - [2]=> - string(3) "333" - [3]=> - string(3) "444" -} diff --git a/ext/oci8/tests/imp_res_lob.phpt b/ext/oci8/tests/imp_res_lob.phpt deleted file mode 100644 index 369c8ce2a999..000000000000 --- a/ext/oci8/tests/imp_res_lob.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: LOBs ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- -load(); - } else { - echo " " . $item; - } - } - echo "\n"; -} - -echo "\nTest 2 - don't fetch all rows\n"; -$s = oci_parse($c, "begin imp_res_lob_proc(); end;"); -oci_execute($s); -$row = oci_fetch_row($s); -foreach ($row as $item) { - if (is_object($item)) { - echo " " . $item->load(); - } else { - echo " " . $item; - } -} -echo "\n"; - -// Clean up - -$stmtarray = array( - "drop procedure imp_res_lob_proc", - "drop table imp_res_lob_tab", -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECT-- -Test 1 - 1 aaaaa a - 2 bbbbb b - 3 ccccc c - 4 ddddd d - X - aaaaa - bbbbb - ccccc - ddddd - -Test 2 - don't fetch all rows - 1 aaaaa a diff --git a/ext/oci8/tests/imp_res_prefetch.phpt b/ext/oci8/tests/imp_res_prefetch.phpt deleted file mode 100644 index ec1e7debdaaa..000000000000 --- a/ext/oci8/tests/imp_res_prefetch.phpt +++ /dev/null @@ -1,184 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: basic test ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - ---EXPECT-- -Test 1 - prefetch 0 -bool(true) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} -array(1) { - [0]=> - string(1) "t" -} -array(1) { - [0]=> - string(1) "u" -} -array(1) { - [0]=> - string(1) "v" -} - -Test 1 - prefetch 1 -bool(true) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} -array(1) { - [0]=> - string(1) "t" -} -array(1) { - [0]=> - string(1) "u" -} -array(1) { - [0]=> - string(1) "v" -} - -Test 1 - prefetch 2 -bool(true) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} -array(1) { - [0]=> - string(1) "t" -} -array(1) { - [0]=> - string(1) "u" -} -array(1) { - [0]=> - string(1) "v" -} diff --git a/ext/oci8/tests/ini_1.phpt b/ext/oci8/tests/ini_1.phpt deleted file mode 100644 index 1770c1b51bdd..000000000000 --- a/ext/oci8/tests/ini_1.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -Test OCI8 php.ini settings ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 11)) { - die("skip works only with Oracle 11g or greater version of Oracle client libraries"); -} -?> ---INI-- -oci8.privileged_connect = On -oci8.max_persistent = 111 -oci8.persistent_timeout = 222 -oci8.ping_interval = 333 -oci8.connection_class = MyCC -oci8.events = On -oci8.statement_cache_size = 444 -oci8.default_prefetch = 555 -oci8.old_oci_close_semantics = On ---FILE-- - ---EXPECTF-- -Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s -Test 1 - check initialization -oci8.privileged_connect = 1 -oci8.max_persistent = 111 -oci8.persistent_timeout = 222 -oci8.ping_interval = 333 -oci8.connection_class = MyCC -oci8.events = 1 -oci8.statement_cache_size = 444 -oci8.default_prefetch = 555 -oci8.old_oci_close_semantics = 1 -Test 2 - check what can be changed at runtime -bool(false) -oci8.privileged_connect = 1 -bool(false) -oci8.max_persistent = 111 -bool(false) -oci8.persistent_timeout = 222 -bool(false) -oci8.ping_interval = 333 -string(4) "MyCC" -oci8.connection_class = OtherCC -bool(false) -oci8.events = 1 -bool(false) -oci8.statement_cache_size = 444 -bool(false) -oci8.default_prefetch = 555 -bool(false) -oci8.old_oci_close_semantics = 1 diff --git a/ext/oci8/tests/lob_001.phpt b/ext/oci8/tests/lob_001.phpt deleted file mode 100644 index 33155db1a060..000000000000 --- a/ext/oci8/tests/lob_001.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -oci_lob_write() and friends ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("test")); -var_dump($blob->tell()); -var_dump($blob->seek(10, OCI_SEEK_CUR)); -var_dump($blob->write("string")); -var_dump($blob->flush()); - -oci_commit($c); - -echo "Test 3\n"; - -$s = oci_parse($c, "select b1 from lob_001_tab where id = 1"); -oci_execute($s); -var_dump(oci_fetch_array($s, OCI_RETURN_LOBS)); - -echo "Test 4 SQLT_BLOB (an alias for OCI_B_BLOB) bind\n"; - -$statement = oci_parse($c, "insert into lob_001_tab (id, b1) values (2, empty_blob()) returning b1 into :v_b1 "); -$blob = oci_new_descriptor($c,OCI_D_LOB); -var_dump(oci_bind_by_name($statement, ":v_b1", $blob, -1, SQLT_BLOB)); -oci_execute($statement, OCI_DEFAULT); -var_dump($blob->write("test row 2")); - -$s = oci_parse($c, "select b1 from lob_001_tab where id = 2"); -oci_execute($s); -var_dump(oci_fetch_array($s, OCI_RETURN_LOBS)); - -// Cleanup - -$stmtarray = array( - "drop table lob_001_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -Test 1 OCI_B_BLOB bind -bool(true) -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -Test 2 -int(4) -int(4) -bool(true) -int(6) -bool(false) -Test 3 -array(2) { - [0]=> - string(20) "test%0%0%0%0%0%0%0%0%0%0string" - ["B1"]=> - string(20) "test%0%0%0%0%0%0%0%0%0%0string" -} -Test 4 SQLT_BLOB (an alias for OCI_B_BLOB) bind -bool(true) -int(10) -array(2) { - [0]=> - string(10) "test row 2" - ["B1"]=> - string(10) "test row 2" -} diff --git a/ext/oci8/tests/lob_002.phpt b/ext/oci8/tests/lob_002.phpt deleted file mode 100644 index 2b6009470de3..000000000000 --- a/ext/oci8/tests/lob_002.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -oci_lob_write() and friends (with errors) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("test", -1)); -var_dump($blob->write("test", 1000000)); -var_dump($blob->write(str_repeat("test", 10000), 1000000)); -var_dump($blob->tell()); -var_dump($blob->flush()); - -oci_commit($c); - -$select_sql = "select b1 from lob_002_tab where id = 1"; -$s = oci_parse($c, $select_sql); -oci_execute($s); - -$row = oci_fetch_array($s, OCI_RETURN_LOBS); - -var_dump(strlen($row[0])); - -// Cleanup - -$stmtarray = array( - "drop table lob_002_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(0) -int(4) -int(40000) -int(40004) -bool(false) -int(40004) diff --git a/ext/oci8/tests/lob_003.phpt b/ext/oci8/tests/lob_003.phpt deleted file mode 100644 index 9c5b9b5da0bd..000000000000 --- a/ext/oci8/tests/lob_003.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -oci_lob_read() and friends ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("test")); -var_dump($blob->tell()); -var_dump($blob->seek(10, OCI_SEEK_CUR)); -var_dump($blob->write("string")); -var_dump($blob->flush()); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -try { - var_dump($row[0]->read(-1)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} -var_dump($row[0]->read(10000)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(4) -int(4) -bool(true) -int(6) -bool(false) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -OCILob::read(): Argument #1 ($length) must be greater than 0 -string(20) "test%0%0%0%0%0%0%0%0%0%0string" -Done diff --git a/ext/oci8/tests/lob_004.phpt b/ext/oci8/tests/lob_004.phpt deleted file mode 100644 index 825954928d81..000000000000 --- a/ext/oci8/tests/lob_004.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -oci_lob_seek()/rewind()/append() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("test")); -var_dump($blob->rewind()); -var_dump($blob->write("str")); -var_dump($blob->seek(10, OCI_SEEK_SET)); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -var_dump($row[0]->append($blob)); -var_dump($row[0]->read(10000)); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -$row = oci_fetch_array($s); - -var_dump($row[0]->read(10000)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(4) -bool(true) -int(3) -bool(true) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -bool(true) -string(4) "strt" -string(8) "strtstrt" -Done diff --git a/ext/oci8/tests/lob_005.phpt b/ext/oci8/tests/lob_005.phpt deleted file mode 100644 index db8db864a39a..000000000000 --- a/ext/oci8/tests/lob_005.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -oci_lob_is_equal() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -bool(true) -Done diff --git a/ext/oci8/tests/lob_006.phpt b/ext/oci8/tests/lob_006.phpt deleted file mode 100644 index 4282e2a281bb..000000000000 --- a/ext/oci8/tests/lob_006.phpt +++ /dev/null @@ -1,78 +0,0 @@ ---TEST-- -oci_lob_write()/truncate()/erase() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write($str)); -var_dump($blob->truncate()); -var_dump($blob->seek(0, OCI_SEEK_SET)); -var_dump($blob->write("string was here. tick-tack-tick-tack.")); -var_dump($blob->erase(10, 10)); -var_dump($blob->write("some")); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -var_dump($row[0]->read(10000)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(72) -bool(true) -bool(true) -int(37) -int(10) -int(4) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(41) "string was%0%0%0%0%0%0%0%0%0%0k-tack-tick-tack.some" -Done diff --git a/ext/oci8/tests/lob_007.phpt b/ext/oci8/tests/lob_007.phpt deleted file mode 100644 index d17196e5eb71..000000000000 --- a/ext/oci8/tests/lob_007.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -oci_lob_write()/size()/load() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -size()); -var_dump($blob->write(str_repeat("string.", 1000))); -var_dump($blob->size()); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -var_dump($row[0]->size()); -var_dump(strlen($row[0]->load())); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(0) -int(7000) -int(7000) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -int(7000) -int(7000) -Done diff --git a/ext/oci8/tests/lob_008.phpt b/ext/oci8/tests/lob_008.phpt deleted file mode 100644 index 3efb85dbbe02..000000000000 --- a/ext/oci8/tests/lob_008.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -oci_lob_write()/read()/eof() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write(str_repeat("string.", 1000))); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - - -$len = 0; -while (!$row[0]->eof()) { - $len += strlen($row[0]->read(1024)); -} -var_dump($len); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(7000) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -int(7000) -Done diff --git a/ext/oci8/tests/lob_009.phpt b/ext/oci8/tests/lob_009.phpt deleted file mode 100644 index 732756eef53b..000000000000 --- a/ext/oci8/tests/lob_009.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -oci_lob_import()/read() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -seek(10, OCI_SEEK_CUR)); -var_dump($blob->import(__DIR__."/lob_009.txt")); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -while (!$row[0]->eof()) { - var_dump(str_replace("\r", "", $row[0]->read(1024))); -} - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -bool(true) -bool(true) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(43) "this -is -a -test -file for -test lob_009.phpt -" -Done diff --git a/ext/oci8/tests/lob_009.txt b/ext/oci8/tests/lob_009.txt deleted file mode 100644 index f57bc8af3731..000000000000 --- a/ext/oci8/tests/lob_009.txt +++ /dev/null @@ -1,6 +0,0 @@ -this -is -a -test -file for -test lob_009.phpt diff --git a/ext/oci8/tests/lob_010.phpt b/ext/oci8/tests/lob_010.phpt deleted file mode 100644 index 4b60780ba5c5..000000000000 --- a/ext/oci8/tests/lob_010.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -oci_lob_save() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -save("string")); -var_dump($blob->save("string", 3)); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -$row = oci_fetch_array($s); - -while (!$row[0]->eof()) { - var_dump($row[0]->read(1024)); -} - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(9) "strstring" -Done diff --git a/ext/oci8/tests/lob_011.phpt b/ext/oci8/tests/lob_011.phpt deleted file mode 100644 index 24256d82af55..000000000000 --- a/ext/oci8/tests/lob_011.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -oci_lob_copy() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("some string here. string, I said")); -oci_commit($c); - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (id, blob) - VALUES (2, empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 1"; -$s = oci_parse($c, $select_sql); -oci_execute($s); - -$row1 = oci_fetch_array($s); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 2 FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -$row2 = oci_fetch_array($s); - -var_dump(oci_lob_copy($row2[0], $row1[0])); -var_dump($row1[0]->read(100)); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 2 FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row2 = oci_fetch_array($s, OCI_RETURN_LOBS)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -int(32) -bool(true) -string(32) "some string here. string, I said" -array(2) { - [0]=> - string(32) "some string here. string, I said" - ["BLOB"]=> - string(32) "some string here. string, I said" -} -Done diff --git a/ext/oci8/tests/lob_012.phpt b/ext/oci8/tests/lob_012.phpt deleted file mode 100644 index dd8e32ad20f1..000000000000 --- a/ext/oci8/tests/lob_012.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -oci_lob_export() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("test string is here\nnew string")); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -$row = oci_fetch_array($s); - -var_dump($row[0]->export(__DIR__."/lob_012.tmp", 3, 10)); - -var_dump(file_get_contents(__DIR__."/lob_012.tmp")); - -@unlink(__DIR__."/lob_012.tmp"); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -int(30) -bool(true) -string(10) "t string i" -Done diff --git a/ext/oci8/tests/lob_013.phpt b/ext/oci8/tests/lob_013.phpt deleted file mode 100644 index d6ff1b8053fb..000000000000 --- a/ext/oci8/tests/lob_013.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -lob buffering ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("test")); -var_dump($blob->getBuffering()); -var_dump($blob->setBuffering(true)); -var_dump($blob->write("test")); -var_dump($blob->getBuffering()); -var_dump($blob->flush()); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name.""; -$s = oci_parse($c, $select_sql); -oci_execute($s); - -$row = oci_fetch_array($s, OCI_RETURN_LOBS); - -var_dump($row[0]); - - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -int(4) -bool(false) -bool(true) -int(4) -bool(true) -bool(true) -string(8) "testtest" -Done diff --git a/ext/oci8/tests/lob_014.phpt b/ext/oci8/tests/lob_014.phpt deleted file mode 100644 index 1a84f824df56..000000000000 --- a/ext/oci8/tests/lob_014.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -oci_lob_free()/close() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("test")); -var_dump($blob->close()); -var_dump($blob->write("test")); -var_dump($blob->free()); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name.""; -$s = oci_parse($c, $select_sql); -oci_execute($s); - -var_dump(oci_fetch_array($s, OCI_NUM + OCI_RETURN_LOBS)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -int(4) -bool(true) -int(4) -bool(true) -array(1) { - [0]=> - string(8) "testtest" -} -Done diff --git a/ext/oci8/tests/lob_016.phpt b/ext/oci8/tests/lob_016.phpt deleted file mode 100644 index 60ed50d5bc92..000000000000 --- a/ext/oci8/tests/lob_016.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -returning multiple lobs ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("first"); -$row['LOB_2']->write("second"); - -unset($row); - -oci_commit($c); - -$select = "SELECT * FROM lob_test FOR UPDATE"; -$statement = oci_parse($c, $select); -oci_execute($statement, OCI_DEFAULT); - -$row = oci_fetch_assoc($statement); - -var_dump($row); -var_dump($row['LOB_1']->load()); -var_dump($row['LOB_2']->load()); - -$drop = "DROP table lob_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -echo "Done\n"; - -?> ---EXPECTF-- -array(2) { - ["LOB_1"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["LOB_2"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(5) "first" -string(6) "second" -Done diff --git a/ext/oci8/tests/lob_017.phpt b/ext/oci8/tests/lob_017.phpt deleted file mode 100644 index 96755725fec1..000000000000 --- a/ext/oci8/tests/lob_017.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -returning multiple lobs (using persistent connection) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("first"); -$row['LOB_2']->write("second"); - -unset($row); - -oci_commit($c); - -$select = "SELECT * FROM lob_test FOR UPDATE"; -$statement = oci_parse($c, $select); -oci_execute($statement, OCI_DEFAULT); - -$row = oci_fetch_assoc($statement); - -var_dump($row); -var_dump($row['LOB_1']->load()); -var_dump($row['LOB_2']->load()); - -$drop = "DROP table lob_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -echo "Done\n"; - -?> ---EXPECTF-- -array(2) { - ["LOB_1"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["LOB_2"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(5) "first" -string(6) "second" -Done diff --git a/ext/oci8/tests/lob_018.phpt b/ext/oci8/tests/lob_018.phpt deleted file mode 100644 index 386f157cdefd..000000000000 --- a/ext/oci8/tests/lob_018.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -fetching the same lob several times ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -save("data"); - -oci_commit($c); - -$init = "insert into lob_018_tab (mykey, lob_1) values(2, empty_clob()) returning lob_1 into :mylob"; -$statement = oci_parse($c, $init); -$clob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($statement, ":mylob", $clob, -1, OCI_B_CLOB); -oci_execute($statement, OCI_DEFAULT); -$clob->save("long data"); - -oci_commit($c); - - -$query = 'select * from lob_018_tab order by mykey asc'; -$statement = oci_parse ($c, $query); -oci_execute($statement, OCI_DEFAULT); - -while ($row = oci_fetch_array($statement, OCI_ASSOC)) { - $result = $row['LOB_1']->load(); - var_dump($result); -} - -echo "Test 2\n"; - -$query = 'select * from lob_018_tab order by mykey desc'; -$statement = oci_parse ($c, $query); -oci_execute($statement, OCI_DEFAULT); - -while ($row = oci_fetch_array($statement, OCI_ASSOC)) { - $result = $row['LOB_1']->load(); - var_dump($result); -} - -echo "Test 3 - bind with SQLT_CLOB (an alias for OCI_B_CLOB)\n"; - -$init = "insert into lob_018_tab (mykey, lob_1) values(3, empty_clob()) returning lob_1 into :mylob"; -$statement = oci_parse($c, $init); -$clob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($statement, ":mylob", $clob, -1, SQLT_CLOB); -oci_execute($statement, OCI_DEFAULT); -$clob->save("more stuff"); - -oci_commit($c); - -$query = 'select * from lob_018_tab where mykey = 3'; -$statement = oci_parse ($c, $query); -oci_execute($statement, OCI_DEFAULT); - -while ($row = oci_fetch_array($statement, OCI_ASSOC)) { - $result = $row['LOB_1']->load(); - var_dump($result); -} - -// Cleanup - -$stmtarray = array( - "drop table lob_018_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECT-- -Test 1 -string(4) "data" -string(9) "long data" -Test 2 -string(9) "long data" -string(4) "data" -Test 3 - bind with SQLT_CLOB (an alias for OCI_B_CLOB) -string(10) "more stuff" diff --git a/ext/oci8/tests/lob_019.phpt b/ext/oci8/tests/lob_019.phpt deleted file mode 100644 index 348b22b121b5..000000000000 --- a/ext/oci8/tests/lob_019.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -oci_lob_write()/erase()/read() with BLOBs ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write($str)); -var_dump($blob->erase(0, 10)); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -var_dump($row[0]->read(5)); -var_dump($row[0]->read(5)); -var_dump($row[0]->read(5)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(72) -int(10) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(5) "%0%0%0%0%0" -string(5) "%0%0%0%0%0" -string(5) "biiii" -Done diff --git a/ext/oci8/tests/lob_020.phpt b/ext/oci8/tests/lob_020.phpt deleted file mode 100644 index 15c107a73eb6..000000000000 --- a/ext/oci8/tests/lob_020.phpt +++ /dev/null @@ -1,165 +0,0 @@ ---TEST-- -oci_lob_write()/erase()/read() with CLOBs ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write($str)); -var_dump($clob->erase(10,20)); - -oci_commit($c); - -$select_sql = "SELECT clob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -var_dump($row[0]->read(2)); -var_dump($row[0]->read(5)); -var_dump($row[0]->read(50)); - -var_dump($clob->erase()); - -echo "\nInvalid values\n"; - -echo "\nTest 1\n"; -try { - var_dump($clob->erase(-10)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -echo "\nTest 2\n"; -try { - var_dump($clob->erase(10,-20)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -echo "\nTest 3\n"; -try { - var_dump($clob->erase(-10,-20)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -echo "\nTest 4\n"; -try { - // ORA-22990: LOB locators cannot span transactions - var_dump(oci_lob_erase($clob)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -echo "\nTest 5\n"; -try { - var_dump(oci_lob_erase($clob,-10)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -echo "\nTest 6\n"; -try { - var_dump(oci_lob_erase($clob,10,-20)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -echo "\nTest 7\n"; -try { - var_dump(oci_lob_erase($clob,-10,-20)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -echo "\nTest 8\n"; -unset($clob->descriptor); -var_dump(oci_lob_erase($clob,10,20)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(82) -int(20) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["CLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(2) "%s" -string(5) "%s" -string(50) "%s at test string. why are you" - -Warning: OCILob::erase(): ORA-22990: %s in %s on line %d -bool(false) - -Invalid values - -Test 1 -OCILob::erase(): Argument #1 ($offset) must be greater than or equal to 0 - -Test 2 -OCILob::erase(): Argument #2 ($length) must be greater than or equal to 0 - -Test 3 -OCILob::erase(): Argument #1 ($offset) must be greater than or equal to 0 - -Test 4 - -Warning: oci_lob_erase(): ORA-22990: %s in %s on line %d -bool(false) - -Test 5 -oci_lob_erase(): Argument #2 ($offset) must be greater than or equal to 0 - -Test 6 -oci_lob_erase(): Argument #3 ($length) must be greater than or equal to 0 - -Test 7 -oci_lob_erase(): Argument #2 ($offset) must be greater than or equal to 0 - -Test 8 - -Warning: oci_lob_erase(): Unable to find descriptor property in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/lob_021.phpt b/ext/oci8/tests/lob_021.phpt deleted file mode 100644 index 755e9c2c6d51..000000000000 --- a/ext/oci8/tests/lob_021.phpt +++ /dev/null @@ -1,77 +0,0 @@ ---TEST-- -oci_lob_free()/close() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("test")); -var_dump($blob->close()); -var_dump($blob->write("test")); -var_dump(oci_free_descriptor($blob)); - -try { - var_dump($blob->write("test")); -} catch(\TypeError $exception) { - var_dump($exception->getMessage()); -} - -try { - var_dump(oci_free_descriptor($blob)); -} catch(\TypeError $exception) { - var_dump($exception->getMessage()); -} - -$blob = oci_new_descriptor($c,OCI_D_LOB); -unset($blob->descriptor); -var_dump(oci_free_descriptor($blob)); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name.""; -$s = oci_parse($c, $select_sql); -oci_execute($s); - -var_dump(oci_fetch_array($s, OCI_NUM + OCI_RETURN_LOBS)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -int(4) -bool(true) -int(4) -bool(true) -string(%d) "OCILob::write(): %s is not a valid oci8 descriptor resource" -string(%d) "oci_free_descriptor(): %s is not a valid oci8 descriptor resource" - -Warning: oci_free_descriptor(): Unable to find descriptor property in %s on line %d -bool(false) -array(1) { - [0]=> - string(8) "testtest" -} -Done diff --git a/ext/oci8/tests/lob_022.phpt b/ext/oci8/tests/lob_022.phpt deleted file mode 100644 index 0e78a3c91fd5..000000000000 --- a/ext/oci8/tests/lob_022.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -fetching the same lob several times ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -descriptor); - -oci_commit($c); - -$init = "INSERT INTO lob_test (mykey, lob_1) VALUES(2, EMPTY_CLOB()) RETURNING lob_1 INTO :mylob"; -$statement = oci_parse($c, $init); -$clob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($statement, ":mylob", $clob, -1, OCI_B_CLOB); -oci_execute($statement, OCI_DEFAULT); -$clob->save("long data"); -$clob->save("long data", 0); - -try { - $clob->save("long data", -1); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -oci_commit($c); - -$query = 'SELECT * FROM lob_test ORDER BY mykey ASC'; -$statement = oci_parse ($c, $query); -oci_execute($statement, OCI_DEFAULT); - -while ($row = oci_fetch_array($statement, OCI_ASSOC)) { - $result = $row['LOB_1']->load(); - var_dump($result); -} - -$query = 'SELECT * FROM lob_test ORDER BY mykey DESC'; -$statement = oci_parse ($c, $query); -oci_execute($statement, OCI_DEFAULT); - -while ($row = oci_fetch_array($statement, OCI_ASSOC)) { - $result = $row['LOB_1']->load(); - var_dump($result); -} - -$drop = "DROP table lob_test"; -$statement = oci_parse($c, $drop); -@oci_execute($statement); - -echo "Done\n"; - -?> ---EXPECT-- - -OCILob::save(): Argument #2 ($offset) must be greater than or equal to 0 -string(4) "data" -string(9) "long data" -string(9) "long data" -string(4) "data" -Done diff --git a/ext/oci8/tests/lob_023.phpt b/ext/oci8/tests/lob_023.phpt deleted file mode 100644 index f7376b646043..000000000000 --- a/ext/oci8/tests/lob_023.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -oci_lob_import()/read() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -seek(10, OCI_SEEK_CUR)); -var_dump($blob->import(__DIR__."/lob_009.txt")); -var_dump(oci_lob_import($blob, __DIR__."/lob_009.txt")); -unset($blob->descriptor); -var_dump(oci_lob_import($blob, __DIR__."/lob_009.txt")); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -while (!$row[0]->eof()) { - var_dump(str_replace("\r", "", $row[0]->read(1024))); -} - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -bool(true) -bool(true) -bool(true) - -Warning: oci_lob_import(): Unable to find descriptor property in %s on line %d -bool(false) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(43) "this -is -a -test -file for -test lob_009.phpt -" -Done diff --git a/ext/oci8/tests/lob_024.phpt b/ext/oci8/tests/lob_024.phpt deleted file mode 100644 index 95b860ace3a7..000000000000 --- a/ext/oci8/tests/lob_024.phpt +++ /dev/null @@ -1,77 +0,0 @@ ---TEST-- -oci_lob_load() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -size()); -var_dump($blob->write(str_repeat("string.", 1000))); -var_dump($blob->size()); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -var_dump(strlen($row[0]->load())); -var_dump(strlen(oci_lob_load($row[0]))); -unset($row[0]->descriptor); -var_dump(oci_lob_load($row[0])); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(0) -int(7000) -int(7000) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -int(7000) -int(7000) - -Warning: oci_lob_load(): Unable to find descriptor property in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/lob_025.phpt b/ext/oci8/tests/lob_025.phpt deleted file mode 100644 index 83f940c22522..000000000000 --- a/ext/oci8/tests/lob_025.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -oci_lob_read() tests ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -size()); -var_dump($blob->write(str_repeat("string.", 1000))); -var_dump($blob->size()); -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); - -var_dump(oci_lob_read($row[0], 2)); -var_dump(oci_lob_eof($row[0])); - -unset($row[0]->descriptor); -var_dump(oci_lob_read($row[0],1)); -var_dump(oci_lob_eof($row[0])); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -int(0) -int(7000) -int(7000) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(2) "st" -bool(false) - -Warning: oci_lob_read(): Unable to find descriptor property in %s on line %d -bool(false) - -Warning: oci_lob_eof(): Unable to find descriptor property in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/lob_026.phpt b/ext/oci8/tests/lob_026.phpt deleted file mode 100644 index a998fc2dddae..000000000000 --- a/ext/oci8/tests/lob_026.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -oci_lob_seek()/rewind()/append() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(4) -bool(true) -int(3) -bool(true) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -bool(true) -string(4) "strt" -string(8) "strtstrt" -Done diff --git a/ext/oci8/tests/lob_027.phpt b/ext/oci8/tests/lob_027.phpt deleted file mode 100644 index 8e83bdecdca6..000000000000 --- a/ext/oci8/tests/lob_027.phpt +++ /dev/null @@ -1,114 +0,0 @@ ---TEST-- -oci_lob_truncate() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write($str)); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row = oci_fetch_array($s)); -oci_commit($c); - -for ($i = 5; $i >= 0; $i--) { - - $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; - $s = oci_parse($c, $select_sql); - oci_execute($s, OCI_DEFAULT); - - $row = oci_fetch_array($s); - var_dump($row['BLOB']->load()); - try { - var_dump($row['BLOB']->truncate(($i-1)*10)); - } catch (ValueError $e) { - echo $e->getMessage(), "\n"; - } - - oci_commit($c); -} - -$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -$row = oci_fetch_array($s); -var_dump($row['BLOB']->load()); -var_dump($row['BLOB']->truncate(0)); - -try { - var_dump($row['BLOB']->truncate(-1)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -oci_commit($c); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -int(72) -array(2) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } - ["BLOB"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(72) "this is a biiiig faaat test string. why are you reading it, I wonder? =)" -bool(true) -string(40) "this is a biiiig faaat test string. why " -bool(true) -string(30) "this is a biiiig faaat test st" -bool(true) -string(20) "this is a biiiig faa" -bool(true) -string(10) "this is a " -bool(true) -string(0) "" -OCILob::truncate(): Argument #1 ($length) must be greater than or equal to 0 -string(0) "" -bool(true) -OCILob::truncate(): Argument #1 ($length) must be greater than or equal to 0 -Done diff --git a/ext/oci8/tests/lob_028.phpt b/ext/oci8/tests/lob_028.phpt deleted file mode 100644 index 165fe2d477bd..000000000000 --- a/ext/oci8/tests/lob_028.phpt +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -Test descriptor types for oci_new_descriptor() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} - -Warning: oci_new_descriptor(): Unknown descriptor type %d in %s on line %d -NULL - -Warning: oci_new_descriptor(): Unknown descriptor type %d in %s on line %d -NULL - -Warning: oci_new_descriptor(): Unknown descriptor type %d in %s on line %d -NULL - -Warning: oci_new_descriptor(): Unknown descriptor type %d in %s on line %d -NULL -Done diff --git a/ext/oci8/tests/lob_029.phpt b/ext/oci8/tests/lob_029.phpt deleted file mode 100644 index 515fc938b95c..000000000000 --- a/ext/oci8/tests/lob_029.phpt +++ /dev/null @@ -1,136 +0,0 @@ ---TEST-- -reading/writing BFILE LOBs ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -ob_start(); -phpinfo(INFO_MODULES); -$phpinfo = ob_get_clean(); -if (preg_match('/Compile-time ORACLE_HOME/', $phpinfo) !== 1) { - // Assume building PHP with an ORACLE_HOME means the tested DB is on the same machine as PHP - die("skip this test won't work with remote Oracle"); -} -if (substr(PHP_OS, 0, 3) == 'WIN') die("skip Test script not ported to Windows"); -?> ---FILE-- -read(40); -var_dump($r); - -unlink($fullname1); -unlink($fullname2); -unlink($fullname3); - -$s = oci_parse($c, "drop table FileTest"); -oci_execute($s); - -$s = oci_parse($c, "drop directory TestDir"); -oci_execute($s); - -echo "Done\n"; -?> ---EXPECT-- -Test 1. Check how many rows in the table -array(1) { - ["NUMROWS"]=> - array(1) { - [0]=> - string(1) "3" - } -} -Test 2 -array(3) { - ["FILENUM"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - } - ["FILEDESC"]=> - array(3) { - [0]=> - string(13) "Description 1" - [1]=> - string(13) "Description 2" - [2]=> - string(13) "Description 3" - } - ["IMAGE"]=> - array(3) { - [0]=> - string(24) "Some text in the bfile 1" - [1]=> - string(24) "Some text in the bfile 2" - [2]=> - string(24) "Some text in the bfile 3" - } -} -Test 3 -string(24) "Some text in the bfile 1" -Done diff --git a/ext/oci8/tests/lob_030.phpt b/ext/oci8/tests/lob_030.phpt deleted file mode 100644 index dc21401503cd..000000000000 --- a/ext/oci8/tests/lob_030.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -Test piecewise fetch of CLOBs equal to, and larger than PHP_OCI_LOB_BUFFER_SIZE ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write($data); - - // Verify the data - $select_sql = "SELECT clob FROM ".$tn." where id = ".$id; - $s = oci_parse($c, $select_sql); - oci_execute($s); - - $row = oci_fetch_array($s, OCI_RETURN_LOBS); - - var_dump(strlen($row[0])); -} - -echo "Test 1: A CLOB with an even number of bytes\n"; -insert_verify($c, $schema.$table_name, 1, 1050000); - -echo "Test 2: A CLOB with an odd number of bytes\n"; -insert_verify($c, $schema.$table_name, 2, 1050001); - -echo "Test 3: A CLOB of 1048576 bytes (== size of PHP_OCI_LOB_BUFFER_SIZE at time of test creation)\n"; -insert_verify($c, $schema.$table_name, 3, 1048576); - -echo "Test 4: A CLOB of 1049028 bytes (the value used for chunks in the code)\n"; -insert_verify($c, $schema.$table_name, 4, 1049028); - -echo "Test 5: A CLOB of 1049028-1 bytes\n"; -insert_verify($c, $schema.$table_name, 5, 1049028-1); - -echo "Test 6: A CLOB of 1049028+1 bytes\n"; -insert_verify($c, $schema.$table_name, 6, 1049028+1); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -Test 1: A CLOB with an even number of bytes -int(1050000) -Test 2: A CLOB with an odd number of bytes -int(1050001) -Test 3: A CLOB of 1048576 bytes (== size of PHP_OCI_LOB_BUFFER_SIZE at time of test creation) -int(1048576) -Test 4: A CLOB of 1049028 bytes (the value used for chunks in the code) -int(1049028) -Test 5: A CLOB of 1049028-1 bytes -int(1049027) -Test 6: A CLOB of 1049028+1 bytes -int(1049029) -Done diff --git a/ext/oci8/tests/lob_031.phpt b/ext/oci8/tests/lob_031.phpt deleted file mode 100644 index 1816db7a8b8c..000000000000 --- a/ext/oci8/tests/lob_031.phpt +++ /dev/null @@ -1,113 +0,0 @@ ---TEST-- -Test LOB->read(), LOB->seek() and LOB->tell() with nul bytes in data ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("test"); -$blob->tell(); -$blob->seek(10, OCI_SEEK_CUR); -$blob->write("string"); -$blob->flush(); - -$select_sql = "SELECT blob FROM ".$schema.$table_name; -$s = oci_parse($c, $select_sql); -oci_execute($s); -$row = oci_fetch_array($s); - -$row[0]->read(3); -echo " 1. ".$row[0]->tell(). "\n"; - -$row[0]->read(3); -echo " 2. ".$row[0]->tell(). "\n"; - -$row[0]->read(3); -echo " 3. ".$row[0]->tell(). "\n"; - -$row[0]->read(6); -echo " 4. ".$row[0]->tell(). "\n"; - -$row[0]->read(4); -echo " 5. ".$row[0]->tell(). "\n"; - -// Read past end -$row[0]->read(5); -echo " 6. ".$row[0]->tell(). "\n"; - -$row[0]->read(1); -echo " 8. ".$row[0]->tell(). "\n"; - -// Now seek -$row[0]->seek(1); -echo " 9. ".$row[0]->tell(). "\n"; - -$row[0]->seek(8); -echo "10. ".$row[0]->tell(). "\n"; - -$row[0]->seek(20); -echo "11. ".$row[0]->tell(). "\n"; - -// Seek past end -$row[0]->seek(25); -echo "12. ".$row[0]->tell(). "\n"; - -// Seek past end -$row[0]->seek(2, OCI_SEEK_SET); -echo "13. ".$row[0]->tell(). "\n"; - -// Move on 2 more -$row[0]->seek(2, OCI_SEEK_CUR); -echo "14. ".$row[0]->tell(). "\n"; - -// Move 3 past the end -$row[0]->seek(3, OCI_SEEK_END); -echo "15. ".$row[0]->tell(). "\n"; - -// Move 4 before the end -$row[0]->seek(-4, OCI_SEEK_END); -echo "16. ".$row[0]->tell(). "\n"; - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- - 1. 3 - 2. 6 - 3. 9 - 4. 15 - 5. 19 - 6. 20 - 8. 20 - 9. 1 -10. 8 -11. 20 -12. 25 -13. 2 -14. 4 -15. 23 -16. 16 -Done diff --git a/ext/oci8/tests/lob_032.phpt b/ext/oci8/tests/lob_032.phpt deleted file mode 100644 index cdf77fbddfeb..000000000000 --- a/ext/oci8/tests/lob_032.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -oci_lob_write() and friends ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write() to fail -$clob->write("data"); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -Warning: OCILob::write(): ORA-22990: %s in %s on line 19 -Done diff --git a/ext/oci8/tests/lob_033.phpt b/ext/oci8/tests/lob_033.phpt deleted file mode 100644 index c2715599be7a..000000000000 --- a/ext/oci8/tests/lob_033.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -various oci_lob_write() error messages ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -save(""); - -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -var_dump($blob->save("")); -var_dump($blob->save("data", 100)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -Warning: OCILob::save(): OCI_INVALID_HANDLE in %s on line %d -bool(true) -bool(true) -Done diff --git a/ext/oci8/tests/lob_034.phpt b/ext/oci8/tests/lob_034.phpt deleted file mode 100644 index 95c3b6b8b921..000000000000 --- a/ext/oci8/tests/lob_034.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -lob buffering - 2 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -getBuffering()); -var_dump($blob->setBuffering(false)); -var_dump($blob->setBuffering(false)); -var_dump($blob->setBuffering(true)); -var_dump($blob->setBuffering(true)); -var_dump($blob->flush()); -var_dump($blob->flush(0)); -var_dump($blob->flush(-1)); - -oci_commit($c); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: OCILob::flush(): Invalid flag value: -1 in %s on line %d -bool(false) -Done diff --git a/ext/oci8/tests/lob_035.phpt b/ext/oci8/tests/lob_035.phpt deleted file mode 100644 index 4406c73e7dd3..000000000000 --- a/ext/oci8/tests/lob_035.phpt +++ /dev/null @@ -1,129 +0,0 @@ ---TEST-- -oci_lob_copy() - 2 ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("some string here. string, I said")); -oci_commit($c); - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (id, blob) - VALUES (2, empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$statement = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_D_LOB); -oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($statement, OCI_DEFAULT); - -oci_commit($c); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 1"; -$s = oci_parse($c, $select_sql); -oci_execute($s); - -$row1 = oci_fetch_array($s); - -$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 2 FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -$row2 = oci_fetch_array($s); - -$dummy = oci_new_descriptor($c, OCI_D_LOB); - -//-------------------------------------------------- - -echo "\noci_lob_copy invalid args\n"; - -var_dump(oci_lob_copy($dummy, $row1[0])); -var_dump(oci_lob_copy($row2[0], $dummy)); -var_dump(oci_lob_copy($row2[0], $row1[0], 0)); -var_dump(oci_lob_copy($row2[0], $row1[0], 100000)); - -try { - var_dump(oci_lob_copy($row2[0], $row1[0], -1)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -//-------------------------------------------------- - -echo "\noci_lob_size tests\n"; - -var_dump(oci_lob_size($row2[0])); -unset($dummy->descriptor); -var_dump(oci_lob_size($dummy)); - -oci_rollback($c); - -//-------------------------------------------------- - -echo "\nQuery test\n"; - -$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 2 FOR UPDATE"; -$s = oci_parse($c, $select_sql); -oci_execute($s, OCI_DEFAULT); - -var_dump($row2 = oci_fetch_array($s, OCI_RETURN_LOBS)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -Writing blob -int(32) - -oci_lob_copy invalid args - -Warning: oci_lob_copy(): OCI_INVALID_HANDLE in %s on line %d -bool(false) - -Warning: oci_lob_copy(): OCI_INVALID_HANDLE in %s on line %d -bool(false) -bool(false) -bool(true) -oci_lob_copy(): Argument #3 ($length) must be greater than or equal to 0 - -oci_lob_size tests -int(0) - -Warning: oci_lob_size(): Unable to find descriptor property in %s on line %d -bool(false) - -Query test -array(2) { - [0]=> - string(0) "" - ["BLOB"]=> - string(0) "" -} -Done diff --git a/ext/oci8/tests/lob_036.phpt b/ext/oci8/tests/lob_036.phpt deleted file mode 100644 index 82d178deaa1d..000000000000 --- a/ext/oci8/tests/lob_036.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Exercise cleanup code when LOB buffering is on ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("test")); -var_dump($blob->setBuffering(true)); -var_dump($blob->write("test")); - -$blob = null; - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -int(4) -bool(true) -int(4) -Done diff --git a/ext/oci8/tests/lob_037.phpt b/ext/oci8/tests/lob_037.phpt deleted file mode 100644 index 3207398f1136..000000000000 --- a/ext/oci8/tests/lob_037.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Fetching two different lobs and using them after fetch ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("first lob data")); -oci_commit($c); - -/* insert the second LOB */ -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$s = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_DTYPE_LOB); - -oci_bind_by_name($s,":v_blob", $blob,-1,OCI_B_BLOB); -oci_execute($s, OCI_DEFAULT); - -var_dump($blob->write("second lob data")); -oci_commit($c); - -/* select both */ - -$ora_sql = "SELECT blob FROM ".$schema.$table_name; -$s = oci_parse($c,$ora_sql); -oci_execute($s, OCI_DEFAULT); - -$rows = array(); -$rows[0] = oci_fetch_assoc($s); -$rows[1] = oci_fetch_assoc($s); - -var_dump($rows[0]['BLOB']->read(1000)); -var_dump($rows[1]['BLOB']->read(1000)); - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -int(14) -int(15) -string(14) "first lob data" -string(15) "second lob data" -Done diff --git a/ext/oci8/tests/lob_038.phpt b/ext/oci8/tests/lob_038.phpt deleted file mode 100644 index b4f975ef2d8d..000000000000 --- a/ext/oci8/tests/lob_038.phpt +++ /dev/null @@ -1,195 +0,0 @@ ---TEST-- -Array fetch CLOB and BLOB ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -save("clob test 1")); - -oci_execute($s, OCI_DEFAULT); -var_dump($clob->save("clob test 2")); - -oci_execute($s, OCI_DEFAULT); -var_dump($clob->save("clob test 3")); - - -$s = oci_parse($c,"select clob from ".$schema.$table_name); -var_dump(oci_execute($s)); - -oci_fetch_all($s, $res); - -var_dump($res); - - -echo "Test 1b\n"; - -$s = oci_parse($c, "select clob from ".$schema.$table_name); -var_dump(oci_execute($s, OCI_DEFAULT)); -while ($row = oci_fetch_array($s, OCI_ASSOC)) { - var_dump($row); - $result = $row['CLOB']->load(); - var_dump($result); -} - - -require __DIR__.'/drop_table.inc'; - -echo "Test 2: BLOB\n"; - -require __DIR__.'/create_table.inc'; - -$ora_sql = "INSERT INTO - ".$schema.$table_name." (blob) - VALUES (empty_blob()) - RETURNING - blob - INTO :v_blob "; - -$s = oci_parse($c,$ora_sql); -$blob = oci_new_descriptor($c,OCI_DTYPE_LOB); - - -oci_bind_by_name($s,":v_blob", $blob,-1,OCI_B_BLOB); - -oci_execute($s, OCI_DEFAULT); -var_dump($blob->save("blob test 1")); - -oci_execute($s, OCI_DEFAULT); -var_dump($blob->save("blob test 2")); - -oci_execute($s, OCI_DEFAULT); -var_dump($blob->save("blob test 3")); - -$s = oci_parse($c, "select blob from ".$schema.$table_name); -var_dump(oci_execute($s)); -oci_fetch_all($s, $res); -var_dump($res); - -echo "Test 2b\n"; - -$s = oci_parse($c, "select blob from ".$schema.$table_name); -var_dump(oci_execute($s, OCI_DEFAULT)); -while ($row = oci_fetch_array($s, OCI_ASSOC)) { - var_dump($row); - $result = $row['BLOB']->load(); - var_dump($result); -} - - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -Test 1: CLOB -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - ["CLOB"]=> - array(3) { - [0]=> - string(11) "clob test 1" - [1]=> - string(11) "clob test 2" - [2]=> - string(11) "clob test 3" - } -} -Test 1b -bool(true) -array(1) { - ["CLOB"]=> - object(OCILob)#2 (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(11) "clob test 1" -array(1) { - ["CLOB"]=> - object(OCILob)#3 (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(11) "clob test 2" -array(1) { - ["CLOB"]=> - object(OCILob)#2 (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(11) "clob test 3" -Test 2: BLOB -bool(true) -bool(true) -bool(true) -bool(true) -array(1) { - ["BLOB"]=> - array(3) { - [0]=> - string(11) "blob test 1" - [1]=> - string(11) "blob test 2" - [2]=> - string(11) "blob test 3" - } -} -Test 2b -bool(true) -array(1) { - ["BLOB"]=> - object(OCILob)#3 (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(11) "blob test 1" -array(1) { - ["BLOB"]=> - object(OCILob)#4 (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(11) "blob test 2" -array(1) { - ["BLOB"]=> - object(OCILob)#3 (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -string(11) "blob test 3" -Done diff --git a/ext/oci8/tests/lob_039.phpt b/ext/oci8/tests/lob_039.phpt deleted file mode 100644 index db7d74e33b91..000000000000 --- a/ext/oci8/tests/lob_039.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -Test CLOB->write() for multiple inserts ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("clob test 1")); - -oci_execute($s, OCI_DEFAULT); -var_dump($clob->write("clob test 2")); - -oci_execute($s, OCI_DEFAULT); -var_dump($clob->write("clob test 3")); - -$s = oci_parse($c,"select clob from ".$schema.$table_name); -var_dump(oci_execute($s)); - -oci_fetch_all($s, $res); - -var_dump($res); - - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -Test 1: CLOB -int(11) -int(11) -int(11) -bool(true) -array(1) { - ["CLOB"]=> - array(3) { - [0]=> - string(11) "clob test 1" - [1]=> - string(22) " clob test 2" - [2]=> - string(33) " clob test 3" - } -} -Done diff --git a/ext/oci8/tests/lob_040.phpt b/ext/oci8/tests/lob_040.phpt deleted file mode 100644 index 013cfdda4e4d..000000000000 --- a/ext/oci8/tests/lob_040.phpt +++ /dev/null @@ -1,1047 +0,0 @@ ---TEST-- -Bug #37706 (Test LOB locator reuse. Extends simple test of lob_037.phpt) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -size() . "\n"; - echo "Pos 1: " . $row[$i][0]->tell() . "\n"; - echo "Data: " . $row[$i][0]->read(5) . "\n"; - echo "Pos 2: " . $row[$i][0]->tell() . "\n"; - echo "Data: " . $row[$i][0]->read(12) . "\n"; -} - -echo "Done\n"; - -?> ---EXPECT-- -Test 1: CLOB as locator -Row 0 Size: 35 -Pos 1: 0 -Data: 0aaaa -Pos 2: 5 -Data: 00aaaaaaaaaa -Row 1 Size: 35 -Pos 1: 0 -Data: 1aaaa -Pos 2: 5 -Data: 11aaaaaaaaaa -Row 2 Size: 35 -Pos 1: 0 -Data: 2aaaa -Pos 2: 5 -Data: 22aaaaaaaaaa -Row 3 Size: 35 -Pos 1: 0 -Data: 3aaaa -Pos 2: 5 -Data: 33aaaaaaaaaa -Row 4 Size: 35 -Pos 1: 0 -Data: 4aaaa -Pos 2: 5 -Data: 44aaaaaaaaaa -Row 5 Size: 35 -Pos 1: 0 -Data: 5aaaa -Pos 2: 5 -Data: 55aaaaaaaaaa -Row 6 Size: 35 -Pos 1: 0 -Data: 6aaaa -Pos 2: 5 -Data: 66aaaaaaaaaa -Row 7 Size: 35 -Pos 1: 0 -Data: 7aaaa -Pos 2: 5 -Data: 77aaaaaaaaaa -Row 8 Size: 35 -Pos 1: 0 -Data: 8aaaa -Pos 2: 5 -Data: 88aaaaaaaaaa -Row 9 Size: 35 -Pos 1: 0 -Data: 9aaaa -Pos 2: 5 -Data: 99aaaaaaaaaa -Row 10 Size: 38 -Pos 1: 0 -Data: 10aaa -Pos 2: 5 -Data: a1010aaaaaaa -Row 11 Size: 38 -Pos 1: 0 -Data: 11aaa -Pos 2: 5 -Data: a1111aaaaaaa -Row 12 Size: 38 -Pos 1: 0 -Data: 12aaa -Pos 2: 5 -Data: a1212aaaaaaa -Row 13 Size: 38 -Pos 1: 0 -Data: 13aaa -Pos 2: 5 -Data: a1313aaaaaaa -Row 14 Size: 38 -Pos 1: 0 -Data: 14aaa -Pos 2: 5 -Data: a1414aaaaaaa -Row 15 Size: 38 -Pos 1: 0 -Data: 15aaa -Pos 2: 5 -Data: a1515aaaaaaa -Row 16 Size: 38 -Pos 1: 0 -Data: 16aaa -Pos 2: 5 -Data: a1616aaaaaaa -Row 17 Size: 38 -Pos 1: 0 -Data: 17aaa -Pos 2: 5 -Data: a1717aaaaaaa -Row 18 Size: 38 -Pos 1: 0 -Data: 18aaa -Pos 2: 5 -Data: a1818aaaaaaa -Row 19 Size: 38 -Pos 1: 0 -Data: 19aaa -Pos 2: 5 -Data: a1919aaaaaaa -Row 20 Size: 38 -Pos 1: 0 -Data: 20aaa -Pos 2: 5 -Data: a2020aaaaaaa -Row 21 Size: 38 -Pos 1: 0 -Data: 21aaa -Pos 2: 5 -Data: a2121aaaaaaa -Row 22 Size: 38 -Pos 1: 0 -Data: 22aaa -Pos 2: 5 -Data: a2222aaaaaaa -Row 23 Size: 38 -Pos 1: 0 -Data: 23aaa -Pos 2: 5 -Data: a2323aaaaaaa -Row 24 Size: 38 -Pos 1: 0 -Data: 24aaa -Pos 2: 5 -Data: a2424aaaaaaa -Row 25 Size: 38 -Pos 1: 0 -Data: 25aaa -Pos 2: 5 -Data: a2525aaaaaaa -Row 26 Size: 38 -Pos 1: 0 -Data: 26aaa -Pos 2: 5 -Data: a2626aaaaaaa -Row 27 Size: 38 -Pos 1: 0 -Data: 27aaa -Pos 2: 5 -Data: a2727aaaaaaa -Row 28 Size: 38 -Pos 1: 0 -Data: 28aaa -Pos 2: 5 -Data: a2828aaaaaaa -Row 29 Size: 38 -Pos 1: 0 -Data: 29aaa -Pos 2: 5 -Data: a2929aaaaaaa -Row 30 Size: 38 -Pos 1: 0 -Data: 30aaa -Pos 2: 5 -Data: a3030aaaaaaa -Row 31 Size: 38 -Pos 1: 0 -Data: 31aaa -Pos 2: 5 -Data: a3131aaaaaaa -Row 32 Size: 38 -Pos 1: 0 -Data: 32aaa -Pos 2: 5 -Data: a3232aaaaaaa -Row 33 Size: 38 -Pos 1: 0 -Data: 33aaa -Pos 2: 5 -Data: a3333aaaaaaa -Row 34 Size: 38 -Pos 1: 0 -Data: 34aaa -Pos 2: 5 -Data: a3434aaaaaaa -Row 35 Size: 38 -Pos 1: 0 -Data: 35aaa -Pos 2: 5 -Data: a3535aaaaaaa -Row 36 Size: 38 -Pos 1: 0 -Data: 36aaa -Pos 2: 5 -Data: a3636aaaaaaa -Row 37 Size: 38 -Pos 1: 0 -Data: 37aaa -Pos 2: 5 -Data: a3737aaaaaaa -Row 38 Size: 38 -Pos 1: 0 -Data: 38aaa -Pos 2: 5 -Data: a3838aaaaaaa -Row 39 Size: 38 -Pos 1: 0 -Data: 39aaa -Pos 2: 5 -Data: a3939aaaaaaa -Row 40 Size: 38 -Pos 1: 0 -Data: 40aaa -Pos 2: 5 -Data: a4040aaaaaaa -Row 41 Size: 38 -Pos 1: 0 -Data: 41aaa -Pos 2: 5 -Data: a4141aaaaaaa -Row 42 Size: 38 -Pos 1: 0 -Data: 42aaa -Pos 2: 5 -Data: a4242aaaaaaa -Row 43 Size: 38 -Pos 1: 0 -Data: 43aaa -Pos 2: 5 -Data: a4343aaaaaaa -Row 44 Size: 38 -Pos 1: 0 -Data: 44aaa -Pos 2: 5 -Data: a4444aaaaaaa -Row 45 Size: 38 -Pos 1: 0 -Data: 45aaa -Pos 2: 5 -Data: a4545aaaaaaa -Row 46 Size: 38 -Pos 1: 0 -Data: 46aaa -Pos 2: 5 -Data: a4646aaaaaaa -Row 47 Size: 38 -Pos 1: 0 -Data: 47aaa -Pos 2: 5 -Data: a4747aaaaaaa -Row 48 Size: 38 -Pos 1: 0 -Data: 48aaa -Pos 2: 5 -Data: a4848aaaaaaa -Row 49 Size: 38 -Pos 1: 0 -Data: 49aaa -Pos 2: 5 -Data: a4949aaaaaaa -Row 50 Size: 38 -Pos 1: 0 -Data: 50aaa -Pos 2: 5 -Data: a5050aaaaaaa -Row 51 Size: 38 -Pos 1: 0 -Data: 51aaa -Pos 2: 5 -Data: a5151aaaaaaa -Row 52 Size: 38 -Pos 1: 0 -Data: 52aaa -Pos 2: 5 -Data: a5252aaaaaaa -Row 53 Size: 38 -Pos 1: 0 -Data: 53aaa -Pos 2: 5 -Data: a5353aaaaaaa -Row 54 Size: 38 -Pos 1: 0 -Data: 54aaa -Pos 2: 5 -Data: a5454aaaaaaa -Row 55 Size: 38 -Pos 1: 0 -Data: 55aaa -Pos 2: 5 -Data: a5555aaaaaaa -Row 56 Size: 38 -Pos 1: 0 -Data: 56aaa -Pos 2: 5 -Data: a5656aaaaaaa -Row 57 Size: 38 -Pos 1: 0 -Data: 57aaa -Pos 2: 5 -Data: a5757aaaaaaa -Row 58 Size: 38 -Pos 1: 0 -Data: 58aaa -Pos 2: 5 -Data: a5858aaaaaaa -Row 59 Size: 38 -Pos 1: 0 -Data: 59aaa -Pos 2: 5 -Data: a5959aaaaaaa -Row 60 Size: 38 -Pos 1: 0 -Data: 60aaa -Pos 2: 5 -Data: a6060aaaaaaa -Row 61 Size: 38 -Pos 1: 0 -Data: 61aaa -Pos 2: 5 -Data: a6161aaaaaaa -Row 62 Size: 38 -Pos 1: 0 -Data: 62aaa -Pos 2: 5 -Data: a6262aaaaaaa -Row 63 Size: 38 -Pos 1: 0 -Data: 63aaa -Pos 2: 5 -Data: a6363aaaaaaa -Row 64 Size: 38 -Pos 1: 0 -Data: 64aaa -Pos 2: 5 -Data: a6464aaaaaaa -Row 65 Size: 38 -Pos 1: 0 -Data: 65aaa -Pos 2: 5 -Data: a6565aaaaaaa -Row 66 Size: 38 -Pos 1: 0 -Data: 66aaa -Pos 2: 5 -Data: a6666aaaaaaa -Row 67 Size: 38 -Pos 1: 0 -Data: 67aaa -Pos 2: 5 -Data: a6767aaaaaaa -Row 68 Size: 38 -Pos 1: 0 -Data: 68aaa -Pos 2: 5 -Data: a6868aaaaaaa -Row 69 Size: 38 -Pos 1: 0 -Data: 69aaa -Pos 2: 5 -Data: a6969aaaaaaa -Row 70 Size: 38 -Pos 1: 0 -Data: 70aaa -Pos 2: 5 -Data: a7070aaaaaaa -Row 71 Size: 38 -Pos 1: 0 -Data: 71aaa -Pos 2: 5 -Data: a7171aaaaaaa -Row 72 Size: 38 -Pos 1: 0 -Data: 72aaa -Pos 2: 5 -Data: a7272aaaaaaa -Row 73 Size: 38 -Pos 1: 0 -Data: 73aaa -Pos 2: 5 -Data: a7373aaaaaaa -Row 74 Size: 38 -Pos 1: 0 -Data: 74aaa -Pos 2: 5 -Data: a7474aaaaaaa -Row 75 Size: 38 -Pos 1: 0 -Data: 75aaa -Pos 2: 5 -Data: a7575aaaaaaa -Row 76 Size: 38 -Pos 1: 0 -Data: 76aaa -Pos 2: 5 -Data: a7676aaaaaaa -Row 77 Size: 38 -Pos 1: 0 -Data: 77aaa -Pos 2: 5 -Data: a7777aaaaaaa -Row 78 Size: 38 -Pos 1: 0 -Data: 78aaa -Pos 2: 5 -Data: a7878aaaaaaa -Row 79 Size: 38 -Pos 1: 0 -Data: 79aaa -Pos 2: 5 -Data: a7979aaaaaaa -Row 80 Size: 38 -Pos 1: 0 -Data: 80aaa -Pos 2: 5 -Data: a8080aaaaaaa -Row 81 Size: 38 -Pos 1: 0 -Data: 81aaa -Pos 2: 5 -Data: a8181aaaaaaa -Row 82 Size: 38 -Pos 1: 0 -Data: 82aaa -Pos 2: 5 -Data: a8282aaaaaaa -Row 83 Size: 38 -Pos 1: 0 -Data: 83aaa -Pos 2: 5 -Data: a8383aaaaaaa -Row 84 Size: 38 -Pos 1: 0 -Data: 84aaa -Pos 2: 5 -Data: a8484aaaaaaa -Row 85 Size: 38 -Pos 1: 0 -Data: 85aaa -Pos 2: 5 -Data: a8585aaaaaaa -Row 86 Size: 38 -Pos 1: 0 -Data: 86aaa -Pos 2: 5 -Data: a8686aaaaaaa -Row 87 Size: 38 -Pos 1: 0 -Data: 87aaa -Pos 2: 5 -Data: a8787aaaaaaa -Row 88 Size: 38 -Pos 1: 0 -Data: 88aaa -Pos 2: 5 -Data: a8888aaaaaaa -Row 89 Size: 38 -Pos 1: 0 -Data: 89aaa -Pos 2: 5 -Data: a8989aaaaaaa -Row 90 Size: 38 -Pos 1: 0 -Data: 90aaa -Pos 2: 5 -Data: a9090aaaaaaa -Row 91 Size: 38 -Pos 1: 0 -Data: 91aaa -Pos 2: 5 -Data: a9191aaaaaaa -Row 92 Size: 38 -Pos 1: 0 -Data: 92aaa -Pos 2: 5 -Data: a9292aaaaaaa -Row 93 Size: 38 -Pos 1: 0 -Data: 93aaa -Pos 2: 5 -Data: a9393aaaaaaa -Row 94 Size: 38 -Pos 1: 0 -Data: 94aaa -Pos 2: 5 -Data: a9494aaaaaaa -Row 95 Size: 38 -Pos 1: 0 -Data: 95aaa -Pos 2: 5 -Data: a9595aaaaaaa -Row 96 Size: 38 -Pos 1: 0 -Data: 96aaa -Pos 2: 5 -Data: a9696aaaaaaa -Row 97 Size: 38 -Pos 1: 0 -Data: 97aaa -Pos 2: 5 -Data: a9797aaaaaaa -Row 98 Size: 38 -Pos 1: 0 -Data: 98aaa -Pos 2: 5 -Data: a9898aaaaaaa -Row 99 Size: 38 -Pos 1: 0 -Data: 99aaa -Pos 2: 5 -Data: a9999aaaaaaa -Row 100 Size: 41 -Pos 1: 0 -Data: 100aa -Pos 2: 5 -Data: aa100100aaaa -Row 101 Size: 41 -Pos 1: 0 -Data: 101aa -Pos 2: 5 -Data: aa101101aaaa -Row 102 Size: 41 -Pos 1: 0 -Data: 102aa -Pos 2: 5 -Data: aa102102aaaa -Row 103 Size: 41 -Pos 1: 0 -Data: 103aa -Pos 2: 5 -Data: aa103103aaaa -Row 104 Size: 41 -Pos 1: 0 -Data: 104aa -Pos 2: 5 -Data: aa104104aaaa -Row 105 Size: 41 -Pos 1: 0 -Data: 105aa -Pos 2: 5 -Data: aa105105aaaa -Row 106 Size: 41 -Pos 1: 0 -Data: 106aa -Pos 2: 5 -Data: aa106106aaaa -Row 107 Size: 41 -Pos 1: 0 -Data: 107aa -Pos 2: 5 -Data: aa107107aaaa -Row 108 Size: 41 -Pos 1: 0 -Data: 108aa -Pos 2: 5 -Data: aa108108aaaa -Row 109 Size: 41 -Pos 1: 0 -Data: 109aa -Pos 2: 5 -Data: aa109109aaaa -Row 110 Size: 41 -Pos 1: 0 -Data: 110aa -Pos 2: 5 -Data: aa110110aaaa -Row 111 Size: 41 -Pos 1: 0 -Data: 111aa -Pos 2: 5 -Data: aa111111aaaa -Row 112 Size: 41 -Pos 1: 0 -Data: 112aa -Pos 2: 5 -Data: aa112112aaaa -Row 113 Size: 41 -Pos 1: 0 -Data: 113aa -Pos 2: 5 -Data: aa113113aaaa -Row 114 Size: 41 -Pos 1: 0 -Data: 114aa -Pos 2: 5 -Data: aa114114aaaa -Row 115 Size: 41 -Pos 1: 0 -Data: 115aa -Pos 2: 5 -Data: aa115115aaaa -Row 116 Size: 41 -Pos 1: 0 -Data: 116aa -Pos 2: 5 -Data: aa116116aaaa -Row 117 Size: 41 -Pos 1: 0 -Data: 117aa -Pos 2: 5 -Data: aa117117aaaa -Row 118 Size: 41 -Pos 1: 0 -Data: 118aa -Pos 2: 5 -Data: aa118118aaaa -Row 119 Size: 41 -Pos 1: 0 -Data: 119aa -Pos 2: 5 -Data: aa119119aaaa -Row 120 Size: 41 -Pos 1: 0 -Data: 120aa -Pos 2: 5 -Data: aa120120aaaa -Row 121 Size: 41 -Pos 1: 0 -Data: 121aa -Pos 2: 5 -Data: aa121121aaaa -Row 122 Size: 41 -Pos 1: 0 -Data: 122aa -Pos 2: 5 -Data: aa122122aaaa -Row 123 Size: 41 -Pos 1: 0 -Data: 123aa -Pos 2: 5 -Data: aa123123aaaa -Row 124 Size: 41 -Pos 1: 0 -Data: 124aa -Pos 2: 5 -Data: aa124124aaaa -Row 125 Size: 41 -Pos 1: 0 -Data: 125aa -Pos 2: 5 -Data: aa125125aaaa -Row 126 Size: 41 -Pos 1: 0 -Data: 126aa -Pos 2: 5 -Data: aa126126aaaa -Row 127 Size: 41 -Pos 1: 0 -Data: 127aa -Pos 2: 5 -Data: aa127127aaaa -Row 128 Size: 41 -Pos 1: 0 -Data: 128aa -Pos 2: 5 -Data: aa128128aaaa -Row 129 Size: 41 -Pos 1: 0 -Data: 129aa -Pos 2: 5 -Data: aa129129aaaa -Row 130 Size: 41 -Pos 1: 0 -Data: 130aa -Pos 2: 5 -Data: aa130130aaaa -Row 131 Size: 41 -Pos 1: 0 -Data: 131aa -Pos 2: 5 -Data: aa131131aaaa -Row 132 Size: 41 -Pos 1: 0 -Data: 132aa -Pos 2: 5 -Data: aa132132aaaa -Row 133 Size: 41 -Pos 1: 0 -Data: 133aa -Pos 2: 5 -Data: aa133133aaaa -Row 134 Size: 41 -Pos 1: 0 -Data: 134aa -Pos 2: 5 -Data: aa134134aaaa -Row 135 Size: 41 -Pos 1: 0 -Data: 135aa -Pos 2: 5 -Data: aa135135aaaa -Row 136 Size: 41 -Pos 1: 0 -Data: 136aa -Pos 2: 5 -Data: aa136136aaaa -Row 137 Size: 41 -Pos 1: 0 -Data: 137aa -Pos 2: 5 -Data: aa137137aaaa -Row 138 Size: 41 -Pos 1: 0 -Data: 138aa -Pos 2: 5 -Data: aa138138aaaa -Row 139 Size: 41 -Pos 1: 0 -Data: 139aa -Pos 2: 5 -Data: aa139139aaaa -Row 140 Size: 41 -Pos 1: 0 -Data: 140aa -Pos 2: 5 -Data: aa140140aaaa -Row 141 Size: 41 -Pos 1: 0 -Data: 141aa -Pos 2: 5 -Data: aa141141aaaa -Row 142 Size: 41 -Pos 1: 0 -Data: 142aa -Pos 2: 5 -Data: aa142142aaaa -Row 143 Size: 41 -Pos 1: 0 -Data: 143aa -Pos 2: 5 -Data: aa143143aaaa -Row 144 Size: 41 -Pos 1: 0 -Data: 144aa -Pos 2: 5 -Data: aa144144aaaa -Row 145 Size: 41 -Pos 1: 0 -Data: 145aa -Pos 2: 5 -Data: aa145145aaaa -Row 146 Size: 41 -Pos 1: 0 -Data: 146aa -Pos 2: 5 -Data: aa146146aaaa -Row 147 Size: 41 -Pos 1: 0 -Data: 147aa -Pos 2: 5 -Data: aa147147aaaa -Row 148 Size: 41 -Pos 1: 0 -Data: 148aa -Pos 2: 5 -Data: aa148148aaaa -Row 149 Size: 41 -Pos 1: 0 -Data: 149aa -Pos 2: 5 -Data: aa149149aaaa -Row 150 Size: 41 -Pos 1: 0 -Data: 150aa -Pos 2: 5 -Data: aa150150aaaa -Row 151 Size: 41 -Pos 1: 0 -Data: 151aa -Pos 2: 5 -Data: aa151151aaaa -Row 152 Size: 41 -Pos 1: 0 -Data: 152aa -Pos 2: 5 -Data: aa152152aaaa -Row 153 Size: 41 -Pos 1: 0 -Data: 153aa -Pos 2: 5 -Data: aa153153aaaa -Row 154 Size: 41 -Pos 1: 0 -Data: 154aa -Pos 2: 5 -Data: aa154154aaaa -Row 155 Size: 41 -Pos 1: 0 -Data: 155aa -Pos 2: 5 -Data: aa155155aaaa -Row 156 Size: 41 -Pos 1: 0 -Data: 156aa -Pos 2: 5 -Data: aa156156aaaa -Row 157 Size: 41 -Pos 1: 0 -Data: 157aa -Pos 2: 5 -Data: aa157157aaaa -Row 158 Size: 41 -Pos 1: 0 -Data: 158aa -Pos 2: 5 -Data: aa158158aaaa -Row 159 Size: 41 -Pos 1: 0 -Data: 159aa -Pos 2: 5 -Data: aa159159aaaa -Row 160 Size: 41 -Pos 1: 0 -Data: 160aa -Pos 2: 5 -Data: aa160160aaaa -Row 161 Size: 41 -Pos 1: 0 -Data: 161aa -Pos 2: 5 -Data: aa161161aaaa -Row 162 Size: 41 -Pos 1: 0 -Data: 162aa -Pos 2: 5 -Data: aa162162aaaa -Row 163 Size: 41 -Pos 1: 0 -Data: 163aa -Pos 2: 5 -Data: aa163163aaaa -Row 164 Size: 41 -Pos 1: 0 -Data: 164aa -Pos 2: 5 -Data: aa164164aaaa -Row 165 Size: 41 -Pos 1: 0 -Data: 165aa -Pos 2: 5 -Data: aa165165aaaa -Row 166 Size: 41 -Pos 1: 0 -Data: 166aa -Pos 2: 5 -Data: aa166166aaaa -Row 167 Size: 41 -Pos 1: 0 -Data: 167aa -Pos 2: 5 -Data: aa167167aaaa -Row 168 Size: 41 -Pos 1: 0 -Data: 168aa -Pos 2: 5 -Data: aa168168aaaa -Row 169 Size: 41 -Pos 1: 0 -Data: 169aa -Pos 2: 5 -Data: aa169169aaaa -Row 170 Size: 41 -Pos 1: 0 -Data: 170aa -Pos 2: 5 -Data: aa170170aaaa -Row 171 Size: 41 -Pos 1: 0 -Data: 171aa -Pos 2: 5 -Data: aa171171aaaa -Row 172 Size: 41 -Pos 1: 0 -Data: 172aa -Pos 2: 5 -Data: aa172172aaaa -Row 173 Size: 41 -Pos 1: 0 -Data: 173aa -Pos 2: 5 -Data: aa173173aaaa -Row 174 Size: 41 -Pos 1: 0 -Data: 174aa -Pos 2: 5 -Data: aa174174aaaa -Row 175 Size: 41 -Pos 1: 0 -Data: 175aa -Pos 2: 5 -Data: aa175175aaaa -Row 176 Size: 41 -Pos 1: 0 -Data: 176aa -Pos 2: 5 -Data: aa176176aaaa -Row 177 Size: 41 -Pos 1: 0 -Data: 177aa -Pos 2: 5 -Data: aa177177aaaa -Row 178 Size: 41 -Pos 1: 0 -Data: 178aa -Pos 2: 5 -Data: aa178178aaaa -Row 179 Size: 41 -Pos 1: 0 -Data: 179aa -Pos 2: 5 -Data: aa179179aaaa -Row 180 Size: 41 -Pos 1: 0 -Data: 180aa -Pos 2: 5 -Data: aa180180aaaa -Row 181 Size: 41 -Pos 1: 0 -Data: 181aa -Pos 2: 5 -Data: aa181181aaaa -Row 182 Size: 41 -Pos 1: 0 -Data: 182aa -Pos 2: 5 -Data: aa182182aaaa -Row 183 Size: 41 -Pos 1: 0 -Data: 183aa -Pos 2: 5 -Data: aa183183aaaa -Row 184 Size: 41 -Pos 1: 0 -Data: 184aa -Pos 2: 5 -Data: aa184184aaaa -Row 185 Size: 41 -Pos 1: 0 -Data: 185aa -Pos 2: 5 -Data: aa185185aaaa -Row 186 Size: 41 -Pos 1: 0 -Data: 186aa -Pos 2: 5 -Data: aa186186aaaa -Row 187 Size: 41 -Pos 1: 0 -Data: 187aa -Pos 2: 5 -Data: aa187187aaaa -Row 188 Size: 41 -Pos 1: 0 -Data: 188aa -Pos 2: 5 -Data: aa188188aaaa -Row 189 Size: 41 -Pos 1: 0 -Data: 189aa -Pos 2: 5 -Data: aa189189aaaa -Row 190 Size: 41 -Pos 1: 0 -Data: 190aa -Pos 2: 5 -Data: aa190190aaaa -Row 191 Size: 41 -Pos 1: 0 -Data: 191aa -Pos 2: 5 -Data: aa191191aaaa -Row 192 Size: 41 -Pos 1: 0 -Data: 192aa -Pos 2: 5 -Data: aa192192aaaa -Row 193 Size: 41 -Pos 1: 0 -Data: 193aa -Pos 2: 5 -Data: aa193193aaaa -Row 194 Size: 41 -Pos 1: 0 -Data: 194aa -Pos 2: 5 -Data: aa194194aaaa -Row 195 Size: 41 -Pos 1: 0 -Data: 195aa -Pos 2: 5 -Data: aa195195aaaa -Row 196 Size: 41 -Pos 1: 0 -Data: 196aa -Pos 2: 5 -Data: aa196196aaaa -Row 197 Size: 41 -Pos 1: 0 -Data: 197aa -Pos 2: 5 -Data: aa197197aaaa -Row 198 Size: 41 -Pos 1: 0 -Data: 198aa -Pos 2: 5 -Data: aa198198aaaa -Row 199 Size: 41 -Pos 1: 0 -Data: 199aa -Pos 2: 5 -Data: aa199199aaaa -Done diff --git a/ext/oci8/tests/lob_041.phpt b/ext/oci8/tests/lob_041.phpt deleted file mode 100644 index 60dc1190f589..000000000000 --- a/ext/oci8/tests/lob_041.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -Check LOBS are valid after statement free ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -load(), "\n"; -oci_free_descriptor($desc); - -echo "\nTest 2 - implicit statement close\n"; - -$s = oci_parse($c, "SELECT C1 FROM lob_041_tab"); -$desc = oci_new_descriptor($c, OCI_DTYPE_LOB); -oci_define_by_name($s, "C1", $desc); -oci_execute($s); -$data = oci_fetch_assoc($s); -$s = null; -echo $data['C1']->load(), "\n"; -oci_free_descriptor($desc); -var_dump($desc); - -echo "\nTest 3 - no preallocated descriptor\n"; - -$s = oci_parse($c, "SELECT C1 FROM lob_041_tab"); -oci_execute($s); -$data = oci_fetch_assoc($s); -$s = null; -echo $data['C1']->load(), "\n"; -var_dump($data); - -// Cleanup - -echo "Done\n"; - -$stmtarray = array( - "DROP table lob_041_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -Test 1 - explicit statement close -test data - -Test 2 - implicit statement close -test data -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (Unknown) -} - -Test 3 - no preallocated descriptor -test data -array(1) { - ["C1"]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -Done diff --git a/ext/oci8/tests/lob_042.phpt b/ext/oci8/tests/lob_042.phpt deleted file mode 100644 index 8a11c8771a18..000000000000 --- a/ext/oci8/tests/lob_042.phpt +++ /dev/null @@ -1,78 +0,0 @@ ---TEST-- -Check various LOB error messages ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -writeTemporary("test", OCI_D_LOB)); - -$str = "string"; -var_dump($blob->write($str)); -var_dump($blob->truncate(1)); -var_dump($blob->truncate(1)); -var_dump($blob->truncate(2)); -var_dump($blob->read(2)); - -var_dump($blob->import("does_not_exist")); -var_dump($blob->saveFile("does_not_exist")); - -try { - var_dump($blob->truncate(-1)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECTF-- -object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) -} - -Warning: OCILob::writeTemporary(): Invalid temporary lob type: %d in %s on line %d -bool(false) -int(6) -bool(true) -bool(true) - -Warning: OCILob::truncate(): Size must be less than or equal to the current LOB size in %s on line %d -bool(false) - -Warning: OCILob::read(): Offset must be less than size of the LOB in %s on line %d -bool(false) - -Warning: OCILob::import(): Can't open file %s in %s on line %d -bool(false) - -Warning: OCILob::saveFile(): Can't open file %s in %s on line %d -bool(false) -OCILob::truncate(): Argument #1 ($length) must be greater than or equal to 0 -Done diff --git a/ext/oci8/tests/lob_043.phpt b/ext/oci8/tests/lob_043.phpt deleted file mode 100644 index e138b5c1c025..000000000000 --- a/ext/oci8/tests/lob_043.phpt +++ /dev/null @@ -1,88 +0,0 @@ ---TEST-- -Bug #49560 (LOB resource destructor and refcount test) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -?> ---FILE-- -load(), "\n"; - } -*/ - -// Clean up - -$stmtarray = array( - "drop table lob_043_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -oci_close($c); - -?> ---EXPECT-- -Test 1 -f1 ended -Test 2 -f2 ended diff --git a/ext/oci8/tests/lob_044.phpt b/ext/oci8/tests/lob_044.phpt deleted file mode 100644 index 3c396cb28cc0..000000000000 --- a/ext/oci8/tests/lob_044.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -oci_lob_truncate() with default parameter value ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -write("this is a biiiig faaat test string. why are you reading it, I wonder? =)")); -var_dump($blob->seek(0)); -var_dump($blob->read(10000)); -var_dump($blob->truncate()); -var_dump($blob->seek(0)); -var_dump($blob->read(10000)); - -oci_commit($c); - - -// Read it back - -echo "\nTest 2 - read it back\n"; - -$s = oci_parse($c, "SELECT blob FROM lob_044_tab FOR UPDATE"); -oci_execute($s, OCI_DEFAULT); -$row = oci_fetch_array($s); -var_dump($row[0]->read(10000)); - -// Clean up - -$stmtarray = array( - "drop table lob_044_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECT-- -Test 1 - truncate on insert -int(72) -bool(true) -string(72) "this is a biiiig faaat test string. why are you reading it, I wonder? =)" -bool(true) -bool(true) -string(0) "" - -Test 2 - read it back -string(0) "" diff --git a/ext/oci8/tests/lob_aliases.phpt b/ext/oci8/tests/lob_aliases.phpt deleted file mode 100644 index 031a1a4a6e57..000000000000 --- a/ext/oci8/tests/lob_aliases.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -LOB method aliases ---EXTENSIONS-- -oci8 ---FILE-- - ---EXPECT-- -Test 1 -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -Done diff --git a/ext/oci8/tests/lob_null.phpt b/ext/oci8/tests/lob_null.phpt deleted file mode 100644 index 103f8a7bcb13..000000000000 --- a/ext/oci8/tests/lob_null.phpt +++ /dev/null @@ -1,273 +0,0 @@ ---TEST-- -Test null data for CLOBs ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -writeTemporary(null); -$r = @oci_execute($s); -if (!$r) { - $m = oci_error($s); - echo $m['message'], "\n"; -} -else { - $lob->close(); -} - -echo "Temporary CLOB: ''\n"; -$s = oci_parse($c, "insert into lob_null_tab values (2, :b)"); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':b', $lob, -1, OCI_B_CLOB); -$lob->writeTemporary(''); -$r = @oci_execute($s); -if (!$r) { - $m = oci_error($s); - echo $m['message'], "\n"; -} -else { - $lob->close(); -} - -echo "Temporary CLOB: text\n"; -$s = oci_parse($c, "insert into lob_null_tab values (3, :b)"); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':b', $lob, -1, OCI_B_CLOB); -$lob->writeTemporary('Inserted via SQL statement'); -$r = @oci_execute($s); -if (!$r) { - $m = oci_error($s); - echo $m['message'], "\n"; -} -else { - $lob->close(); -} - -// PROCEDURE PARAMETER - -echo "Procedure parameter: NULL\n"; -$s = oci_parse($c, "call lob_null_proc_in(4, :b)"); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':b', $lob, -1, OCI_B_CLOB); -$lob->writeTemporary(null); -$r = @oci_execute($s); -if (!$r) { - $m = oci_error($s); - echo $m['message'], "\n"; -} -else { - $lob->close(); -} - -echo "Procedure parameter: ''\n"; -$s = oci_parse($c, "call lob_null_proc_in(5, :b)"); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':b', $lob, -1, OCI_B_CLOB); -$lob->writeTemporary(''); -$r = @oci_execute($s); -if (!$r) { - $m = oci_error($s); - echo $m['message'], "\n"; -} -else { - $lob->close(); -} - -echo "Procedure parameter: text\n"; -$s = oci_parse($c, "call lob_null_proc_in(6, :b)"); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':b', $lob, -1, OCI_B_CLOB); -$lob->writeTemporary('Inserted via procedure parameter'); -$r = @oci_execute($s); -if (!$r) { - $m = oci_error($s); - echo $m['message'], "\n"; -} -else { - $lob->close(); -} - -// RETURNING INTO - -echo "RETURNING INTO: null\n"; -$s = oci_parse($c, "insert into lob_null_tab values (7, empty_clob()) returning data into :b"); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':b', $lob, -1, OCI_B_CLOB); -oci_execute($s, OCI_DEFAULT); // Must have OCI_DEFAULT here so locator is still valid -$lob->save(null); - -echo "RETURNING INTO: ''\n"; -$s = oci_parse($c, "insert into lob_null_tab values (8, empty_clob()) returning data into :b"); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':b', $lob, -1, OCI_B_CLOB); -oci_execute($s, OCI_DEFAULT); // Must have OCI_DEFAULT here so locator is still valid -$lob->save(''); - -echo "RETURNING INTO: text\n"; -$s = oci_parse($c, "insert into lob_null_tab values (9, empty_clob()) returning data into :b"); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':b', $lob, -1, OCI_B_CLOB); -oci_execute($s, OCI_DEFAULT); // Must have OCI_DEFAULT here so locator is still valid -$lob->save('Inserted with RETURNING INTO'); - -echo "Fetch as string\n"; -$s = oci_parse ($c, 'select id, data from lob_null_tab order by id'); -oci_execute($s); -oci_fetch_all($s, $res); -var_dump($res); - -echo "\nFetch as a descriptor\n"; -$s = oci_parse ($c, 'select id, data from lob_null_tab order by id'); -oci_execute($s); -while ($arr = oci_fetch_assoc($s)) { - if (is_object($arr['DATA'])) { - echo $arr['ID'] . " is an object: "; - $r = $arr['DATA']->load(); - var_dump($r); - } - else { - echo $arr['ID'] . " is not an object\n"; - } -} - -echo "\nFetch via the procedure parameter\n"; -for ($i = 1; $i <= 9; $i++) -{ - $s = oci_parse ($c, "call lob_null_proc_out($i, :b)"); - $lob = oci_new_descriptor($c, OCI_D_LOB); - oci_bind_by_name($s, ':b', $lob, -1, OCI_B_CLOB); - oci_execute($s); - if (is_object($lob)) { - echo $i . " is an object: "; - $r = $lob->load(); - var_dump($r); - } - else { - echo $i . " is not an object\n"; - } -} - -// Cleanup - -$s = oci_parse($c, 'drop table lob_null_tab'); -@oci_execute($s); - -echo "Done\n"; - -?> ---EXPECT-- -Temporary CLOB: NULL -Temporary CLOB: '' -Temporary CLOB: text -Procedure parameter: NULL -Procedure parameter: '' -Procedure parameter: text -RETURNING INTO: null -RETURNING INTO: '' -RETURNING INTO: text -Fetch as string -array(2) { - ["ID"]=> - array(9) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - [2]=> - string(1) "3" - [3]=> - string(1) "4" - [4]=> - string(1) "5" - [5]=> - string(1) "6" - [6]=> - string(1) "7" - [7]=> - string(1) "8" - [8]=> - string(1) "9" - } - ["DATA"]=> - array(9) { - [0]=> - string(0) "" - [1]=> - string(0) "" - [2]=> - string(26) "Inserted via SQL statement" - [3]=> - string(0) "" - [4]=> - string(0) "" - [5]=> - string(32) "Inserted via procedure parameter" - [6]=> - string(0) "" - [7]=> - string(0) "" - [8]=> - string(28) "Inserted with RETURNING INTO" - } -} - -Fetch as a descriptor -1 is an object: string(0) "" -2 is an object: string(0) "" -3 is an object: string(26) "Inserted via SQL statement" -4 is an object: string(0) "" -5 is an object: string(0) "" -6 is an object: string(32) "Inserted via procedure parameter" -7 is an object: string(0) "" -8 is an object: string(0) "" -9 is an object: string(28) "Inserted with RETURNING INTO" - -Fetch via the procedure parameter -1 is an object: string(0) "" -2 is an object: string(0) "" -3 is an object: string(26) "Inserted via SQL statement" -4 is an object: string(0) "" -5 is an object: string(0) "" -6 is an object: string(32) "Inserted via procedure parameter" -7 is an object: string(0) "" -8 is an object: string(0) "" -9 is an object: string(28) "Inserted with RETURNING INTO" -Done diff --git a/ext/oci8/tests/lob_prefetch.phpt b/ext/oci8/tests/lob_prefetch.phpt deleted file mode 100755 index 21fb1ea65712..000000000000 --- a/ext/oci8/tests/lob_prefetch.phpt +++ /dev/null @@ -1,167 +0,0 @@ ---TEST-- -LOB prefetching ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -= 0) - oci_set_prefetch_lob($stid, $pfl); - oci_execute($stid); - $l = []; - while (($row = oci_fetch_array($stid, OCI_ASSOC)) != false) { - $l[] = $row['CLOB']->load(); - $row['CLOB']->free(); - if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; } - } - return($l); -} - -function get_clob_inline($c, $sql, $pfl) { - $stid = oci_parse($c, $sql); - if ($pfl >= 0) - oci_set_prefetch_lob($stid, $pfl); - oci_execute($stid); - $l = []; - while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_LOBS)) != false) { - $l[] = $row['CLOB']; - if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; } - } - return($l); -} - -function check_clobs($locarr, $inlinearr) { - print("Comparing CLOBS\n"); - for ($i = 0; $i < NUMROWS; ++$i) { - if (strlen($locarr[$i]) != LOBSIZE) { - trigger_error("size mismatch at $i " . strlen($locarr[$i]), E_USER_ERROR); - exit; - } - if (strcmp($locarr[$i], $inlinearr[$i])) { - trigger_error("data mismatch at $i " . strlen($locarr[$i]) . " " . strlen($inlinearr[$i]), E_USER_ERROR); - exit; - } - } -} - -function get_blob_loc($c, $sql, $pfl) { - $stid = oci_parse($c, $sql); - if ($pfl >= 0) - oci_set_prefetch_lob($stid, $pfl); - oci_execute($stid); - $l = []; - while (($row = oci_fetch_array($stid, OCI_ASSOC)) != false) { - $l[] = $row['BLOB']->load(); - $row['BLOB']->free(); - if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; } - } - return($l); -} - - -print("Test 1 - Default prefetch_lob_size\n"); - -$r = ini_get("oci8.prefetch_lob_size"); -var_dump($r); - -print("Test 2\n"); - -$s = oci_parse($c, 'select * from dual'); -$r = oci_set_prefetch_lob($s, 0); -var_dump($r); - -try { - oci_set_prefetch_lob($s, -1); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -print("Test 3 - CLOB prefetch_lob_size 100000\n"); - -$sql = "select clob from {$schema}{$table_name}" . " order by id"; -$locarr = get_clob_loc($c, $sql, 100000); -$inlinearr = get_clob_inline($c, $sql, 100000); - -print(count($locarr) . "\n"); -print(count($inlinearr) . "\n"); -check_clobs($locarr, $inlinearr); - -print("Test 3 - CLOB prefetch_lob_size 100\n"); - -$locarr = get_clob_loc($c, $sql, 100); -$inlinearr = get_clob_inline($c, $sql, 100); - -print(count($locarr) . "\n"); -print(count($inlinearr) . "\n"); -check_clobs($locarr, $inlinearr); - -print("Test 4 - BLOB prefetch_lob_size 100000\n"); - -$sql = "select blob from {$schema}{$table_name}" . " order by id"; -$locarr = get_blob_loc($c, $sql, 100000); - -print(count($locarr) . "\n"); - -require __DIR__.'/drop_table.inc'; - -?> -DONE ---EXPECTF-- -Test 1 - Default prefetch_lob_size -string(1) "0" -Test 2 -bool(true) -oci_set_prefetch_lob(): Argument #2 ($prefetch_lob_size) must be greater than or equal to 0 -Test 3 - CLOB prefetch_lob_size 100000 -200 -200 -Comparing CLOBS -Test 3 - CLOB prefetch_lob_size 100 -200 -200 -Comparing CLOBS -Test 4 - BLOB prefetch_lob_size 100000 -200 -DONE diff --git a/ext/oci8/tests/lob_prefetch_ini.phpt b/ext/oci8/tests/lob_prefetch_ini.phpt deleted file mode 100755 index 0dbf63cbb99c..000000000000 --- a/ext/oci8/tests/lob_prefetch_ini.phpt +++ /dev/null @@ -1,166 +0,0 @@ ---TEST-- -LOB prefetching with oci8. ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---INI-- -oci8.prefetch_lob_size=100000 ---FILE-- -= 0) - oci_set_prefetch_lob($stid, $pfl); - oci_execute($stid); - $l = []; - while (($row = oci_fetch_array($stid, OCI_ASSOC)) != false) { - $l[] = $row['CLOB']->load(); - $row['CLOB']->free(); - if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; } - } - return($l); -} - -function get_clob_inline($c, $sql, $pfl) { - $stid = oci_parse($c, $sql); - if ($pfl >= 0) - oci_set_prefetch_lob($stid, $pfl); - oci_execute($stid); - $l = []; - while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_LOBS)) != false) { - $l[] = $row['CLOB']; - if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; } - } - return($l); -} - -function check_clobs($locarr, $inlinearr) { - print("Comparing CLOBS\n"); - for ($i = 0; $i < NUMROWS; ++$i) { - if (strlen($locarr[$i]) != LOBSIZE) { - trigger_error("size mismatch at $i " . strlen($locarr[$i]), E_USER_ERROR); - exit; - } - if (strcmp($locarr[$i], $inlinearr[$i])) { - trigger_error("data mismatch at $i " . strlen($locarr[$i]) . " " . strlen($inlinearr[$i]), E_USER_ERROR); - exit; - } - } -} - -function get_blob_loc($c, $sql, $pfl) { - $stid = oci_parse($c, $sql); - if ($pfl >= 0) - oci_set_prefetch_lob($stid, $pfl); - oci_execute($stid); - $l = []; - while (($row = oci_fetch_array($stid, OCI_ASSOC)) != false) { - $l[] = $row['BLOB']->load(); - $row['BLOB']->free(); - if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; } - } - return($l); -} - - -print("Test 1 - prefetch_lob_size\n"); - -$r = ini_get("oci8.prefetch_lob_size"); -var_dump($r); - -print("Test 2 - CLOB with current oci8.prefetch_lob_size\n"); - -$sql = "select clob from {$schema}{$table_name}" . " order by id"; -$locarr = get_clob_loc($c, $sql, -1); -$inlinearr = get_clob_inline($c, $sql, -1); - -print(count($locarr) . "\n"); -print(count($inlinearr) . "\n"); -check_clobs($locarr, $inlinearr); - -print("Test 3 - CLOB override prefetch_lob_size 0\n"); - -$locarr = get_clob_loc($c, $sql, 0); -$inlinearr = get_clob_inline($c, $sql, 0); - -print(count($locarr) . "\n"); -print(count($inlinearr) . "\n"); -check_clobs($locarr, $inlinearr); - -print("Test 4 - CLOB override prefetch_lob_size 1000\n"); - -$locarr = get_clob_loc($c, $sql, 1000); -$inlinearr = get_clob_inline($c, $sql, 1000); - -print(count($locarr) . "\n"); -print(count($inlinearr) . "\n"); -check_clobs($locarr, $inlinearr); - -print("Test 5 - BLOB with current ocig8.prefetch_lob_size\n"); - -$sql = "select blob from {$schema}{$table_name}" . " order by id"; -$locarr = get_blob_loc($c, $sql, -1); - -print(count($locarr) . "\n"); - -require __DIR__.'/drop_table.inc'; - -?> -DONE ---EXPECTF-- -Test 1 - prefetch_lob_size -string(6) "100000" -Test 2 - CLOB with current oci8.prefetch_lob_size -200 -200 -Comparing CLOBS -Test 3 - CLOB override prefetch_lob_size 0 -200 -200 -Comparing CLOBS -Test 4 - CLOB override prefetch_lob_size 1000 -200 -200 -Comparing CLOBS -Test 5 - BLOB with current ocig8.prefetch_lob_size -200 -DONE diff --git a/ext/oci8/tests/lob_temp.phpt b/ext/oci8/tests/lob_temp.phpt deleted file mode 100644 index be46cda6fbec..000000000000 --- a/ext/oci8/tests/lob_temp.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -temporary lobs ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -writeTemporary("test")); -var_dump($blob->load()); -var_dump($blob->seek(0, SEEK_SET)); -var_dump($blob->read(2)); - -$c = oci_pconnect($user, $password, $dbase); - -$blob = oci_new_descriptor($c,OCI_D_LOB); -var_dump($blob->writeTemporary("test")); -var_dump($blob->load()); -var_dump($blob->seek(0, SEEK_SET)); -var_dump($blob->read(2)); - -echo "Done\n"; - -?> ---EXPECT-- -bool(true) -string(4) "test" -bool(true) -string(2) "te" -bool(true) -string(4) "test" -bool(true) -string(2) "te" -Done diff --git a/ext/oci8/tests/lob_temp1.phpt b/ext/oci8/tests/lob_temp1.phpt deleted file mode 100644 index 8939aecb2e14..000000000000 --- a/ext/oci8/tests/lob_temp1.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -closing temporary lobs ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -writeTemporary("test")); -var_dump($blob->load()); -var_dump($blob->close()); - -$c = oci_pconnect($user, $password, $dbase); - -$blob = oci_new_descriptor($c,OCI_D_LOB); -var_dump($blob->writeTemporary("test")); -var_dump($blob->load()); -var_dump($blob->close()); - -echo "Done\n"; - -?> ---EXPECT-- -bool(true) -string(4) "test" -bool(true) -bool(true) -string(4) "test" -bool(true) -Done diff --git a/ext/oci8/tests/lob_temp2.phpt b/ext/oci8/tests/lob_temp2.phpt deleted file mode 100644 index ea9cf729c480..000000000000 --- a/ext/oci8/tests/lob_temp2.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Writing temporary lob before binding ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -writeTemporary("test")); - -$statement = oci_parse($c, $ora_sql); -oci_bind_by_name($statement, ":v_clob", $clob, -1, OCI_B_CLOB); -oci_execute($statement, OCI_DEFAULT); - -$s = oci_parse($c, "select clob from ". $schema.$table_name); -oci_execute($s); -oci_fetch_all($s, $res); -var_dump($res); - -?> ---EXPECT-- -bool(true) -array(1) { - ["CLOB"]=> - array(1) { - [0]=> - string(4) "test" - } -} diff --git a/ext/oci8/tests/minfo.phpt b/ext/oci8/tests/minfo.phpt deleted file mode 100644 index b0930192cae2..000000000000 --- a/ext/oci8/tests/minfo.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Code coverage for PHP_MINFO_FUNCTION(oci) ---EXTENSIONS-- -oci8 ---FILE-- - ---EXPECT-- -Done diff --git a/ext/oci8/tests/null_byte_1.phpt b/ext/oci8/tests/null_byte_1.phpt deleted file mode 100644 index 5bd5d2938c1b..000000000000 --- a/ext/oci8/tests/null_byte_1.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Protect against null bytes in LOB filenames ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -display_errors = On ---FILE-- -saveFile("/tmp/abc\0def"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -echo "Test 2: Export\n"; - -try { - $lob->export("/tmp/abc\0def"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -?> ---EXPECT-- -Test 1: Import -OCILob::saveFile(): Argument #1 ($filename) must not contain any null bytes -Test 2: Export -OCILob::export(): Argument #1 ($filename) must not contain any null bytes diff --git a/ext/oci8/tests/null_byte_2.phpt b/ext/oci8/tests/null_byte_2.phpt deleted file mode 100644 index 6f7b6b2c53fd..000000000000 --- a/ext/oci8/tests/null_byte_2.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Null bytes in SQL statements ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---INI-- -display_errors = On -error_reporting = E_WARNING ---FILE-- - ---EXPECTF-- -Test 1: Valid use of a null byte -array(1) { - ["DUMMY"]=> - array(1) { - [0]=> - string(1) "X" - } -} -Test 3: Using a null byte in a bind variable name - -Warning: oci_bind_by_name(): ORA-01036: %s in %snull_byte_2.php on line %d - -Warning: oci_execute(): ORA-01008: %s in %snull_byte_2.php on line %d diff --git a/ext/oci8/tests/null_byte_3.phpt b/ext/oci8/tests/null_byte_3.phpt deleted file mode 100644 index a1eb4a94ddf3..000000000000 --- a/ext/oci8/tests/null_byte_3.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Null bytes in SQL statements ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -display_errors = On -error_reporting = E_WARNING ---FILE-- - ---EXPECTF-- -Test 1: Invalid use of a null byte - -Warning: oci_execute(): ORA-00942: %s in %snull_byte_3.php on line %d -Test 2: Using a null byte in a bind variable value causing WHERE clause to fail -array(1) { - ["DUMMY"]=> - array(0) { - } -} diff --git a/ext/oci8/tests/num.phpt b/ext/oci8/tests/num.phpt deleted file mode 100644 index a84a756fcb39..000000000000 --- a/ext/oci8/tests/num.phpt +++ /dev/null @@ -1,172 +0,0 @@ ---TEST-- -oci_num_*() family ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Test 1 -int(0) -int(0) -Test 2 -int(1) -int(0) -Test 3 -int(1) -int(0) -Test 4a -int(0) -int(0) -Test 4b -int(0) -int(2) -Test 4c -int(3) -int(2) -Test 5 -int(1) -int(2) -Test 6 -int(0) -int(1) -Test 7a -int(3) -int(0) -Done diff --git a/ext/oci8/tests/oci_execute_segfault.phpt b/ext/oci8/tests/oci_execute_segfault.phpt deleted file mode 100644 index bd92f4d6cec2..000000000000 --- a/ext/oci8/tests/oci_execute_segfault.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -oci_execute() segfault after repeated bind of LOB descriptor ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- -save("some binary data")); - -oci_bind_by_name($s, ":v_blob", $blob, -1, OCI_B_BLOB); -oci_execute($s, OCI_DEFAULT); -var_dump($blob->save("some more binary data")); - -$query = 'SELECT blob, DBMS_LOB.GETLENGTH(blob) FROM '.$schema.$table_name.' ORDER BY 2'; - -$s = oci_parse ($c, $query); -oci_execute($s, OCI_DEFAULT); - -while ($arr = oci_fetch_assoc($s)) { - $result = $arr['BLOB']->load(); - var_dump($result); -} - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; - -?> ---EXPECT-- -bool(true) -bool(true) -string(16) "some binary data" -string(21) "some more binary data" -Done diff --git a/ext/oci8/tests/old_oci_close.phpt b/ext/oci8/tests/old_oci_close.phpt deleted file mode 100644 index 23916407e4d4..000000000000 --- a/ext/oci8/tests/old_oci_close.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -oci8.old_oci_close_semantics On ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=1 ---FILE-- - ---EXPECTF-- -Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s -resource(%d) of type (oci8 connection) -NULL -resource(%d) of type (oci8 statement) -Done diff --git a/ext/oci8/tests/old_oci_close1.phpt b/ext/oci8/tests/old_oci_close1.phpt deleted file mode 100644 index dab2380ea7dd..000000000000 --- a/ext/oci8/tests/old_oci_close1.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -oci8.old_oci_close_semantics Off ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.old_oci_close_semantics=0 ---FILE-- -getMessage()); -} - -echo "Done\n"; - -?> ---EXPECTF-- -resource(%d) of type (oci8 connection) -bool(true) -string(%d) "oci_parse(): supplied resource is not a valid oci8 connection resource" -Done diff --git a/ext/oci8/tests/password.phpt b/ext/oci8/tests/password.phpt deleted file mode 100644 index 322a4d7e47ab..000000000000 --- a/ext/oci8/tests/password.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -oci_password_change() for non-persistent connections ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECTF-- -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -First and second connections are different: OK -First and third connections share a resource: OK -Done diff --git a/ext/oci8/tests/password_2.phpt b/ext/oci8/tests/password_2.phpt deleted file mode 100644 index e975d52a8f46..000000000000 --- a/ext/oci8/tests/password_2.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -oci_password_change() for persistent connections ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECTF-- -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 persistent connection) -First and second connections are different: OK -First and third connections share a resource: OK -Done diff --git a/ext/oci8/tests/password_new.phpt b/ext/oci8/tests/password_new.phpt deleted file mode 100644 index 14618471c210..000000000000 --- a/ext/oci8/tests/password_new.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -oci_password_change() ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -require __DIR__.'/connect.inc'; -if (empty($dbase)) die ("skip requires database connection string be set"); -if ($test_drcp) die("skip password change not supported in DRCP Mode"); - -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches_sv); -preg_match('/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); -if (!(isset($matches_sv[0]) && isset($matches[0]) - && $matches_sv[1] == $matches[1] - && $matches_sv[2] == $matches[2] - && $matches_sv[3] == $matches[3] - && $matches_sv[4] == $matches[4])) { - // Avoid diffs due to cross version protocol changes (e.g. like 11.2.0.2-11.2.0.3) and bugs like Oracle bug: 6277160 - die ("skip test only runs when database client libraries and database server are the same version"); -} - -// This test in Oracle 12c needs a non-CDB or the root container -if (isset($matches_sv[0]) && $matches_sv[1] >= 12) { - $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual"); - $r = @oci_execute($s); - if (!$r) - die('skip could not identify container type'); - $r = oci_fetch_array($s); - if ($r['DBTYPE'] !== 'CDB$ROOT') - die('skip cannot run test using a PDB'); -} -?> ---FILE-- - ---EXPECTF-- -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -Done diff --git a/ext/oci8/tests/pecl_bug10194.phpt b/ext/oci8/tests/pecl_bug10194.phpt deleted file mode 100644 index 5abe77da8d9f..000000000000 --- a/ext/oci8/tests/pecl_bug10194.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside the callback) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -if (getenv("USE_ZEND_ALLOC") === "0") { - die("skip Zend MM disabled"); -} -?> ---INI-- -memory_limit=10M ---FILE-- -write($string); -} - -oci_commit($c); - -$ora_sql = "SELECT clob FROM ".$schema.$table_name.""; -$statement = oci_parse($c,$ora_sql); -oci_execute($statement); - -$row = oci_fetch_assoc($statement); -var_dump(strlen($row['CLOB']->load())); /* here it should fail */ - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECTF-- -Fatal error: Allowed memory size of 10485760 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d diff --git a/ext/oci8/tests/pecl_bug10194_blob.phpt b/ext/oci8/tests/pecl_bug10194_blob.phpt deleted file mode 100644 index a6a08764f6aa..000000000000 --- a/ext/oci8/tests/pecl_bug10194_blob.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside the callback) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only"); -if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -if (getenv("USE_ZEND_ALLOC") === "0") { - die("skip Zend MM disabled"); -} -?> ---INI-- -memory_limit=3M ---FILE-- -write($string); -} - -oci_commit($c); - -$ora_sql = "SELECT blob FROM ".$schema.$table_name; -$statement = oci_parse($c,$ora_sql); -oci_execute($statement); - -echo "Before load()\n"; - -$row = oci_fetch_assoc($statement); -var_dump(strlen($row['BLOB']->load())); /* here it should fail */ - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECTF-- -Before load() - -Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d diff --git a/ext/oci8/tests/pecl_bug10194_blob_64.phpt b/ext/oci8/tests/pecl_bug10194_blob_64.phpt deleted file mode 100644 index 8893570e20dc..000000000000 --- a/ext/oci8/tests/pecl_bug10194_blob_64.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside the callback) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on thes -require __DIR__.'/skipif.inc'; -if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); -if (getenv("USE_ZEND_ALLOC") === "0") { - die("skip Zend MM disabled"); -} -?> ---INI-- -memory_limit=6M ---FILE-- -write($string); -} - -oci_commit($c); - -$ora_sql = "SELECT blob FROM ".$schema.$table_name; -$statement = oci_parse($c,$ora_sql); -oci_execute($statement); - -echo "Before load()\n"; - -$row = oci_fetch_assoc($statement); -var_dump(strlen($row['BLOB']->load())); /* here it should fail */ - -require __DIR__.'/drop_table.inc'; - -echo "Done\n"; -?> ---EXPECTF-- -Before load() - -Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d diff --git a/ext/oci8/tests/pecl_bug16035.phpt b/ext/oci8/tests/pecl_bug16035.phpt deleted file mode 100644 index de21861cd1aa..000000000000 --- a/ext/oci8/tests/pecl_bug16035.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -PECL Bug #16035 (Crash with Oracle 10.2 connecting with a character set but ORACLE_HOME is not set) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---ENV-- -ORACLE_HOME="" ---FILE-- - ---EXPECTF-- -Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and %s are set and point to the right directories in %s on line %d - -Warning: oci_connect(): Error while trying to retrieve text for error ORA-01804 - in %specl_bug16035.php on line %d diff --git a/ext/oci8/tests/pecl_bug16842.phpt b/ext/oci8/tests/pecl_bug16842.phpt deleted file mode 100644 index 1af369547ebc..000000000000 --- a/ext/oci8/tests/pecl_bug16842.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -PECL Bug #16842 (NO_DATA_FOUND exception is a warning) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---INI-- -error_reporting = E_WARNING ---FILE-- - ---EXPECTF-- -Test 1 -Raises NO_DATA_FOUND - -Warning: oci_execute(): ORA-01403: %s -ORA-06512: at line %d in %specl_bug16842.php on line %d -bool(false) -array(4) { - ["code"]=> - int(1403) - ["message"]=> - string(%d) "ORA-01403: %s -ORA-06512: at line 1" - ["offset"]=> - int(0) - ["sqltext"]=> - string(31) "begin raise NO_DATA_FOUND; end;" -} -Test 2 -Raises ZERO_DIVIDE - -Warning: oci_execute(): ORA-01476: %s -ORA-06512: at line 1 in %s on line 19 -bool(false) -array(4) { - ["code"]=> - int(1476) - ["message"]=> - string(%d) "ORA-01476: %s -ORA-06512: at line 1" - ["offset"]=> - int(0) - ["sqltext"]=> - string(29) "begin raise ZERO_DIVIDE; end;" -} diff --git a/ext/oci8/tests/pecl_bug6109.phpt b/ext/oci8/tests/pecl_bug6109.phpt deleted file mode 100644 index 7ecc5e4c3070..000000000000 --- a/ext/oci8/tests/pecl_bug6109.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -PECL Bug #6109 (Error messages not kept) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - '.$err['message'] ."\n"; - } -} - -// Cleanup - -oci_close($c); - -echo "Done\n"; - -?> ---EXPECTF-- -Test 1 -0 -> ORA-00942: %s -1 -> ORA-00942: %s -2 -> ORA-00942: %s -3 -> ORA-00942: %s -4 -> ORA-00942: %s -Done diff --git a/ext/oci8/tests/pecl_bug8816.phpt b/ext/oci8/tests/pecl_bug8816.phpt deleted file mode 100644 index 6260f4229a4d..000000000000 --- a/ext/oci8/tests/pecl_bug8816.phpt +++ /dev/null @@ -1,104 +0,0 @@ ---TEST-- -PECL Bug #8816 (issue in php_oci_statement_fetch with more than one piecewise column) ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECT-- -array(2) { - ["L1"]=> - string(19) "1234567890111111111" - ["L2"]=> - string(9) "987654321" -} -array(2) { - ["L1"]=> - string(15) "122222222222222" - ["L2"]=> - string(9) "123456789" -} -array(2) { - ["L1"]=> - string(30) "985456745674567654567654567654" - ["L2"]=> - string(30) "985456745674567654567654567654" -} -array(2) { - ["L1"]=> - string(9) "123456789" - ["L2"]=> - string(15) "122222222222222" -} -array(2) { - ["L1"]=> - string(9) "987654321" - ["L2"]=> - string(19) "1234567890111111111" -} -Done diff --git a/ext/oci8/tests/persistent.phpt b/ext/oci8/tests/persistent.phpt deleted file mode 100644 index a9ba8f760539..000000000000 --- a/ext/oci8/tests/persistent.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -reusing persistent connections ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 persistent connection) -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -resource(%d) of type (oci8 connection) -Done diff --git a/ext/oci8/tests/prefetch.phpt b/ext/oci8/tests/prefetch.phpt deleted file mode 100644 index 7b0ea8c42a9c..000000000000 --- a/ext/oci8/tests/prefetch.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -oci_set_prefetch() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -int(1) -Done diff --git a/ext/oci8/tests/privileged_connect.phpt b/ext/oci8/tests/privileged_connect.phpt deleted file mode 100644 index 3e21aa089295..000000000000 --- a/ext/oci8/tests/privileged_connect.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -privileged connect tests ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA in %s on line %d - -Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA in %s on line %d - -Warning: oci_connect(): Invalid session mode specified (-1) in %s on line %d -Done diff --git a/ext/oci8/tests/privileged_connect1.phpt b/ext/oci8/tests/privileged_connect1.phpt deleted file mode 100644 index e02fedd4d937..000000000000 --- a/ext/oci8/tests/privileged_connect1.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -privileged connect tests ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.privileged_connect=1 ---FILE-- - ---EXPECTF-- -Warning: oci_connect(): ORA-%d: %s in %s on line %d - -Warning: oci_connect(): ORA-%d: %s in %s on line %d - -Warning: oci_connect(): Invalid session mode specified (-1) in %s on line %d -Done diff --git a/ext/oci8/tests/refcur_prefetch_1.phpt b/ext/oci8/tests/refcur_prefetch_1.phpt deleted file mode 100644 index 787849a5ee66..000000000000 --- a/ext/oci8/tests/refcur_prefetch_1.phpt +++ /dev/null @@ -1,233 +0,0 @@ ---TEST-- -Prefetch with REF cursor. Test different values for prefetch with oci_set_prefetch(). ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 10))) { - die("skip expected output only valid when using Oracle 10g or greater database server"); -} -preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] >= 2) || - ($matches[1] >= 12) - ))) { - die("skip test expected to work only with Oracle 11gR2 or greater version of client"); -} -?> ---FILE-- -getMessage(), "\n"; - } -} - - -// This function sets the prefetch count to the given $value and fetches one row . - -function fetch_frm_php($c,$cur1,$value) { - $sql1 = "begin refcurpkg.open_ref_cur(:cur1); end;"; - $s1 = oci_parse($c,$sql1); - if (!oci_bind_by_name($s1,":cur1",$cur1,-1,SQLT_RSET)) { - die("oci_bind_by_name(sql1) failed!\n"); - } - oci_execute($s1); - oci_set_prefetch($cur1,$value); - oci_execute($cur1); - echo "Fetch Row from PHP\n"; - var_dump(oci_fetch_row($cur1)); -} - -// This function calls the fetch_ref_cur procedure to get the values from the REF cur. - -function fetch_frm_plsql($c,$cur1) { - $sql2 = "begin refcurpkg.fetch_ref_cur(:curs1,:c1,:c2); end;"; - $s2 = oci_parse($c,$sql2); - if (!oci_bind_by_name($s2,":curs1",$cur1,-1,SQLT_RSET)) { - die("oci_bind_by_name(sql2) failed!\n"); - } - if (!oci_bind_by_name($s2,":c1",$c1,-1,SQLT_INT)) { - die("oci_bind_by_name(sql2) failed!\n"); - } - if (!oci_bind_by_name($s2,":c2",$c2,20,SQLT_CHR)) { - die("oci_bind_by_name(sql2) failed!\n"); - } - oci_execute($s2); - echo "Fetch Row from PL/SQL\n"; - var_dump($c1); - var_dump($c2); -} - -// Clean up here - -$stmtarray = array( - "drop package refcurpkg", - "drop table refcurtest" -); - -oci8_test_sql_execute($c, $stmtarray); - -echo "Done\n"; -?> ---EXPECTF-- ------------------------------------------------ -Test with Prefetch value set to 0 ------------------------------------------------ -Fetch Row from PHP -array(2) { - [0]=> - string(%d) "0" - [1]=> - string(%d) "test0" -} -Fetch Row from PL/SQL -int(1) -string(%d) "test1" ------------------------------------------------ -Test with Prefetch value set to 1 ------------------------------------------------ -Fetch Row from PHP -array(2) { - [0]=> - string(%d) "0" - [1]=> - string(%d) "test0" -} -Fetch Row from PL/SQL -int(2) -string(%d) "test2" ------------------------------------------------ -Test with Prefetch value set to 501 ------------------------------------------------ -Fetch Row from PHP -array(2) { - [0]=> - string(%d) "0" - [1]=> - string(%d) "test0" -} - -Warning: oci_execute(): ORA-01002: %s -ORA-06512: at "%s.REFCURPKG", line %d -ORA-06512: at line %d in %s on line %d -Fetch Row from PL/SQL -int(0) -NULL ------------------------------------------------ -Test with Prefetch value set to 499 ------------------------------------------------ -Fetch Row from PHP -array(2) { - [0]=> - string(%d) "0" - [1]=> - string(%d) "test0" -} -Fetch Row from PL/SQL -int(500) -string(%d) "test500" ------------------------------------------------ -Test with Prefetch value set to 250 ------------------------------------------------ -Fetch Row from PHP -array(2) { - [0]=> - string(%d) "0" - [1]=> - string(%d) "test0" -} -Fetch Row from PL/SQL -int(251) -string(%d) "test251" ------------------------------------------------ -Test with Prefetch value set to 12345 ------------------------------------------------ -Fetch Row from PHP -array(2) { - [0]=> - string(%d) "0" - [1]=> - string(%d) "test0" -} - -Warning: oci_execute(): ORA-01002: %s -ORA-06512: at "%s.REFCURPKG", line %d -ORA-06512: at line %d in %s on line %d -Fetch Row from PL/SQL -int(0) -NULL ------------------------------------------------ -Test with Prefetch (invalid) value set to -12345 ------------------------------------------------ -oci_set_prefetch(): Argument #2 ($rows) must be greater than or equal to 0 ------------------------------------------------ -Test with Prefetch (invalid) value set to -1 ------------------------------------------------ -oci_set_prefetch(): Argument #2 ($rows) must be greater than or equal to 0 -Done diff --git a/ext/oci8/tests/refcur_prefetch_2.phpt b/ext/oci8/tests/refcur_prefetch_2.phpt deleted file mode 100644 index cb729fd7cc9d..000000000000 --- a/ext/oci8/tests/refcur_prefetch_2.phpt +++ /dev/null @@ -1,229 +0,0 @@ ---TEST-- -Prefetch with REF cursor. Test No 2 ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 10))) { - die("skip expected output only valid when using Oracle 10g or greater database server"); -} -preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] >= 2) || - ($matches[1] >= 12) - ))) { - die("skip test expected to work only with Oracle 11gR2 or greater version of client"); -} -?> ---FILE-- - ---EXPECTF-- -------Test 1- Check Roundtrips with prefetch 0 and 5 ----------- -array(2) { - [0]=> - string(1) "0" - [1]=> - string(5) "test0" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "test1" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "test2" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "test3" -} -array(2) { - [0]=> - string(1) "4" - [1]=> - string(5) "test4" -} -Number of roundtrips made with prefetch count 0 for 5 rows is 6 -array(2) { - [0]=> - string(1) "5" - [1]=> - string(5) "test5" -} -array(2) { - [0]=> - string(1) "6" - [1]=> - string(5) "test6" -} -array(2) { - [0]=> - string(1) "7" - [1]=> - string(5) "test7" -} -array(2) { - [0]=> - string(1) "8" - [1]=> - string(5) "test8" -} -array(2) { - [0]=> - string(1) "9" - [1]=> - string(5) "test9" -} -Number of roundtrips made with prefetch count 5 for 5 rows is 2 -------Test 2 - Set Prefetch before PL/SQL fetch ---------- -Fetch Row from PHP -array(2) { - [0]=> - string(1) "0" - [1]=> - string(5) "test0" -} -Fetch Row from PL/SQL -int(101) -string(%d) "test101" -Done diff --git a/ext/oci8/tests/refcur_prefetch_3.phpt b/ext/oci8/tests/refcur_prefetch_3.phpt deleted file mode 100644 index 007cf843b13f..000000000000 --- a/ext/oci8/tests/refcur_prefetch_3.phpt +++ /dev/null @@ -1,147 +0,0 @@ ---TEST-- -Prefetch with Nested cursors with INI setting. ---INI-- -oci8.default_prefetch=5 ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 2) || - ($matches[1] >= 12) - ))) { - die("skip expected output only valid when using Oracle 11gR2 or greater database server"); -} -preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] >= 2) || - ($matches[1] >= 12) - ))) { - die("skip test expected to work only with Oracle 11gR2 or greater version of client"); -} -?> ---FILE-- - ---EXPECTF-- ------------------------------------------------ -Test with Nested Cursors ------------------------------------------------ -Fetch Row using Nested cursor Query -array(1) { - [0]=> - string(%d) "test0" -} -Fetch Row using Nested cursor Query -array(1) { - [0]=> - string(%d) "test1" -} -Fetch Row using Nested cursor Query -array(1) { - [0]=> - string(%d) "test2" -} -Fetch Row using Nested cursor Query -array(1) { - [0]=> - string(%d) "test3" -} -Fetch Row using Nested cursor Query -array(1) { - [0]=> - string(%d) "test4" -} -Fetch Row using Nested cursor Query -array(1) { - [0]=> - string(%d) "test5" -} -Fetch Row using Nested cursor Query -array(1) { - [0]=> - string(%d) "test6" -} -Fetch Row using Nested cursor Query -array(1) { - [0]=> - string(%d) "test7" -} -Fetch Row using Nested cursor Query -array(1) { - [0]=> - string(%d) "test8" -} -Fetch Row using Nested cursor Query -array(1) { - [0]=> - string(%d) "test9" -} -Number of roundtrips made with prefetch count 5 for 10 rows is 3 -Done diff --git a/ext/oci8/tests/refcur_prefetch_4.phpt b/ext/oci8/tests/refcur_prefetch_4.phpt deleted file mode 100644 index 9c481360d0bd..000000000000 --- a/ext/oci8/tests/refcur_prefetch_4.phpt +++ /dev/null @@ -1,185 +0,0 @@ ---TEST-- -Prefetch with REF cursor. Test No 4 ---EXTENSIONS-- -oci8 ---SKIPIF-- -= 10))) { - die("skip expected output only valid when using Oracle 10g or greater database server"); -} -preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] >= 2) || - ($matches[1] >= 12) - ))) { - die("skip test expected to work only with Oracle 11gR2 or greater version of client"); -} -?> ---FILE-- - ---EXPECTF-- -------Test 1 - Set Prefetch after PL/SQL fetch ---------- - -Warning: oci_execute(): ORA-01001: %s -ORA-06512: at "%s.REFCURPKG", line %d -ORA-06512: at line %d in %s on line %d -Fetch Row from PL/SQL -int(0) -NULL -Fetch Row from PHP -array(2) { - [0]=> - string(1) "0" - [1]=> - string(5) "test0" -} -------Test 2- Overwrite prefetch----------- -Fetch Row from PHP -array(2) { - [0]=> - string(1) "0" - [1]=> - string(5) "test0" -} -Fetch Row from PL/SQL -int(101) -string(%d) "test101" -Done diff --git a/ext/oci8/tests/select_null.phpt b/ext/oci8/tests/select_null.phpt deleted file mode 100644 index d12acf829064..000000000000 --- a/ext/oci8/tests/select_null.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -SELECTing NULL values ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(2) { - [0]=> - NULL - ["%r(NULL|EXP)%r"]=> - NULL -} -Done diff --git a/ext/oci8/tests/serverversion.phpt b/ext/oci8/tests/serverversion.phpt deleted file mode 100644 index 236744a96041..000000000000 --- a/ext/oci8/tests/serverversion.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -oci_server_version() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (oci8 connection) -string(%d) "Oracle %s" -Done diff --git a/ext/oci8/tests/skipif.inc b/ext/oci8/tests/skipif.inc deleted file mode 100644 index 314c5315994e..000000000000 --- a/ext/oci8/tests/skipif.inc +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/ext/oci8/tests/skipifconnectfailure.inc b/ext/oci8/tests/skipifconnectfailure.inc deleted file mode 100644 index e6bca6d50647..000000000000 --- a/ext/oci8/tests/skipifconnectfailure.inc +++ /dev/null @@ -1,29 +0,0 @@ -"; - } - else { - $msg .= "\"$dbase\""; - } - $msg .= " as user \"$user\""; - $e = oci_error(); - $msg .= ": {$e['message']}"; - die($msg); -} - -?> diff --git a/ext/oci8/tests/statement_cache.phpt b/ext/oci8/tests/statement_cache.phpt deleted file mode 100644 index 82bdd9bf079c..000000000000 --- a/ext/oci8/tests/statement_cache.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -statement cache ---EXTENSIONS-- -oci8 ---SKIPIF-- - true, 'timesten' => true); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - ---EXPECTF-- -array(2) { - [0]=> - string(1) "4" - ["%r(1\+3|EXP)%r"]=> - string(1) "4" -} -array(2) { - [0]=> - string(1) "4" - ["%r(1\+3|EXP)%r"]=> - string(1) "4" -} -Done diff --git a/ext/oci8/tests/statement_type.phpt b/ext/oci8/tests/statement_type.phpt deleted file mode 100644 index 67d1548fa90c..000000000000 --- a/ext/oci8/tests/statement_type.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -oci_statement_type() ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(6) "SELECT" -string(6) "DELETE" -string(6) "INSERT" -string(6) "UPDATE" -string(4) "DROP" -string(6) "CREATE" -string(6) "CREATE" -string(5) "ALTER" -string(5) "BEGIN" -string(7) "DECLARE" -string(4) "CALL" -string(7) "UNKNOWN" -string(7) "UNKNOWN" -Done diff --git a/ext/oci8/tests/test.gif b/ext/oci8/tests/test.gif deleted file mode 100644 index f352c7308fee..000000000000 Binary files a/ext/oci8/tests/test.gif and /dev/null differ diff --git a/ext/oci8/tests/test.txt b/ext/oci8/tests/test.txt deleted file mode 100644 index 4b8972703598..000000000000 --- a/ext/oci8/tests/test.txt +++ /dev/null @@ -1,9 +0,0 @@ -Ipsum lorem, IPSUM Lorem Ipsum lorem Ipsum lorem -Ipsum lorem IPSum Lorem Ipsum lorem ipsum Lorem -Ipsum Lorem ipsum Lorem - ipsum Lorem ipsum lorem -Ipsum lorem IPSUM Lorem Ipsum lorem, Ipsum lorem. - -Ipsum LOREM, ipsum Lorem Ipsum lorem Ipsum lorem -Ipsum lorem Ipsum Lorem Ipsum lorem ipsum Lorem -Ipsum Lorem ipsum Lorem ipsum Lorem; ipsum lorem -Ipsum lorem ipsum LOREM Ipsum lorem Ipsum lorem! diff --git a/ext/oci8/tests/testping.phpt b/ext/oci8/tests/testping.phpt deleted file mode 100644 index 7beac2296186..000000000000 --- a/ext/oci8/tests/testping.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Exercise OCIPing functionality on reconnect (code coverage test) ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---INI-- -oci8.ping_interval=0 ---FILE-- - ---EXPECT-- -Done diff --git a/ext/oci8/tests/uncommitted.phpt b/ext/oci8/tests/uncommitted.phpt deleted file mode 100644 index 7567c57cfac3..000000000000 --- a/ext/oci8/tests/uncommitted.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -uncommitted connection ---EXTENSIONS-- -oci8 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Done diff --git a/ext/oci8/tests/xmltype_01.phpt b/ext/oci8/tests/xmltype_01.phpt deleted file mode 100644 index 201913d9b6a6..000000000000 --- a/ext/oci8/tests/xmltype_01.phpt +++ /dev/null @@ -1,115 +0,0 @@ ---TEST-- -Basic XMLType test ---EXTENSIONS-- -simplexml -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - - - 1 - Big - 12345 - 20 - Curved - Red - N - Tiny - Steel - '))" -); - -oci8_test_sql_execute($c, str_replace("\r", "", $stmtarray)); - -function do_query($c) -{ - $s = oci_parse($c, 'select XMLType.getClobVal(xt_spec) - from xtt where xt_id = 1'); - oci_execute($s); - $row = oci_fetch_row($s); - $data = $row[0]->load(); - var_dump($data); - return($data); -} - -// Check -echo "Initial Data\n"; -$data = do_query($c); - -// Manipulate the data using SimpleXML -$sx = simplexml_load_string($data); -$sx->Hardness = $sx->Hardness - 1; -$sx->Nice = 'Y'; - -// Insert changes using a temporary CLOB -$s = oci_parse($c, 'update xtt - set xt_spec = XMLType(:clob) - where xt_id = 1'); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':clob', $lob, -1, OCI_B_CLOB); -$lob->writeTemporary($sx->asXml()); -oci_execute($s); -$lob->close(); - -// Verify -echo "Verify\n"; -$data = do_query($c); - -// Cleanup - -$stmtarray = array( - "drop table xtt", -); - -oci8_test_sql_execute($c, $stmtarray); - -echo "Done\n"; - -?> ---EXPECT-- -Initial Data -string(316) " - - 1 - Big - 12345 - 20 - Curved - Red - N - Tiny - Steel - " -Verify -string(309) " - - 1 - Big - 12345 - 19 - Curved - Red - Y - Tiny - Steel - -" -Done diff --git a/ext/oci8/tests/xmltype_02.phpt b/ext/oci8/tests/xmltype_02.phpt deleted file mode 100644 index b0615d45f962..000000000000 --- a/ext/oci8/tests/xmltype_02.phpt +++ /dev/null @@ -1,181 +0,0 @@ ---TEST-- -Basic XMLType test #2 ---EXTENSIONS-- -simplexml -oci8 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require __DIR__.'/skipif.inc'; -?> ---FILE-- - - -1 -Southlake, Texas -Owned -25000 -2 -Rear load -true -N -Street -10 - -EOF; - -echo "Test 1 Insert new XML data using a temporary CLOB\n"; -$s = oci_parse($c, - "insert into xmltype_02_tab (warehouse_id, warehouse_spec) - values (:id, XMLType(:clob))"); -oci_bind_by_name($s, ':id', $id); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':clob', $lob, -1, OCI_B_CLOB); -$lob->writeTemporary($xml); -oci_execute($s); -$lob->close(); - -// Query the row back -$s = oci_parse($c, 'select xmltype.getclobval(warehouse_spec) - from xmltype_02_tab where warehouse_id = :id'); -$r = oci_bind_by_name($s, ':id', $id); -oci_execute($s); -$row = oci_fetch_array($s, OCI_NUM); - -var_dump($row); - -echo "Test 2 Manipulate the data using SimpleXML\n"; - -$sx = simplexml_load_string($row[0]->load()); -$row[0]->free(); -var_dump($sx); - -$sx->Docks -= 1; // change the data - -var_dump($sx); - -echo "Test 3: Update changes using a temporary CLOB\n"; - -$s = oci_parse($c, 'update xmltype_02_tab - set warehouse_spec = XMLType(:clob) - where warehouse_id = :id'); -oci_bind_by_name($s, ':id', $id); -$lob = oci_new_descriptor($c, OCI_D_LOB); -oci_bind_by_name($s, ':clob', $lob, -1, OCI_B_CLOB); -$lob->writeTemporary($sx->asXml()); -oci_execute($s); -$lob->close(); - -// Query the changed row back and print it -$s = oci_parse($c, 'select xmltype.getclobval(warehouse_spec) - from xmltype_02_tab where warehouse_id = :id'); -$r = oci_bind_by_name($s, ':id', $id); -oci_execute($s); -$row = oci_fetch_array($s, OCI_NUM); -var_dump($row[0]->load()); -$row[0]->free(); - -// Clean up - -$stmtarray = array( - "drop table xmltype_02_tab" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> ---EXPECTF-- -Test 1 Insert new XML data using a temporary CLOB -array(1) { - [0]=> - object(OCILob)#%d (1) { - ["descriptor"]=> - resource(%d) of type (oci8 descriptor) - } -} -Test 2 Manipulate the data using SimpleXML -object(SimpleXMLElement)#%d (10) { - ["WarehouseId"]=> - string(1) "1" - ["WarehouseName"]=> - string(16) "Southlake, Texas" - ["Building"]=> - string(5) "Owned" - ["Area"]=> - string(5) "25000" - ["Docks"]=> - string(1) "2" - ["DockType"]=> - string(9) "Rear load" - ["WaterAccess"]=> - string(4) "true" - ["RailAccess"]=> - string(1) "N" - ["Parking"]=> - string(6) "Street" - ["VClearance"]=> - string(2) "10" -} -object(SimpleXMLElement)#%d (10) { - ["WarehouseId"]=> - string(1) "1" - ["WarehouseName"]=> - string(16) "Southlake, Texas" - ["Building"]=> - string(5) "Owned" - ["Area"]=> - string(5) "25000" - ["Docks"]=> - string(1) "1" - ["DockType"]=> - string(9) "Rear load" - ["WaterAccess"]=> - string(4) "true" - ["RailAccess"]=> - string(1) "N" - ["Parking"]=> - string(6) "Street" - ["VClearance"]=> - string(2) "10" -} -Test 3: Update changes using a temporary CLOB -string(%d) " - -%sWarehouseId>1 -%sWarehouseName>Southlake, Texas -%sBuilding>Owned -%sArea>25000 -%sDocks>1 -%sDockType>Rear load -%sWaterAccess>true -%sRailAccess>N -%sParking>Street -%sVClearance>10 - -" diff --git a/ext/pdo_oci/CREDITS b/ext/pdo_oci/CREDITS deleted file mode 100644 index 63e863a22dd9..000000000000 --- a/ext/pdo_oci/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Oracle (OCI) driver for PDO -Wez Furlong diff --git a/ext/pdo_oci/config.m4 b/ext/pdo_oci/config.m4 deleted file mode 100644 index 05ecebf272c6..000000000000 --- a/ext/pdo_oci/config.m4 +++ /dev/null @@ -1,204 +0,0 @@ -if test -z "$SED"; then - PHP_PDO_OCI_SED="sed"; -else - PHP_PDO_OCI_SED="$SED"; -fi - -PHP_PDO_OCI_TAIL1=`echo a | tail -n1 2>/dev/null` -if test "$PHP_PDO_OCI_TAIL1" = "a"; then - PHP_PDO_OCI_TAIL1="tail -n1" -else - PHP_PDO_OCI_TAIL1="tail -1" -fi - -AC_DEFUN([AC_PDO_OCI_VERSION],[ - AC_MSG_CHECKING([Oracle version]) - PDO_OCI_LCS_BASE=$PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME - dnl Oracle 10g, 11g, 12c etc - PDO_OCI_LCS=`ls $PDO_OCI_LCS_BASE.*.1 2> /dev/null | $PHP_PDO_OCI_TAIL1` - if test -f "$PDO_OCI_LCS"; then - dnl Oracle 10g, 11g 12c etc. The x.2 version libraries are named x.1 for - dnl drop in compatibility - PDO_OCI_VERSION=`echo $PDO_OCI_LCS | $PHP_PDO_OCI_SED -e 's/.*\.\(.*\)\.1$/\1.1/'` - elif test -f $PDO_OCI_LCS_BASE.9.0; then - dnl There is no case for Oracle 9.2. Oracle 9.2 libraries have a 9.0 suffix - dnl for drop-in compatibility with Oracle 9.0 - PDO_OCI_VERSION=9.0 - else - AC_MSG_ERROR(Oracle libclntsh.$SHLIB_SUFFIX_NAME client library not found or its version is lower than 9) - fi - AC_MSG_RESULT($PDO_OCI_VERSION) -]) - -AC_DEFUN([AC_PDO_OCI_CHECK_LIB_DIR],[ - AC_CHECK_SIZEOF([long]) - AC_MSG_CHECKING([if we're at 64-bit platform]) - AS_IF([test "$ac_cv_sizeof_long" -eq 4],[ - AC_MSG_RESULT([no]) - TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32" - ],[ - AC_MSG_RESULT([yes]) - TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib" - ]) - - AC_MSG_CHECKING([OCI8 libraries dir]) - if test -d "$PDO_OCI_DIR/lib" && test ! -d "$PDO_OCI_DIR/lib32"; then - PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib" - elif test ! -d "$PDO_OCI_DIR/lib" && test -d "$PDO_OCI_DIR/lib32"; then - PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32" - elif test -d "$PDO_OCI_DIR/lib" && test -d "$PDO_OCI_DIR/lib32"; then - PDO_OCI_LIB_DIR=$TMP_PDO_OCI_LIB_DIR - else - AC_MSG_ERROR([Oracle required OCI8 libraries not found]) - fi - AC_MSG_RESULT($PDO_OCI_LIB_DIR) -]) - -PHP_ARG_WITH([pdo-oci], - [Oracle OCI support for PDO], - [AS_HELP_STRING([[--with-pdo-oci[=DIR]]], - [PDO: Oracle OCI support. DIR defaults to $ORACLE_HOME. Use - --with-pdo-oci=instantclient,/path/to/instant/client/lib for an Oracle - Instant Client installation.])]) - -if test "$PHP_PDO_OCI" != "no"; then - - if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then - AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.]) - fi - - AC_MSG_CHECKING([Oracle Install-Dir]) - if test "$PHP_PDO_OCI" = "yes" || test -z "$PHP_PDO_OCI"; then - PDO_OCI_DIR=$ORACLE_HOME - else - PDO_OCI_DIR=$PHP_PDO_OCI - fi - AC_MSG_RESULT($PHP_PDO_OCI) - - AC_MSG_CHECKING([if that is sane]) - if test -z "$PDO_OCI_DIR"; then - AC_MSG_ERROR([You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_HOME.]) - else - AC_MSG_RESULT([yes]) - fi - - if test "instantclient" = "`echo $PDO_OCI_DIR | cut -d, -f1`" ; then - AC_CHECK_SIZEOF([long]) - AC_MSG_CHECKING([if we're at 64-bit platform]) - AS_IF([test "$ac_cv_sizeof_long" -eq 4],[ - AC_MSG_RESULT([no]) - PDO_OCI_CLIENT_DIR="client" - ],[ - AC_MSG_RESULT([yes]) - PDO_OCI_CLIENT_DIR="client64" - ]) - - PDO_OCI_LIB_DIR="`echo $PDO_OCI_DIR | cut -d, -f2`" - AC_PDO_OCI_VERSION($PDO_OCI_LIB_DIR) - - AC_MSG_CHECKING([for oci.h]) - dnl Header directory for Instant Client SDK RPM install - OCISDKRPMINC=`echo "$PDO_OCI_LIB_DIR" | $PHP_PDO_OCI_SED -e 's!^\(.*\)/lib/oracle/\(.*\)/\('${PDO_OCI_CLIENT_DIR}'\)/lib[/]*$!\1/include/oracle/\2/\3!'` - - dnl Header directory for manual installation - OCISDKMANINC=`echo "$PDO_OCI_LIB_DIR" | $PHP_PDO_OCI_SED -e 's!^\(.*\)/lib[/]*$!\1/include!'` - - dnl Header directory for Instant Client SDK zip file install - OCISDKZIPINC=$PDO_OCI_LIB_DIR/sdk/include - - - if test -f "$OCISDKRPMINC/oci.h" ; then - PHP_ADD_INCLUDE($OCISDKRPMINC) - AC_MSG_RESULT($OCISDKRPMINC) - elif test -f "$OCISDKMANINC/oci.h" ; then - PHP_ADD_INCLUDE($OCISDKMANINC) - AC_MSG_RESULT($OCISDKMANINC) - elif test -f "$OCISDKZIPINC/oci.h" ; then - PHP_ADD_INCLUDE($OCISDKZIPINC) - AC_MSG_RESULT($OCISDKZIPINC) - else - AC_MSG_ERROR([I'm too dumb to figure out where the include dir is in your Instant Client install]) - fi - else - AC_PDO_OCI_CHECK_LIB_DIR($PDO_OCI_DIR) - - if test -d "$PDO_OCI_DIR/rdbms/public"; then - PHP_ADD_INCLUDE($PDO_OCI_DIR/rdbms/public) - PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/public" - fi - if test -d "$PDO_OCI_DIR/rdbms/demo"; then - PHP_ADD_INCLUDE($PDO_OCI_DIR/rdbms/demo) - PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/demo" - fi - if test -d "$PDO_OCI_DIR/network/public"; then - PHP_ADD_INCLUDE($PDO_OCI_DIR/network/public) - PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/network/public" - fi - if test -d "$PDO_OCI_DIR/plsql/public"; then - PHP_ADD_INCLUDE($PDO_OCI_DIR/plsql/public) - PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/plsql/public" - fi - if test -d "$PDO_OCI_DIR/include"; then - PHP_ADD_INCLUDE($PDO_OCI_DIR/include) - PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/include" - fi - - if test -f "$PDO_OCI_LIB_DIR/sysliblist"; then - PHP_EVAL_LIBLINE(`cat $PDO_OCI_LIB_DIR/sysliblist`, PDO_OCI_SYSLIB) - elif test -f "$PDO_OCI_DIR/rdbms/lib/sysliblist"; then - PHP_EVAL_LIBLINE(`cat $PDO_OCI_DIR/rdbms/lib/sysliblist`, PDO_OCI_SYSLIB) - fi - AC_PDO_OCI_VERSION($PDO_OCI_LIB_DIR) - fi - - case $PDO_OCI_VERSION in - 7.3|8.0|8.1) - AC_MSG_ERROR([Oracle client libraries < 9 are not supported]) - ;; - esac - - PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD) - PHP_ADD_LIBPATH($PDO_OCI_LIB_DIR, PDO_OCI_SHARED_LIBADD) - - PHP_CHECK_LIBRARY(clntsh, OCIEnvCreate, - [ - AC_DEFINE(HAVE_OCIENVCREATE,1,[ ]) - ], [], [ - -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD - ]) - - PHP_CHECK_LIBRARY(clntsh, OCIEnvNlsCreate, - [ - AC_DEFINE(HAVE_OCIENVNLSCREATE,1,[ ]) - ], [], [ - -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD - ]) - - dnl Scrollable cursors? - PHP_CHECK_LIBRARY(clntsh, OCIStmtFetch2, - [ - AC_DEFINE(HAVE_OCISTMTFETCH2,1,[ ]) - ], [], [ - -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD - ]) - - dnl Can handle bytes vs. characters? - PHP_CHECK_LIBRARY(clntsh, OCILobRead2, - [ - AC_DEFINE(HAVE_OCILOBREAD2,1,[ ]) - ], [], [ - -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD - ]) - - PHP_CHECK_PDO_INCLUDES - - PHP_NEW_EXTENSION(pdo_oci, pdo_oci.c oci_driver.c oci_statement.c, $ext_shared,,-I$pdo_cv_inc_path) - - PHP_SUBST_OLD(PDO_OCI_SHARED_LIBADD) - PHP_SUBST_OLD(PDO_OCI_DIR) - PHP_SUBST_OLD(PDO_OCI_VERSION) - - PHP_ADD_EXTENSION_DEP(pdo_oci, pdo) - - AC_DEFINE_UNQUOTED(PHP_PDO_OCI_CLIENT_VERSION, "$PDO_OCI_VERSION", [ ]) -fi diff --git a/ext/pdo_oci/config.w32 b/ext/pdo_oci/config.w32 deleted file mode 100644 index 39936578a3b5..000000000000 --- a/ext/pdo_oci/config.w32 +++ /dev/null @@ -1,45 +0,0 @@ -// vim:ft=javascript - -ARG_WITH("pdo-oci", "Oracle OCI support for PDO", "no"); - -if (PHP_PDO_OCI != "no") { - - pdo_oci_dirs = new Array( - PHP_PDO_OCI, - PHP_PDO_OCI + "\\oci", - PHP_PHP_BUILD + "\\instantclient10_*\\sdk", - PHP_PHP_BUILD + "\\oci92" - ); - - pdo_oci_lib_paths = ""; - pdo_oci_inc_paths = ""; - - // find the oracle install - for (i = 0; i < pdo_oci_dirs.length; i++) { - pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib;"; - pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib\\msvc;"; - pdo_oci_inc_paths += pdo_oci_dirs[i] + "\\include;"; - } - - pdo_oci_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient;" - pdo_oci_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient;"; - - pdo_oci_header = CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_PDO_OCI", pdo_oci_inc_paths, null, null, true); - - if (pdo_oci_header && CHECK_LIB("oci.lib", "pdo_oci", pdo_oci_lib_paths)) { - - pdo_oci_inc_dir = FSO.GetParentFolderName(pdo_oci_header); - - EXTENSION('pdo_oci', 'pdo_oci.c oci_driver.c oci_statement.c'); - - /* probe for some functions not present in older versions */ - pdo_oci_inc_dir = FSO.GetFolder(pdo_oci_header); - CHECK_FUNC_IN_HEADER('oci.h', 'OCIEnvCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI'); - CHECK_FUNC_IN_HEADER('ociap.h', 'OCIStmtFetch2', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI'); - CHECK_FUNC_IN_HEADER('ociap.h', 'OCIEnvNlsCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI'); - - } else { - WARNING("pdo-oci not enabled; libraries and headers not found"); - } - ADD_EXTENSION_DEP('pdo_oci', 'pdo'); -} diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c deleted file mode 100644 index 6a16420b9576..000000000000 --- a/ext/pdo_oci/oci_driver.c +++ /dev/null @@ -1,895 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_oci.h" -#include "php_pdo_oci_int.h" -#include "Zend/zend_exceptions.h" - -static inline ub4 pdo_oci_sanitize_prefetch(long prefetch); - -static void pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - pdo_oci_error_info *einfo; - - einfo = &H->einfo; - - if (stmt) { - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - - if (S->einfo.errmsg) { - einfo = &S->einfo; - } - } - - if (einfo->errcode) { - add_next_index_long(info, einfo->errcode); - add_next_index_string(info, einfo->errmsg); - } -} -/* }}} */ - -ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line) /* {{{ */ -{ - text errbuf[1024] = "<>"; - char tmp_buf[2048]; - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - pdo_oci_error_info *einfo; - pdo_oci_stmt *S = NULL; - pdo_error_type *pdo_err = &dbh->error_code; - - if (stmt) { - S = (pdo_oci_stmt*)stmt->driver_data; - einfo = &S->einfo; - pdo_err = &stmt->error_code; - } - else { - einfo = &H->einfo; - } - - if (einfo->errmsg) { - pefree(einfo->errmsg, dbh->is_persistent); - } - - einfo->errmsg = NULL; - einfo->errcode = 0; - einfo->file = file; - einfo->line = line; - - if (isinit) { /* Initialization error */ - strcpy(*pdo_err, "HY000"); - slprintf(tmp_buf, sizeof(tmp_buf), "%s (%s:%d)", what, file, line); - einfo->errmsg = pestrdup(tmp_buf, dbh->is_persistent); - } - else { - switch (status) { - case OCI_SUCCESS: - strcpy(*pdo_err, "00000"); - break; - case OCI_ERROR: - OCIErrorGet(err, (ub4)1, NULL, &einfo->errcode, errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); - slprintf(tmp_buf, sizeof(tmp_buf), "%s: %s (%s:%d)", what, errbuf, file, line); - einfo->errmsg = pestrdup(tmp_buf, dbh->is_persistent); - break; - case OCI_SUCCESS_WITH_INFO: - OCIErrorGet(err, (ub4)1, NULL, &einfo->errcode, errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); - slprintf(tmp_buf, sizeof(tmp_buf), "%s: OCI_SUCCESS_WITH_INFO: %s (%s:%d)", what, errbuf, file, line); - einfo->errmsg = pestrdup(tmp_buf, dbh->is_persistent); - break; - case OCI_NEED_DATA: - slprintf(tmp_buf, sizeof(tmp_buf), "%s: OCI_NEED_DATA (%s:%d)", what, file, line); - einfo->errmsg = pestrdup(tmp_buf, dbh->is_persistent); - break; - case OCI_NO_DATA: - slprintf(tmp_buf, sizeof(tmp_buf), "%s: OCI_NO_DATA (%s:%d)", what, file, line); - einfo->errmsg = pestrdup(tmp_buf, dbh->is_persistent); - break; - case OCI_INVALID_HANDLE: - slprintf(tmp_buf, sizeof(tmp_buf), "%s: OCI_INVALID_HANDLE (%s:%d)", what, file, line); - einfo->errmsg = pestrdup(tmp_buf, dbh->is_persistent); - break; - case OCI_STILL_EXECUTING: - slprintf(tmp_buf, sizeof(tmp_buf), "%s: OCI_STILL_EXECUTING (%s:%d)", what, file, line); - einfo->errmsg = pestrdup(tmp_buf, dbh->is_persistent); - break; - case OCI_CONTINUE: - slprintf(tmp_buf, sizeof(tmp_buf), "%s: OCI_CONTINUE (%s:%d)", what, file, line); - einfo->errmsg = pestrdup(tmp_buf, dbh->is_persistent); - break; - } - - if (einfo->errcode) { - switch (einfo->errcode) { - case 1013: /* user requested cancel of current operation */ - zend_bailout(); - break; - - case 12154: /* ORA-12154: TNS:could not resolve service name */ - strcpy(*pdo_err, "42S02"); - break; - - case 22: /* ORA-00022: invalid session id */ - case 378: - case 602: - case 603: - case 604: - case 609: - case 1012: /* ORA-01012: */ - case 1033: - case 1041: - case 1043: - case 1089: - case 1090: - case 1092: - case 3113: /* ORA-03133: end of file on communication channel */ - case 3114: - case 3122: - case 3135: - case 12153: - case 27146: - case 28511: - /* consider the connection closed */ - dbh->is_closed = 1; - H->attached = 0; - strcpy(*pdo_err, "01002"); /* FIXME */ - break; - - default: - strcpy(*pdo_err, "HY000"); - } - } - - if (stmt) { - /* always propagate the error code back up to the dbh, - * so that we can catch the error information when execute - * is called via query. See Bug #33707 */ - if (H->einfo.errmsg) { - pefree(H->einfo.errmsg, dbh->is_persistent); - } - H->einfo = *einfo; - H->einfo.errmsg = einfo->errmsg ? pestrdup(einfo->errmsg, dbh->is_persistent) : NULL; - strcpy(dbh->error_code, stmt->error_code); - } - } - - /* little mini hack so that we can use this code from the dbh ctor */ - if (!dbh->methods && status != OCI_SUCCESS_WITH_INFO) { - zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode, "SQLSTATE[%s]: %s", *pdo_err, einfo->errmsg); - } - - return einfo->errcode; -} -/* }}} */ - -static void oci_handle_closer(pdo_dbh_t *dbh) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - - if (H->svc) { - /* rollback any outstanding work */ - OCITransRollback(H->svc, H->err, 0); - } - - if (H->session) { - OCIHandleFree(H->session, OCI_HTYPE_SESSION); - H->session = NULL; - } - - if (H->svc) { - OCIHandleFree(H->svc, OCI_HTYPE_SVCCTX); - H->svc = NULL; - } - - if (H->server && H->attached) { - H->last_err = OCIServerDetach(H->server, H->err, OCI_DEFAULT); - if (H->last_err) { - oci_drv_error("OCIServerDetach"); - } - H->attached = 0; - } - - if (H->server) { - OCIHandleFree(H->server, OCI_HTYPE_SERVER); - H->server = NULL; - } - - if (H->err) { - OCIHandleFree(H->err, OCI_HTYPE_ERROR); - H->err = NULL; - } - - if (H->charset && H->env) { - OCIHandleFree(H->env, OCI_HTYPE_ENV); - H->env = NULL; - } - - if (H->einfo.errmsg) { - pefree(H->einfo.errmsg, dbh->is_persistent); - H->einfo.errmsg = NULL; - } - - pefree(H, dbh->is_persistent); -} -/* }}} */ - -static bool oci_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - pdo_oci_stmt *S = ecalloc(1, sizeof(*S)); - ub4 prefetch; - zend_string *nsql = NULL; - int ret; - -#ifdef HAVE_OCISTMTFETCH2 - S->exec_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, - PDO_CURSOR_FWDONLY) == PDO_CURSOR_SCROLL ? - OCI_STMT_SCROLLABLE_READONLY : OCI_DEFAULT; -#else - S->exec_type = OCI_DEFAULT; -#endif - - S->H = H; - stmt->supports_placeholders = PDO_PLACEHOLDER_NAMED; - ret = pdo_parse_params(stmt, sql, &nsql); - - if (ret == 1) { - /* query was re-written */ - sql = nsql; - } else if (ret == -1) { - /* couldn't grok it */ - strcpy(dbh->error_code, stmt->error_code); - efree(S); - return false; - } - - /* create an OCI statement handle */ - OCIHandleAlloc(H->env, (dvoid*)&S->stmt, OCI_HTYPE_STMT, 0, NULL); - - /* and our own private error handle */ - OCIHandleAlloc(H->env, (dvoid*)&S->err, OCI_HTYPE_ERROR, 0, NULL); - - if (ZSTR_LEN(sql) != 0) { - H->last_err = OCIStmtPrepare(S->stmt, H->err, (text*) ZSTR_VAL(sql), (ub4) ZSTR_LEN(sql), OCI_NTV_SYNTAX, OCI_DEFAULT); - if (nsql) { - zend_string_release(nsql); - nsql = NULL; - } - if (H->last_err) { - H->last_err = oci_drv_error("OCIStmtPrepare"); - OCIHandleFree(S->stmt, OCI_HTYPE_STMT); - OCIHandleFree(S->err, OCI_HTYPE_ERROR); - efree(S); - return false; - } - - } - - prefetch = H->prefetch; /* Note 0 is allowed so in future REF CURSORs can be used & then passed with no row loss*/ - H->last_err = OCIAttrSet(S->stmt, OCI_HTYPE_STMT, &prefetch, 0, - OCI_ATTR_PREFETCH_ROWS, H->err); - if (!H->last_err) { - prefetch *= PDO_OCI_PREFETCH_ROWSIZE; - H->last_err = OCIAttrSet(S->stmt, OCI_HTYPE_STMT, &prefetch, 0, - OCI_ATTR_PREFETCH_MEMORY, H->err); - } - - stmt->driver_data = S; - stmt->methods = &oci_stmt_methods; - if (nsql) { - zend_string_release(nsql); - nsql = NULL; - } - - return true; -} -/* }}} */ - -static zend_long oci_handle_doer(pdo_dbh_t *dbh, const zend_string *sql) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - OCIStmt *stmt; - ub2 stmt_type; - ub4 rowcount; - int ret = -1; - - OCIHandleAlloc(H->env, (dvoid*)&stmt, OCI_HTYPE_STMT, 0, NULL); - - H->last_err = OCIStmtPrepare(stmt, H->err, (text*)ZSTR_VAL(sql), (ub4) ZSTR_LEN(sql), OCI_NTV_SYNTAX, OCI_DEFAULT); - if (H->last_err) { - H->last_err = oci_drv_error("OCIStmtPrepare"); - OCIHandleFree(stmt, OCI_HTYPE_STMT); - return -1; - } - - H->last_err = OCIAttrGet(stmt, OCI_HTYPE_STMT, &stmt_type, 0, OCI_ATTR_STMT_TYPE, H->err); - - if (stmt_type == OCI_STMT_SELECT) { - /* invalid usage; cancel it */ - OCIHandleFree(stmt, OCI_HTYPE_STMT); - php_error_docref(NULL, E_WARNING, "issuing a SELECT query here is invalid"); - return -1; - } - - /* now we are good to go */ - H->last_err = OCIStmtExecute(H->svc, stmt, H->err, 1, 0, NULL, NULL, - (dbh->auto_commit && !dbh->in_txn) ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT); - - sword last_err = H->last_err; - - if (last_err) { - H->last_err = oci_drv_error("OCIStmtExecute"); - } - - if (!last_err || last_err == OCI_SUCCESS_WITH_INFO) { - /* return the number of affected rows */ - H->last_err = OCIAttrGet(stmt, OCI_HTYPE_STMT, &rowcount, 0, OCI_ATTR_ROW_COUNT, H->err); - ret = rowcount; - } - - OCIHandleFree(stmt, OCI_HTYPE_STMT); - - return ret; -} -/* }}} */ - -static zend_string* oci_handle_quoter(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_param_type paramtype ) /* {{{ */ -{ - int qcount = 0; - char const *cu, *l, *r; - char *c, *quoted; - size_t quotedlen; - zend_string *quoted_str; - - if (ZSTR_LEN(unquoted) == 0) { - return ZSTR_INIT_LITERAL("''", 0); - } - - /* count single quotes */ - for (cu = ZSTR_VAL(unquoted); (cu = strchr(cu,'\'')); qcount++, cu++) - ; /* empty loop */ - - quotedlen = ZSTR_LEN(unquoted) + qcount + 2; - quoted = c = emalloc(quotedlen+1); - *c++ = '\''; - - /* foreach (chunk that ends in a quote) */ - for (l = ZSTR_VAL(unquoted); (r = strchr(l,'\'')); l = r+1) { - strncpy(c, l, r-l+1); - c += (r-l+1); - *c++ = '\''; /* add second quote */ - } - - /* Copy remainder and add enclosing quote */ - strncpy(c, l, quotedlen-(c-quoted)-1); - quoted[quotedlen-1] = '\''; - quoted[quotedlen] = '\0'; - - quoted_str = zend_string_init(quoted, quotedlen, 0); - efree(quoted); - return quoted_str; -} -/* }}} */ - -static bool oci_handle_begin(pdo_dbh_t *dbh) /* {{{ */ -{ - /* with Oracle, there is nothing special to be done */ - return true; -} -/* }}} */ - -static bool oci_handle_commit(pdo_dbh_t *dbh) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - - H->last_err = OCITransCommit(H->svc, H->err, 0); - - if (H->last_err) { - H->last_err = oci_drv_error("OCITransCommit"); - return false; - } - return true; -} -/* }}} */ - -static bool oci_handle_rollback(pdo_dbh_t *dbh) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - - H->last_err = OCITransRollback(H->svc, H->err, 0); - - if (H->last_err) { - H->last_err = oci_drv_error("OCITransRollback"); - return false; - } - return true; -} -/* }}} */ - -static bool oci_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) /* {{{ */ -{ - zend_long lval; - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - - switch (attr) { - case PDO_ATTR_AUTOCOMMIT: - { - bool bval; - if (!pdo_get_bool_param(&bval, val)) { - return false; - } - - if (dbh->in_txn) { - /* Assume they want to commit whatever is outstanding */ - H->last_err = OCITransCommit(H->svc, H->err, 0); - - if (H->last_err) { - H->last_err = oci_drv_error("OCITransCommit"); - return false; - } - dbh->in_txn = false; - } - - dbh->auto_commit = (unsigned int) bval; - return true; - } - case PDO_ATTR_PREFETCH: - { - if (!pdo_get_long_param(&lval, val)) { - return false; - } - - H->prefetch = pdo_oci_sanitize_prefetch(lval); - return true; - } - case PDO_OCI_ATTR_ACTION: - { -#if (OCI_MAJOR_VERSION >= 10) - zend_string *action = zval_try_get_string(val); - if (UNEXPECTED(!action)) { - return false; - } - - H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION, - (dvoid *) ZSTR_VAL(action), (ub4) ZSTR_LEN(action), - OCI_ATTR_ACTION, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_ACTION"); - return false; - } - return true; -#else - oci_drv_error("Unsupported attribute type"); - return false; -#endif - } - case PDO_OCI_ATTR_CLIENT_INFO: - { -#if (OCI_MAJOR_VERSION >= 10) - zend_string *client_info = zval_try_get_string(val); - if (UNEXPECTED(!client_info)) { - return false; - } - - H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION, - (dvoid *) ZSTR_VAL(client_info), (ub4) ZSTR_LEN(client_info), - OCI_ATTR_CLIENT_INFO, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_CLIENT_INFO"); - return false; - } - return true; -#else - oci_drv_error("Unsupported attribute type"); - return false; -#endif - } - case PDO_OCI_ATTR_CLIENT_IDENTIFIER: - { -#if (OCI_MAJOR_VERSION >= 10) - zend_string *identifier = zval_try_get_string(val); - if (UNEXPECTED(!identifier)) { - return false; - } - - H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION, - (dvoid *) ZSTR_VAL(identifier), (ub4) ZSTR_LEN(identifier), - OCI_ATTR_CLIENT_IDENTIFIER, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_CLIENT_IDENTIFIER"); - return false; - } - return true; -#else - oci_drv_error("Unsupported attribute type"); - return false; -#endif - } - case PDO_OCI_ATTR_MODULE: - { -#if (OCI_MAJOR_VERSION >= 10) - zend_string *module = zval_try_get_string(val); - if (UNEXPECTED(!module)) { - return false; - } - - H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION, - (dvoid *) ZSTR_VAL(module), (ub4) ZSTR_LEN(module), - OCI_ATTR_MODULE, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_MODULE"); - return false; - } - return true; -#else - oci_drv_error("Unsupported attribute type"); - return false; -#endif - } - case PDO_OCI_ATTR_CALL_TIMEOUT: - { -#if (OCI_MAJOR_VERSION >= 18) - if (!pdo_get_long_param(&lval, val)) { - return false; - } - ub4 timeout = (ub4) lval; - - H->last_err = OCIAttrSet(H->svc, OCI_HTYPE_SVCCTX, - (dvoid *) &timeout, (ub4) 0, - OCI_ATTR_CALL_TIMEOUT, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_CALL_TIMEOUT"); - return false; - } - return true; -#else - oci_drv_error("Unsupported attribute type"); - return false; -#endif - } - default: - return false; - } - -} -/* }}} */ - -static int oci_handle_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - - switch (attr) { - case PDO_ATTR_SERVER_VERSION: - case PDO_ATTR_SERVER_INFO: - { - text infostr[512]; - char verstr[15]; - ub4 vernum; - - if (OCIServerRelease(H->svc, H->err, infostr, (ub4)sizeof(infostr), (ub1)OCI_HTYPE_SVCCTX, &vernum)) - { - ZVAL_STRING(return_value, "<>"); - } else { - if (attr == PDO_ATTR_SERVER_INFO) { - ZVAL_STRING(return_value, (char *)infostr); - } else { - slprintf(verstr, sizeof(verstr), "%d.%d.%d.%d.%d", - (int)((vernum>>24) & 0xFF), /* version number */ - (int)((vernum>>20) & 0x0F), /* release number*/ - (int)((vernum>>12) & 0xFF), /* update number */ - (int)((vernum>>8) & 0x0F), /* port release number */ - (int)((vernum>>0) & 0xFF)); /* port update number */ - - ZVAL_STRING(return_value, verstr); - } - } - return TRUE; - } - - case PDO_ATTR_CLIENT_VERSION: - { -#if OCI_MAJOR_VERSION > 10 || (OCI_MAJOR_VERSION == 10 && OCI_MINOR_VERSION >= 2) - /* Run time client version */ - sword major, minor, update, patch, port_update; - char verstr[15]; - - OCIClientVersion(&major, &minor, &update, &patch, &port_update); - slprintf(verstr, sizeof(verstr), "%d.%d.%d.%d.%d", major, minor, update, patch, port_update); - ZVAL_STRING(return_value, verstr); -#elif defined(PHP_PDO_OCI_CLIENT_VERSION) - /* Compile time client version */ - ZVAL_STRING(return_value, PHP_PDO_OCI_CLIENT_VERSION); -#else - return FALSE; - -#endif /* Check for OCIClientVersion() support */ - - return TRUE; - } - - case PDO_ATTR_AUTOCOMMIT: - ZVAL_BOOL(return_value, dbh->auto_commit); - return TRUE; - - case PDO_ATTR_PREFETCH: - ZVAL_LONG(return_value, H->prefetch); - return TRUE; - case PDO_OCI_ATTR_CALL_TIMEOUT: - { -#if (OCI_MAJOR_VERSION >= 18) - ub4 timeout; - - H->last_err = OCIAttrGet(H->svc, OCI_HTYPE_SVCCTX, - (dvoid *) &timeout, NULL, - OCI_ATTR_CALL_TIMEOUT, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrGet: OCI_ATTR_CALL_TIMEOUT"); - return FALSE; - } - - ZVAL_LONG(return_value, (zend_long) timeout); - return TRUE; -#else - oci_drv_error("Unsupported attribute type"); - return FALSE; -#endif - } - default: - return FALSE; - - } - return FALSE; - -} -/* }}} */ - -static zend_result pdo_oci_check_liveness(pdo_dbh_t *dbh) /* {{{ */ -{ - pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; - sb4 error_code = 0; -#if (!((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2)))) - char version[256]; -#endif - - /* TODO move attached check to PDO level */ - if (H->attached == 0) { - return FAILURE; - } - /* TODO add persistent_timeout check at PDO level */ - - - /* Use OCIPing instead of OCIServerVersion. If OCIPing returns ORA-1010 (invalid OCI operation) - * such as from Pre-10.1 servers, the error is still from the server and we would have - * successfully performed a roundtrip and validated the connection. Use OCIServerVersion for - * Pre-10.2 clients - */ -#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) /* OCIPing available 10.2 onwards */ - H->last_err = OCIPing (H->svc, H->err, OCI_DEFAULT); -#else - /* use good old OCIServerVersion() */ - H->last_err = OCIServerVersion (H->svc, H->err, (text *)version, sizeof(version), OCI_HTYPE_SVCCTX); -#endif - if (H->last_err == OCI_SUCCESS) { - return SUCCESS; - } - - OCIErrorGet (H->err, (ub4)1, NULL, &error_code, NULL, 0, OCI_HTYPE_ERROR); - - if (error_code == 1010) { - return SUCCESS; - } - return FAILURE; -} -/* }}} */ - -static const struct pdo_dbh_methods oci_methods = { - oci_handle_closer, - oci_handle_preparer, - oci_handle_doer, - oci_handle_quoter, - oci_handle_begin, - oci_handle_commit, - oci_handle_rollback, - oci_handle_set_attribute, - NULL, /* last_id not supported */ - pdo_oci_fetch_error_func, - oci_handle_get_attribute, - pdo_oci_check_liveness, /* check_liveness */ - NULL, /* get_driver_methods */ - NULL, /* request_shutdown */ - NULL, /* in transaction, use PDO's internal tracking mechanism */ - NULL /* get_gc */ -}; - -static int pdo_oci_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */ -{ - pdo_oci_db_handle *H; - int i, ret = 0; - struct pdo_data_src_parser vars[] = { - { "charset", NULL, 0 }, - { "dbname", "", 0 }, - { "user", NULL, 0 }, - { "password", NULL, 0 } - }; - - php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 4); - - H = pecalloc(1, sizeof(*H), dbh->is_persistent); - dbh->driver_data = H; - - dbh->skip_param_evt = - 1 << PDO_PARAM_EVT_FETCH_PRE | - 1 << PDO_PARAM_EVT_FETCH_POST | - 1 << PDO_PARAM_EVT_NORMALIZE; - - H->prefetch = PDO_OCI_PREFETCH_DEFAULT; - - /* allocate an environment */ -#ifdef HAVE_OCIENVNLSCREATE - if (vars[0].optval) { - H->charset = OCINlsCharSetNameToId(pdo_oci_Env, (const oratext *)vars[0].optval); - if (!H->charset) { - oci_init_error("OCINlsCharSetNameToId: unknown character set name"); - goto cleanup; - } else { - if (OCIEnvNlsCreate(&H->env, PDO_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, H->charset, H->charset) != OCI_SUCCESS) { - oci_init_error("OCIEnvNlsCreate: Check the character set is valid and that PHP has access to Oracle libraries and NLS data"); - goto cleanup; - } - } - } -#endif - if (H->env == NULL) { - /* use the global environment */ - H->env = pdo_oci_Env; - } - - /* something to hold errors */ - OCIHandleAlloc(H->env, (dvoid **)&H->err, OCI_HTYPE_ERROR, 0, NULL); - - /* handle for the server */ - OCIHandleAlloc(H->env, (dvoid **)&H->server, OCI_HTYPE_SERVER, 0, NULL); - - H->last_err = OCIServerAttach(H->server, H->err, (text*)vars[1].optval, - (sb4) strlen(vars[1].optval), OCI_DEFAULT); - - if (H->last_err) { - oci_drv_error("pdo_oci_handle_factory"); - goto cleanup; - } - - H->attached = 1; - - /* create a service context */ - H->last_err = OCIHandleAlloc(H->env, (dvoid**)&H->svc, OCI_HTYPE_SVCCTX, 0, NULL); - if (H->last_err) { - oci_drv_error("OCIHandleAlloc: OCI_HTYPE_SVCCTX"); - goto cleanup; - } - - H->last_err = OCIHandleAlloc(H->env, (dvoid**)&H->session, OCI_HTYPE_SESSION, 0, NULL); - if (H->last_err) { - oci_drv_error("OCIHandleAlloc: OCI_HTYPE_SESSION"); - goto cleanup; - } - - /* set server handle into service handle */ - H->last_err = OCIAttrSet(H->svc, OCI_HTYPE_SVCCTX, H->server, 0, OCI_ATTR_SERVER, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_SERVER"); - goto cleanup; - } - - /* username */ - if (!dbh->username && vars[2].optval) { - dbh->username = pestrdup(vars[2].optval, dbh->is_persistent); - } - - if (dbh->username) { - H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION, - dbh->username, (ub4) strlen(dbh->username), - OCI_ATTR_USERNAME, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_USERNAME"); - goto cleanup; - } - } - - /* password */ - if (!dbh->password && vars[3].optval) { - dbh->password = pestrdup(vars[3].optval, dbh->is_persistent); - } - - if (dbh->password) { - H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION, - dbh->password, (ub4) strlen(dbh->password), - OCI_ATTR_PASSWORD, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_PASSWORD"); - goto cleanup; - } - } - - /* Now fire up the session */ - H->last_err = OCISessionBegin(H->svc, H->err, H->session, OCI_CRED_RDBMS, OCI_DEFAULT); - if (H->last_err) { - oci_drv_error("OCISessionBegin"); - /* OCISessionBegin returns OCI_SUCCESS_WITH_INFO when - * user's password has expired, but is still usable. - */ - if (H->last_err != OCI_SUCCESS_WITH_INFO) { - goto cleanup; - } - } - - /* set the server handle into service handle */ - H->last_err = OCIAttrSet(H->svc, OCI_HTYPE_SVCCTX, H->session, 0, OCI_ATTR_SESSION, H->err); - if (H->last_err) { - oci_drv_error("OCIAttrSet: OCI_ATTR_SESSION"); - goto cleanup; - } - - /* Get max character width */ - H->last_err = OCINlsNumericInfoGet(H->env, H->err, &H->max_char_width, OCI_NLS_CHARSET_MAXBYTESZ); - if (H->last_err) { - oci_drv_error("OCINlsNumericInfoGet: OCI_NLS_CHARSET_MAXBYTESZ"); - goto cleanup; - } - - dbh->methods = &oci_methods; - dbh->alloc_own_columns = 1; - dbh->native_case = PDO_CASE_UPPER; - - ret = 1; - -cleanup: - for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) { - if (vars[i].freeme) { - efree(vars[i].optval); - } - } - - if (!ret) { - oci_handle_closer(dbh); - } - - return ret; -} -/* }}} */ - -const pdo_driver_t pdo_oci_driver = { - PDO_DRIVER_HEADER(oci), - pdo_oci_handle_factory -}; - -static inline ub4 pdo_oci_sanitize_prefetch(long prefetch) /* {{{ */ -{ - if (prefetch < 0) { - prefetch = 0; - } else if (prefetch > UB4MAXVAL / PDO_OCI_PREFETCH_ROWSIZE) { - prefetch = PDO_OCI_PREFETCH_DEFAULT; - } - return ((ub4)prefetch); -} -/* }}} */ diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c deleted file mode 100644 index f3be69f9c32c..000000000000 --- a/ext/pdo_oci/oci_statement.c +++ /dev/null @@ -1,1003 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_oci.h" -#include "php_pdo_oci_int.h" -#include "Zend/zend_extensions.h" - -#define PDO_OCI_LOBMAXSIZE (4294967295UL) /* OCI_LOBMAXSIZE */ - -#define STMT_CALL(name, params) \ - do { \ - S->last_err = name params; \ - S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, FALSE, __FILE__, __LINE__); \ - if (S->last_err) { \ - return 0; \ - } \ - } while(0) - -#define STMT_CALL_MSG(name, msg, params) \ - do { \ - S->last_err = name params; \ - S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, FALSE, __FILE__, __LINE__); \ - if (S->last_err) { \ - return 0; \ - } \ - } while(0) - -static php_stream *oci_create_lob_stream(zval *dbh, pdo_stmt_t *stmt, OCILobLocator *lob); - -#define OCI_TEMPLOB_CLOSE(envhp, svchp, errhp, lob) \ - do \ - { \ - boolean isTempLOB; \ - OCILobIsTemporary(envhp, errhp, lob, &isTempLOB); \ - if (isTempLOB) \ - OCILobFreeTemporary(svchp, errhp, lob); \ - } while(0) - -static int oci_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - HashTable *BC = stmt->bound_columns; - HashTable *BP = stmt->bound_params; - - int i; - - if (S->stmt) { - /* cancel server side resources for the statement if we didn't - * fetch it all */ - OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT); - - /* free the handle */ - OCIHandleFree(S->stmt, OCI_HTYPE_STMT); - S->stmt = NULL; - } - if (S->err) { - OCIHandleFree(S->err, OCI_HTYPE_ERROR); - S->err = NULL; - } - - /* need to ensure these go away now */ - if (BC) { - zend_hash_destroy(BC); - FREE_HASHTABLE(stmt->bound_columns); - stmt->bound_columns = NULL; - } - - if (BP) { - zend_hash_destroy(BP); - FREE_HASHTABLE(stmt->bound_params); - stmt->bound_params = NULL; - } - - if (S->einfo.errmsg) { - pefree(S->einfo.errmsg, stmt->dbh->is_persistent); - S->einfo.errmsg = NULL; - } - - if (S->cols) { - for (i = 0; i < stmt->column_count; i++) { - if (S->cols[i].data) { - switch (S->cols[i].dtype) { - case SQLT_BLOB: - case SQLT_CLOB: - OCI_TEMPLOB_CLOSE(S->H->env, S->H->svc, S->H->err, - (OCILobLocator *) S->cols[i].data); - OCIDescriptorFree(S->cols[i].data, OCI_DTYPE_LOB); - break; - default: - efree(S->cols[i].data); - } - } - } - efree(S->cols); - S->cols = NULL; - } - efree(S); - - stmt->driver_data = NULL; - - return 1; -} /* }}} */ - -static int oci_stmt_execute(pdo_stmt_t *stmt) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - ub4 rowcount; - b4 mode; - - if (!S->stmt_type) { - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_STMT_TYPE", - (S->stmt, OCI_HTYPE_STMT, &S->stmt_type, 0, OCI_ATTR_STMT_TYPE, S->err)); - } - - if (stmt->executed) { - /* ensure that we cancel the cursor from a previous fetch */ - OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT); - } - -#ifdef OCI_STMT_SCROLLABLE_READONLY /* needed for oci8 ? */ - if (S->exec_type == OCI_STMT_SCROLLABLE_READONLY) { - mode = OCI_STMT_SCROLLABLE_READONLY; - } else -#endif - if (stmt->dbh->auto_commit && !stmt->dbh->in_txn) { - mode = OCI_COMMIT_ON_SUCCESS; - } else { - mode = OCI_DEFAULT; - } - - STMT_CALL(OCIStmtExecute, (S->H->svc, S->stmt, S->err, - (S->stmt_type == OCI_STMT_SELECT && !S->have_blobs) ? 0 : 1, 0, NULL, NULL, - mode)); - - if (!stmt->executed) { - ub4 colcount; - /* do first-time-only definition of bind/mapping stuff */ - - /* how many columns do we have ? */ - STMT_CALL_MSG(OCIAttrGet, "ATTR_PARAM_COUNT", - (S->stmt, OCI_HTYPE_STMT, &colcount, 0, OCI_ATTR_PARAM_COUNT, S->err)); - - stmt->column_count = (int)colcount; - - if (S->cols) { - int i; - for (i = 0; i < stmt->column_count; i++) { - if (S->cols[i].data) { - switch (S->cols[i].dtype) { - case SQLT_BLOB: - case SQLT_CLOB: - /* do nothing */ - break; - default: - efree(S->cols[i].data); - } - } - } - efree(S->cols); - } - - S->cols = ecalloc(colcount, sizeof(pdo_oci_column)); - } - - STMT_CALL_MSG(OCIAttrGet, "ATTR_ROW_COUNT", - (S->stmt, OCI_HTYPE_STMT, &rowcount, 0, OCI_ATTR_ROW_COUNT, S->err)); - stmt->row_count = (long)rowcount; - - return 1; -} /* }}} */ - -static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp) /* {{{ */ -{ - struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx; - pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data; - zval *parameter; - - ZEND_ASSERT(param); - - *indpp = &P->indicator; - - if (Z_ISREF(param->parameter)) - parameter = Z_REFVAL(param->parameter); - else - parameter = ¶m->parameter; - - if (P->thing) { - *bufpp = P->thing; - *alenp = sizeof(void*); - } else if (ZVAL_IS_NULL(parameter)) { - /* insert a NULL value into the column */ - P->indicator = -1; /* NULL */ - *bufpp = 0; - *alenp = -1; - } else if (!P->thing) { - /* regular string bind */ - if (!try_convert_to_string(parameter)) { - return OCI_ERROR; - } - *bufpp = Z_STRVAL_P(parameter); - *alenp = (ub4) Z_STRLEN_P(parameter); - } - - *piecep = OCI_ONE_PIECE; - return OCI_CONTINUE; -} /* }}} */ - -static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp) /* {{{ */ -{ - struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx; - pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data; - zval *parameter; - - ZEND_ASSERT(param); - - if (Z_ISREF(param->parameter)) { - parameter = Z_REFVAL(param->parameter); - } else { - parameter = ¶m->parameter; - } - - if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) { - P->actual_len = sizeof(OCILobLocator*); - *bufpp = P->thing; - *alenpp = &P->actual_len; - *piecep = OCI_ONE_PIECE; - *rcodepp = &P->retcode; - *indpp = &P->indicator; - return OCI_CONTINUE; - } - - if (Z_TYPE_P(parameter) == IS_OBJECT || Z_TYPE_P(parameter) == IS_RESOURCE) { - return OCI_CONTINUE; - } - - zval_ptr_dtor(parameter); - - Z_STR_P(parameter) = zend_string_alloc(param->max_value_len, 1); - P->used_for_output = 1; - - P->actual_len = (ub4) Z_STRLEN_P(parameter); - *alenpp = &P->actual_len; - *bufpp = (Z_STR_P(parameter))->val; - *piecep = OCI_ONE_PIECE; - *rcodepp = &P->retcode; - *indpp = &P->indicator; - - return OCI_CONTINUE; -} /* }}} */ - -static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - - /* we're only interested in parameters for prepared SQL right now */ - if (param->is_param) { - pdo_oci_bound_param *P; - sb4 value_sz = -1; - zval *parameter; - - if (Z_ISREF(param->parameter)) - parameter = Z_REFVAL(param->parameter); - else - parameter = ¶m->parameter; - - P = (pdo_oci_bound_param*)param->driver_data; - - switch (event_type) { - case PDO_PARAM_EVT_FETCH_PRE: - case PDO_PARAM_EVT_FETCH_POST: - case PDO_PARAM_EVT_NORMALIZE: - /* Do nothing */ - break; - - case PDO_PARAM_EVT_FREE: - P = param->driver_data; - if (P && P->thing) { - OCI_TEMPLOB_CLOSE(S->H->env, S->H->svc, S->H->err, P->thing); - OCIDescriptorFree(P->thing, OCI_DTYPE_LOB); - P->thing = NULL; - efree(P); - } - else if (P) { - efree(P); - } - break; - - case PDO_PARAM_EVT_ALLOC: - P = (pdo_oci_bound_param*)ecalloc(1, sizeof(pdo_oci_bound_param)); - param->driver_data = P; - - /* figure out what we're doing */ - switch (PDO_PARAM_TYPE(param->param_type)) { - case PDO_PARAM_STMT: - return 0; - - case PDO_PARAM_LOB: - /* P->thing is now an OCILobLocator * */ - P->oci_type = SQLT_BLOB; - value_sz = (sb4) sizeof(OCILobLocator*); - break; - - case PDO_PARAM_STR: - default: - P->oci_type = SQLT_CHR; - value_sz = (sb4) param->max_value_len; - if (param->max_value_len == 0) { - value_sz = (sb4) 1332; /* maximum size before value is interpreted as a LONG value */ - } - - } - - if (param->name) { - STMT_CALL(OCIBindByName, (S->stmt, - &P->bind, S->err, (text*)param->name->val, - (sb4) param->name->len, 0, value_sz, P->oci_type, - &P->indicator, 0, &P->retcode, 0, 0, - OCI_DATA_AT_EXEC)); - } else { - STMT_CALL(OCIBindByPos, (S->stmt, - &P->bind, S->err, ((ub4)param->paramno)+1, - 0, value_sz, P->oci_type, - &P->indicator, 0, &P->retcode, 0, 0, - OCI_DATA_AT_EXEC)); - } - - STMT_CALL(OCIBindDynamic, (P->bind, - S->err, - param, oci_bind_input_cb, - param, oci_bind_output_cb)); - - return 1; - - case PDO_PARAM_EVT_EXEC_PRE: - P->indicator = 0; - P->used_for_output = 0; - if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) { - ub4 empty = 0; - STMT_CALL(OCIDescriptorAlloc, (S->H->env, &P->thing, OCI_DTYPE_LOB, 0, NULL)); - STMT_CALL(OCIAttrSet, (P->thing, OCI_DTYPE_LOB, &empty, 0, OCI_ATTR_LOBEMPTY, S->err)); - S->have_blobs = 1; - } - return 1; - - case PDO_PARAM_EVT_EXEC_POST: - /* fixup stuff set in motion in oci_bind_output_cb */ - if (P->used_for_output) { - if (P->indicator == -1) { - /* set up a NULL value */ - if (Z_TYPE_P(parameter) == IS_STRING) { - /* OCI likes to stick non-terminated strings in things */ - *Z_STRVAL_P(parameter) = '\0'; - } - zval_ptr_dtor_str(parameter); - ZVAL_UNDEF(parameter); - } else if (Z_TYPE_P(parameter) == IS_STRING) { - Z_STR_P(parameter) = zend_string_init(Z_STRVAL_P(parameter), P->actual_len, 1); - } - } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB && P->thing) { - php_stream *stm; - - if (Z_TYPE_P(parameter) == IS_NULL) { - /* if the param is NULL, then we assume that they - * wanted to bind a lob locator into it from the query - * */ - - stm = oci_create_lob_stream(&stmt->database_object_handle, stmt, (OCILobLocator*)P->thing); - if (stm) { - OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); - php_stream_to_zval(stm, parameter); - } - } else { - /* we're a LOB being used for insert; transfer the data now */ - size_t n; - ub4 amt, offset = 1; - char *consume; - - php_stream_from_zval_no_verify(stm, parameter); - if (stm) { - OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); - do { - char buf[8192]; - n = php_stream_read(stm, buf, sizeof(buf)); - if ((int)n <= 0) { - break; - } - consume = buf; - do { - amt = (ub4) n; - OCILobWrite(S->H->svc, S->err, (OCILobLocator*)P->thing, - &amt, offset, consume, (ub4) n, - OCI_ONE_PIECE, - NULL, NULL, 0, SQLCS_IMPLICIT); - offset += amt; - n -= amt; - consume += amt; - } while (n); - } while (1); - OCILobClose(S->H->svc, S->err, (OCILobLocator*)P->thing); - OCILobFlushBuffer(S->H->svc, S->err, (OCILobLocator*)P->thing, 0); - } else if (Z_TYPE_P(parameter) == IS_STRING) { - /* stick the string into the LOB */ - consume = Z_STRVAL_P(parameter); - n = Z_STRLEN_P(parameter); - if (n) { - OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); - while (n) { - amt = (ub4) n; - OCILobWrite(S->H->svc, S->err, (OCILobLocator*)P->thing, - &amt, offset, consume, (ub4) n, - OCI_ONE_PIECE, - NULL, NULL, 0, SQLCS_IMPLICIT); - consume += amt; - n -= amt; - } - OCILobClose(S->H->svc, S->err, (OCILobLocator*)P->thing); - } - } - OCI_TEMPLOB_CLOSE(S->H->env, S->H->svc, S->H->err, P->thing); - OCIDescriptorFree(P->thing, OCI_DTYPE_LOB); - P->thing = NULL; - } - } - - return 1; - } - } - - return 1; -} /* }}} */ - -static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset) /* {{{ */ -{ -#ifdef HAVE_OCISTMTFETCH2 - ub4 ociori = OCI_FETCH_NEXT; -#endif - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - -#ifdef HAVE_OCISTMTFETCH2 - switch (ori) { - case PDO_FETCH_ORI_NEXT: ociori = OCI_FETCH_NEXT; break; - case PDO_FETCH_ORI_PRIOR: ociori = OCI_FETCH_PRIOR; break; - case PDO_FETCH_ORI_FIRST: ociori = OCI_FETCH_FIRST; break; - case PDO_FETCH_ORI_LAST: ociori = OCI_FETCH_LAST; break; - case PDO_FETCH_ORI_ABS: ociori = OCI_FETCH_ABSOLUTE; break; - case PDO_FETCH_ORI_REL: ociori = OCI_FETCH_RELATIVE; break; - } - S->last_err = OCIStmtFetch2(S->stmt, S->err, 1, ociori, (sb4) offset, OCI_DEFAULT); -#else - S->last_err = OCIStmtFetch(S->stmt, S->err, 1, OCI_FETCH_NEXT, OCI_DEFAULT); -#endif - - if (S->last_err == OCI_NO_DATA) { - /* no (more) data */ - return 0; - } - - if (S->last_err == OCI_NEED_DATA) { - oci_stmt_error("OCI_NEED_DATA"); - return 0; - } - - if (S->last_err == OCI_SUCCESS_WITH_INFO || S->last_err == OCI_SUCCESS) { - return 1; - } - - oci_stmt_error("OCIStmtFetch"); - - return 0; -} /* }}} */ - -static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid **bufpp, - ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp) -{ - pdo_oci_column *col = (pdo_oci_column*)octxp; - - switch (col->dtype) { - case SQLT_BLOB: - case SQLT_CLOB: - *piecep = OCI_ONE_PIECE; - *bufpp = col->data; - *alenpp = &col->datalen; - *indpp = (dvoid *)&col->indicator; - break; - EMPTY_SWITCH_DEFAULT_CASE(); - } - - return OCI_CONTINUE; -} - -static int oci_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - OCIParam *param = NULL; - text *colname; - ub2 dtype, data_size, precis; - ub4 namelen; - struct pdo_column_data *col = &stmt->columns[colno]; - bool dyn = FALSE; - - /* describe the column */ - STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err, (dvoid*)¶m, colno+1)); - - /* what type ? */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_TYPE", - (param, OCI_DTYPE_PARAM, &dtype, 0, OCI_ATTR_DATA_TYPE, S->err)); - - /* how big ? */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_SIZE", - (param, OCI_DTYPE_PARAM, &data_size, 0, OCI_ATTR_DATA_SIZE, S->err)); - - /* precision ? */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_PRECISION", - (param, OCI_DTYPE_PARAM, &precis, 0, OCI_ATTR_PRECISION, S->err)); - - /* name ? */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_NAME", - (param, OCI_DTYPE_PARAM, &colname, &namelen, OCI_ATTR_NAME, S->err)); - - col->precision = precis; - col->maxlen = data_size; - col->name = zend_string_init((char *)colname, namelen, 0); - - S->cols[colno].dtype = dtype; - - /* how much room do we need to store the field */ - switch (dtype) { - case SQLT_LBI: - case SQLT_LNG: - if (dtype == SQLT_LBI) { - dtype = SQLT_BIN; - } else { - dtype = SQLT_CHR; - } - S->cols[colno].datalen = 512; /* XXX should be INT_MAX and fetched by pieces */ - S->cols[colno].data = emalloc(S->cols[colno].datalen + 1); - break; - - case SQLT_BLOB: - case SQLT_CLOB: - STMT_CALL(OCIDescriptorAlloc, (S->H->env, (dvoid**)&S->cols[colno].data, OCI_DTYPE_LOB, 0, NULL)); - S->cols[colno].datalen = sizeof(OCILobLocator*); - dyn = TRUE; - break; - - case SQLT_BIN: - default: - if (dtype == SQLT_DAT || dtype == SQLT_NUM || dtype == SQLT_RDD -#ifdef SQLT_TIMESTAMP - || dtype == SQLT_TIMESTAMP -#endif -#ifdef SQLT_TIMESTAMP_TZ - || dtype == SQLT_TIMESTAMP_TZ -#endif - ) { - /* should be big enough for most date formats and numbers */ - S->cols[colno].datalen = 512; -#if defined(SQLT_IBFLOAT) && defined(SQLT_IBDOUBLE) - } else if (dtype == SQLT_IBFLOAT || dtype == SQLT_IBDOUBLE) { - S->cols[colno].datalen = 1024; -#endif - } else if (dtype == SQLT_BIN) { - S->cols[colno].datalen = (ub4) col->maxlen * 2; /* raw characters to hex digits */ - } else { - S->cols[colno].datalen = (ub4) (col->maxlen * S->H->max_char_width); - } - - S->cols[colno].data = emalloc(S->cols[colno].datalen + 1); - dtype = SQLT_CHR; - } - - STMT_CALL(OCIDefineByPos, (S->stmt, &S->cols[colno].def, S->err, colno+1, - S->cols[colno].data, S->cols[colno].datalen, dtype, &S->cols[colno].indicator, - &S->cols[colno].fetched_len, &S->cols[colno].retcode, dyn ? OCI_DYNAMIC_FETCH : OCI_DEFAULT)); - - if (dyn) { - STMT_CALL(OCIDefineDynamic, (S->cols[colno].def, S->err, &S->cols[colno], - oci_define_callback)); - } - - return 1; -} /* }}} */ - -struct _oci_lob_env { - OCISvcCtx *svc; - OCIError *err; -}; -typedef struct _oci_lob_env oci_lob_env; - -struct oci_lob_self { - zval dbh; - pdo_stmt_t *stmt; - pdo_oci_stmt *S; - OCILobLocator *lob; - oci_lob_env *E; - ub4 offset; - ub1 csfrm; -}; - -static ssize_t oci_blob_write(php_stream *stream, const char *buf, size_t count) -{ - struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; - ub4 amt; - sword r; - - amt = (ub4) count; - r = OCILobWrite(self->E->svc, self->E->err, self->lob, - &amt, self->offset, (char*)buf, (ub4) count, - OCI_ONE_PIECE, - NULL, NULL, 0, SQLCS_IMPLICIT); - - if (r != OCI_SUCCESS) { - return (ssize_t)-1; - } - - self->offset += amt; - return amt; -} - -static ssize_t oci_blob_read(php_stream *stream, char *buf, size_t count) -{ - struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; -#if HAVE_OCILOBREAD2 - oraub8 byte_amt = (oraub8) count; - oraub8 char_amt = 0; - - sword r = OCILobRead2(self->E->svc, self->E->err, self->lob, - &byte_amt, &char_amt, (oraub8) self->offset, buf, (oraub8) count, - OCI_ONE_PIECE, NULL, NULL, 0, self->csfrm); -#else - ub4 byte_amt = (ub4) count; - - sword r = OCILobRead(self->E->svc, self->E->err, self->lob, - &byte_amt, self->offset, buf, (ub4) count, - NULL, NULL, 0, SQLCS_IMPLICIT); -#endif - - if (r != OCI_SUCCESS && r != OCI_NEED_DATA) { - return (ssize_t)-1; - } - -#if HAVE_OCILOBREAD2 - self->offset += self->csfrm == 0 ? byte_amt : char_amt; -#else - self->offset += byte_amt; -#endif - if (byte_amt < count) { - stream->eof = 1; - } - return byte_amt; -} - -static int oci_blob_close(php_stream *stream, int close_handle) -{ - struct oci_lob_self *self = (struct oci_lob_self *)stream->abstract; - pdo_stmt_t *stmt = self->stmt; - - if (close_handle) { - zend_object *obj = &stmt->std; - - OCILobClose(self->E->svc, self->E->err, self->lob); - zval_ptr_dtor(&self->dbh); - GC_DELREF(obj); - efree(self->E); - efree(self); - } - - /* php_pdo_free_statement(stmt); */ - return 0; -} - -static int oci_blob_flush(php_stream *stream) -{ - struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; - OCILobFlushBuffer(self->E->svc, self->E->err, self->lob, 0); - return 0; -} - -static int oci_blob_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) -{ - struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; - - if (offset >= PDO_OCI_LOBMAXSIZE) { - return -1; - } else { - self->offset = (ub4) offset + 1; /* Oracle LOBS are 1-based, but PHP is 0-based */ - return 0; - } -} - -static const php_stream_ops oci_blob_stream_ops = { - oci_blob_write, - oci_blob_read, - oci_blob_close, - oci_blob_flush, - "pdo_oci blob stream", - oci_blob_seek, - NULL, - NULL, - NULL -}; - -static php_stream *oci_create_lob_stream(zval *dbh, pdo_stmt_t *stmt, OCILobLocator *lob) -{ - php_stream *stm; - struct oci_lob_self *self = ecalloc(1, sizeof(*self)); - - ZVAL_COPY_VALUE(&self->dbh, dbh); - self->lob = lob; - self->offset = 1; /* 1-based */ - self->stmt = stmt; - self->S = (pdo_oci_stmt*)stmt->driver_data; - self->E = ecalloc(1, sizeof(oci_lob_env)); - self->E->svc = self->S->H->svc; - self->E->err = self->S->err; - - OCILobCharSetForm(self->S->H->env, self->S->err, self->lob, &self->csfrm); - - stm = php_stream_alloc(&oci_blob_stream_ops, self, 0, "r+b"); - - if (stm) { - zend_object *obj; - obj = &stmt->std; - Z_ADDREF(self->dbh); - GC_ADDREF(obj); - return stm; - } - - efree(self); - return NULL; -} - -static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, zval *result, enum pdo_param_type *type) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - pdo_oci_column *C = &S->cols[colno]; - - /* check the indicator to ensure that the data is intact */ - if (C->indicator == -1) { - /* A NULL value */ - ZVAL_NULL(result); - return 1; - } else if (C->indicator == 0) { - /* it was stored perfectly */ - - if (C->dtype == SQLT_BLOB || C->dtype == SQLT_CLOB) { - if (C->data) { - php_stream *stream = oci_create_lob_stream(&stmt->database_object_handle, stmt, (OCILobLocator*)C->data); - OCILobOpen(S->H->svc, S->err, (OCILobLocator*)C->data, OCI_LOB_READONLY); - php_stream_to_zval(stream, result); - return 1; - } - return 0; - } - - ZVAL_STRINGL_FAST(result, C->data, C->fetched_len); - return 1; - } else { - /* it was truncated */ - php_error_docref(NULL, E_WARNING, "Column %d data was too large for buffer and was truncated to fit it", colno); - ZVAL_STRINGL(result, C->data, C->fetched_len); - return 1; - } -} /* }}} */ - - -static int oci_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value) /* {{{ */ -{ - pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; - OCIParam *param = NULL; - ub2 dtype, precis; - sb1 scale; - zval flags; - ub1 isnull, charset_form; - if (!S->stmt) { - return FAILURE; - } - if (colno >= stmt->column_count) { - /* error invalid column */ - return FAILURE; - } - - array_init(return_value); - array_init(&flags); - - /* describe the column */ - STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err, (dvoid*)¶m, colno+1)); - - /* column data type */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_TYPE", - (param, OCI_DTYPE_PARAM, &dtype, 0, OCI_ATTR_DATA_TYPE, S->err)); - - /* column precision */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_PRECISION", - (param, OCI_DTYPE_PARAM, &precis, 0, OCI_ATTR_PRECISION, S->err)); - - /* column scale */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_SCALE", - (param, OCI_DTYPE_PARAM, &scale, 0, OCI_ATTR_SCALE, S->err)); - - /* string column charset form */ - if (dtype == SQLT_CHR || dtype == SQLT_VCS || dtype == SQLT_AFC || dtype == SQLT_CLOB) { - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_CHARSET_FORM", - (param, OCI_DTYPE_PARAM, &charset_form, 0, OCI_ATTR_CHARSET_FORM, S->err)); - } - - - if (dtype) { - /* if there is a declared type */ - switch (dtype) { -#ifdef SQLT_TIMESTAMP - case SQLT_TIMESTAMP: - add_assoc_string(return_value, "oci:decl_type", "TIMESTAMP"); - add_assoc_string(return_value, "native_type", "TIMESTAMP"); - break; -#endif -#ifdef SQLT_TIMESTAMP_TZ - case SQLT_TIMESTAMP_TZ: - add_assoc_string(return_value, "oci:decl_type", "TIMESTAMP WITH TIMEZONE"); - add_assoc_string(return_value, "native_type", "TIMESTAMP WITH TIMEZONE"); - break; -#endif -#ifdef SQLT_TIMESTAMP_LTZ - case SQLT_TIMESTAMP_LTZ: - add_assoc_string(return_value, "oci:decl_type", "TIMESTAMP WITH LOCAL TIMEZONE"); - add_assoc_string(return_value, "native_type", "TIMESTAMP WITH LOCAL TIMEZONE"); - break; -#endif -#ifdef SQLT_INTERVAL_YM - case SQLT_INTERVAL_YM: - add_assoc_string(return_value, "oci:decl_type", "INTERVAL YEAR TO MONTH"); - add_assoc_string(return_value, "native_type", "INTERVAL YEAR TO MONTH"); - break; -#endif -#ifdef SQLT_INTERVAL_DS - case SQLT_INTERVAL_DS: - add_assoc_string(return_value, "oci:decl_type", "INTERVAL DAY TO SECOND"); - add_assoc_string(return_value, "native_type", "INTERVAL DAY TO SECOND"); - break; -#endif - case SQLT_DAT: - add_assoc_string(return_value, "oci:decl_type", "DATE"); - add_assoc_string(return_value, "native_type", "DATE"); - break; - case SQLT_FLT : - case SQLT_NUM: - /* if the precision is nonzero and scale is -127 then it is a FLOAT */ - if (scale == -127 && precis != 0) { - add_assoc_string(return_value, "oci:decl_type", "FLOAT"); - add_assoc_string(return_value, "native_type", "FLOAT"); - } else { - add_assoc_string(return_value, "oci:decl_type", "NUMBER"); - add_assoc_string(return_value, "native_type", "NUMBER"); - } - break; - case SQLT_LNG: - add_assoc_string(return_value, "oci:decl_type", "LONG"); - add_assoc_string(return_value, "native_type", "LONG"); - break; - case SQLT_BIN: - add_assoc_string(return_value, "oci:decl_type", "RAW"); - add_assoc_string(return_value, "native_type", "RAW"); - break; - case SQLT_LBI: - add_assoc_string(return_value, "oci:decl_type", "LONG RAW"); - add_assoc_string(return_value, "native_type", "LONG RAW"); - break; - case SQLT_CHR: - case SQLT_VCS: - if (charset_form == SQLCS_NCHAR) { - add_assoc_string(return_value, "oci:decl_type", "NVARCHAR2"); - add_assoc_string(return_value, "native_type", "NVARCHAR2"); - } else { - add_assoc_string(return_value, "oci:decl_type", "VARCHAR2"); - add_assoc_string(return_value, "native_type", "VARCHAR2"); - } - break; - case SQLT_AFC: - if (charset_form == SQLCS_NCHAR) { - add_assoc_string(return_value, "oci:decl_type", "NCHAR"); - add_assoc_string(return_value, "native_type", "NCHAR"); - } else { - add_assoc_string(return_value, "oci:decl_type", "CHAR"); - add_assoc_string(return_value, "native_type", "CHAR"); - } - break; - case SQLT_BLOB: - add_assoc_string(return_value, "oci:decl_type", "BLOB"); - add_next_index_string(&flags, "blob"); - add_assoc_string(return_value, "native_type", "BLOB"); - break; - case SQLT_CLOB: - if (charset_form == SQLCS_NCHAR) { - add_assoc_string(return_value, "oci:decl_type", "NCLOB"); - add_assoc_string(return_value, "native_type", "NCLOB"); - } else { - add_assoc_string(return_value, "oci:decl_type", "CLOB"); - add_assoc_string(return_value, "native_type", "CLOB"); - } - add_next_index_string(&flags, "blob"); - break; - case SQLT_BFILE: - add_assoc_string(return_value, "oci:decl_type", "BFILE"); - add_next_index_string(&flags, "blob"); - add_assoc_string(return_value, "native_type", "BFILE"); - break; - case SQLT_RDD: - add_assoc_string(return_value, "oci:decl_type", "ROWID"); - add_assoc_string(return_value, "native_type", "ROWID"); - break; - case SQLT_BFLOAT: - case SQLT_IBFLOAT: - add_assoc_string(return_value, "oci:decl_type", "BINARY_FLOAT"); - add_assoc_string(return_value, "native_type", "BINARY_FLOAT"); - break; - case SQLT_BDOUBLE: - case SQLT_IBDOUBLE: - add_assoc_string(return_value, "oci:decl_type", "BINARY_DOUBLE"); - add_assoc_string(return_value, "native_type", "BINARY_DOUBLE"); - break; - default: - add_assoc_long(return_value, "oci:decl_type", dtype); - add_assoc_string(return_value, "native_type", "UNKNOWN"); - } - } else { - /* if the column is NULL */ - add_assoc_long(return_value, "oci:decl_type", 0); - add_assoc_string(return_value, "native_type", "NULL"); - } - - switch (dtype) { - case SQLT_BLOB: - case SQLT_CLOB: - add_assoc_long(return_value, "pdo_type", PDO_PARAM_LOB); - break; - default: - add_assoc_long(return_value, "pdo_type", PDO_PARAM_STR); - break; - } - - /* column can be null */ - STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_IS_NULL", - (param, OCI_DTYPE_PARAM, &isnull, 0, OCI_ATTR_IS_NULL, S->err)); - - if (isnull) { - add_next_index_string(&flags, "nullable"); - } else { - add_next_index_string(&flags, "not_null"); - } - - /* PDO type */ - switch (dtype) { - case SQLT_BFILE: - case SQLT_BLOB: - case SQLT_CLOB: - add_assoc_long(return_value, "pdo_type", PDO_PARAM_LOB); - break; - default: - add_assoc_long(return_value, "pdo_type", PDO_PARAM_STR); - } - - add_assoc_long(return_value, "scale", scale); - add_assoc_zval(return_value, "flags", &flags); - - OCIDescriptorFree(param, OCI_DTYPE_PARAM); - return SUCCESS; -} /* }}} */ - -const struct pdo_stmt_methods oci_stmt_methods = { - oci_stmt_dtor, - oci_stmt_execute, - oci_stmt_fetch, - oci_stmt_describe, - oci_stmt_get_col, - oci_stmt_param_hook, - NULL, /* set_attr */ - NULL, /* get_attr */ - oci_stmt_col_meta, - NULL, - NULL -}; diff --git a/ext/pdo_oci/pdo_oci.c b/ext/pdo_oci/pdo_oci.c deleted file mode 100644 index deb73e05f296..000000000000 --- a/ext/pdo_oci/pdo_oci.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "pdo/php_pdo.h" -#include "pdo/php_pdo_driver.h" -#include "php_pdo_oci.h" -#include "php_pdo_oci_int.h" -#ifdef ZTS -#include -#endif - -/* {{{ pdo_oci_module_entry */ - -static const zend_module_dep pdo_oci_deps[] = { - ZEND_MOD_REQUIRED("pdo") - ZEND_MOD_END -}; - -zend_module_entry pdo_oci_module_entry = { - STANDARD_MODULE_HEADER_EX, NULL, - pdo_oci_deps, - "PDO_OCI", - NULL, - PHP_MINIT(pdo_oci), - PHP_MSHUTDOWN(pdo_oci), - PHP_RINIT(pdo_oci), - NULL, - PHP_MINFO(pdo_oci), - PHP_PDO_OCI_VERSION, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_PDO_OCI -ZEND_GET_MODULE(pdo_oci) -#endif - -const ub4 PDO_OCI_INIT_MODE = -#if 0 && defined(OCI_SHARED) - /* shared mode is known to be bad for PHP */ - OCI_SHARED -#else - OCI_DEFAULT -#endif -#ifdef OCI_OBJECT - |OCI_OBJECT -#endif -#ifdef ZTS - |OCI_THREADED -#endif - ; - -/* true global environment */ -OCIEnv *pdo_oci_Env = NULL; - -#ifdef ZTS -/* lock for pdo_oci_Env initialization */ -static MUTEX_T pdo_oci_env_mutex; -#endif - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(pdo_oci) -{ - REGISTER_PDO_CLASS_CONST_LONG("OCI_ATTR_ACTION", (zend_long)PDO_OCI_ATTR_ACTION); - REGISTER_PDO_CLASS_CONST_LONG("OCI_ATTR_CLIENT_INFO", (zend_long)PDO_OCI_ATTR_CLIENT_INFO); - REGISTER_PDO_CLASS_CONST_LONG("OCI_ATTR_CLIENT_IDENTIFIER", (zend_long)PDO_OCI_ATTR_CLIENT_IDENTIFIER); - REGISTER_PDO_CLASS_CONST_LONG("OCI_ATTR_MODULE", (zend_long)PDO_OCI_ATTR_MODULE); - REGISTER_PDO_CLASS_CONST_LONG("OCI_ATTR_CALL_TIMEOUT", (zend_long)PDO_OCI_ATTR_CALL_TIMEOUT); - - if (FAILURE == php_pdo_register_driver(&pdo_oci_driver)) { - return FAILURE; - } - - // Defer OCI init to PHP_RINIT_FUNCTION because with php-fpm, - // NLS_LANG is not yet available here. - -#ifdef ZTS - pdo_oci_env_mutex = tsrm_mutex_alloc(); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION */ -PHP_RINIT_FUNCTION(pdo_oci) -{ - if (!pdo_oci_Env) { -#ifdef ZTS - tsrm_mutex_lock(pdo_oci_env_mutex); - if (!pdo_oci_Env) { // double-checked locking idiom -#endif -#ifdef HAVE_OCIENVCREATE - OCIEnvCreate(&pdo_oci_Env, PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL, 0, NULL); -#else - OCIInitialize(PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL); - OCIEnvInit(&pdo_oci_Env, OCI_DEFAULT, 0, NULL); -#endif -#ifdef ZTS - } - tsrm_mutex_unlock(pdo_oci_env_mutex); -#endif - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION(pdo_oci) -{ - php_pdo_unregister_driver(&pdo_oci_driver); - - if (pdo_oci_Env) { - OCIHandleFree((dvoid*)pdo_oci_Env, OCI_HTYPE_ENV); - } - -#ifdef ZTS - tsrm_mutex_free(pdo_oci_env_mutex); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION */ -PHP_MINFO_FUNCTION(pdo_oci) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "PDO Driver for OCI 8 and later", "enabled"); - php_info_print_table_end(); -} -/* }}} */ diff --git a/ext/pdo_oci/php_pdo_oci.h b/ext/pdo_oci/php_pdo_oci.h deleted file mode 100644 index 6b0c7b7c2ea8..000000000000 --- a/ext/pdo_oci/php_pdo_oci.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_PDO_OCI_H -#define PHP_PDO_OCI_H - -extern zend_module_entry pdo_oci_module_entry; -#define phpext_pdo_oci_ptr &pdo_oci_module_entry - -#include "php_version.h" -#define PHP_PDO_OCI_VERSION PHP_VERSION - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(pdo_oci); -PHP_MSHUTDOWN_FUNCTION(pdo_oci); -PHP_RINIT_FUNCTION(pdo_oci); -PHP_RSHUTDOWN_FUNCTION(pdo_oci); -PHP_MINFO_FUNCTION(pdo_oci); - -#endif /* PHP_PDO_OCI_H */ diff --git a/ext/pdo_oci/php_pdo_oci_int.h b/ext/pdo_oci/php_pdo_oci_int.h deleted file mode 100644 index dd513ff94e06..000000000000 --- a/ext/pdo_oci/php_pdo_oci_int.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_PDO_OCI_INT_H -#define PHP_PDO_OCI_INT_H - -#include "zend_portability.h" - -ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes") -#include -ZEND_DIAGNOSTIC_IGNORED_END - -typedef struct { - const char *file; - int line; - sb4 errcode; - char *errmsg; -} pdo_oci_error_info; - -/* stuff we use in an OCI database handle */ -typedef struct { - OCIServer *server; - OCISession *session; - OCIEnv *env; - OCIError *err; - OCISvcCtx *svc; - /* OCI9; 0 == use NLS_LANG */ - ub4 prefetch; - ub2 charset; - sword last_err; - sb4 max_char_width; - - unsigned attached:1; - unsigned _reserved:31; - - pdo_oci_error_info einfo; -} pdo_oci_db_handle; - -typedef struct { - OCIDefine *def; - ub2 fetched_len; - ub2 retcode; - sb2 indicator; - - char *data; - ub4 datalen; - - ub2 dtype; - -} pdo_oci_column; - -typedef struct { - pdo_oci_db_handle *H; - OCIStmt *stmt; - OCIError *err; - sword last_err; - ub2 stmt_type; - ub4 exec_type; - pdo_oci_column *cols; - pdo_oci_error_info einfo; - unsigned int have_blobs:1; -} pdo_oci_stmt; - -typedef struct { - OCIBind *bind; /* allocated by OCI */ - sb2 oci_type; - sb2 indicator; - ub2 retcode; - - ub4 actual_len; - - dvoid *thing; /* for LOBS, REFCURSORS etc. */ - - unsigned used_for_output; -} pdo_oci_bound_param; - -extern const ub4 PDO_OCI_INIT_MODE; -extern const pdo_driver_t pdo_oci_driver; -extern OCIEnv *pdo_oci_Env; - -ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line); -#define oci_init_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, TRUE, __FILE__, __LINE__) -#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, FALSE, __FILE__, __LINE__) -#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w, S->last_err, FALSE, __FILE__, __LINE__) - -extern const struct pdo_stmt_methods oci_stmt_methods; - -/* Default prefetch size in number of rows */ -#define PDO_OCI_PREFETCH_DEFAULT 100 - -/* Arbitrary assumed row length for prefetch memory limit calcuation */ -#define PDO_OCI_PREFETCH_ROWSIZE 1024 - - -enum { - PDO_OCI_ATTR_ACTION = PDO_ATTR_DRIVER_SPECIFIC, - PDO_OCI_ATTR_CLIENT_INFO, - PDO_OCI_ATTR_CLIENT_IDENTIFIER, - PDO_OCI_ATTR_MODULE, - PDO_OCI_ATTR_CALL_TIMEOUT -}; - -#endif /* PHP_PDO_OCI_INT_H */ diff --git a/ext/pdo_oci/tests/bug41996.phpt b/ext/pdo_oci/tests/bug41996.phpt deleted file mode 100644 index cb4fa24d12a9..000000000000 --- a/ext/pdo_oci/tests/bug41996.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -PDO OCI Bug #41996 (Problem accessing Oracle ROWID) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -prepare('SELECT rowid FROM dual'); -$stmt->execute(); -$row = $stmt->fetch(); -var_dump(strlen($row[0]) > 0); -?> ---EXPECT-- -bool(true) diff --git a/ext/pdo_oci/tests/bug44301.phpt b/ext/pdo_oci/tests/bug44301.phpt deleted file mode 100644 index 32b1190ed58f..000000000000 --- a/ext/pdo_oci/tests/bug44301.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -PDO OCI Bug #44301 (Segfault when an exception is thrown on persistent connections) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- - true))); -require 'ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory('ext/pdo_oci/tests/common.phpt'); -$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -try { - $stmt = $db->prepare('SELECT * FROM no_table'); - $stmt->execute(); -} catch (PDOException $e) { - print $e->getMessage(); -} -$db = null; -?> ---EXPECTF-- -SQLSTATE[HY000]: General error: 942 OCIStmtExecute: ORA-00942: table or view does not exist - (%s%epdo_oci%eoci_statement.c:%d) diff --git a/ext/pdo_oci/tests/bug46274.phpt b/ext/pdo_oci/tests/bug46274.phpt deleted file mode 100644 index db32de195ab5..000000000000 --- a/ext/pdo_oci/tests/bug46274.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -Bug #46274 (pdo_pgsql - Segfault when using PDO::ATTR_STRINGIFY_FETCHES and blob) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); - -$db->beginTransaction(); - -$db->query('CREATE TABLE test46274 (id INT NOT NULL, blob1 BLOB)'); - -$stmt = $db->prepare("INSERT INTO test46274 (id, blob1) VALUES (:id, EMPTY_BLOB()) RETURNING blob1 INTO :foo"); - -$data = 'foo'; -$blob = fopen('php://memory', 'a'); -fwrite($blob, $data); -rewind($blob); - -$id = 1; -$stmt->bindparam(':id', $id); -$stmt->bindparam(':foo', $blob, PDO::PARAM_LOB); -$stmt->execute(); - -$data = ''; -$blob = fopen('php://memory', 'a'); -fwrite($blob, $data); -rewind($blob); - -$id = 1; -$stmt->bindparam(':id', $id); -$stmt->bindparam(':foo', $blob, PDO::PARAM_LOB); -$stmt->execute(); - -$res = $db->query("SELECT blob1 from test46274"); -// Resource -var_dump($res->fetch()); - -// Empty string -var_dump($res->fetch()); -?> ---CLEAN-- - ---EXPECT-- -array(2) { - ["blob1"]=> - string(3) "foo" - [0]=> - string(3) "foo" -} -array(2) { - ["blob1"]=> - string(0) "" - [0]=> - string(0) "" -} diff --git a/ext/pdo_oci/tests/bug46274_2.phpt b/ext/pdo_oci/tests/bug46274_2.phpt deleted file mode 100644 index 070df29a0a8f..000000000000 --- a/ext/pdo_oci/tests/bug46274_2.phpt +++ /dev/null @@ -1,77 +0,0 @@ ---TEST-- -Bug #46274 (pdo_pgsql - Segfault when using PDO::ATTR_STRINGIFY_FETCHES and blob) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); - -$db->beginTransaction(); - -$db->query('CREATE TABLE test46274_2 (id INT NOT NULL, blob1 BLOB)'); - -$stmt = $db->prepare("INSERT INTO test46274_2 (id, blob1) VALUES (:id, EMPTY_BLOB()) RETURNING blob1 INTO :foo"); - -$data = 'foo'; -$blob = fopen('php://memory', 'a'); -fwrite($blob, $data); -rewind($blob); - -$id = 1; -$stmt->bindparam(':id', $id); -$stmt->bindparam(':foo', $blob, PDO::PARAM_LOB); -$stmt->execute(); - -$data = ''; -$blob = fopen('php://memory', 'a'); -fwrite($blob, $data); -rewind($blob); - -$id = 1; -$stmt->bindparam(':id', $id); -$stmt->bindparam(':foo', $blob, PDO::PARAM_LOB); -$stmt->execute(); - -$res = $db->query("SELECT blob1 from test46274_2"); -// Resource -var_dump($row = $res->fetch()); -var_dump(fread($row[0], 1024)); -fclose($row[0]); - -// Empty string -var_dump($row = $res->fetch()); -var_dump(fread($row[0], 1024)); -fclose($row[0]); - -?> ---CLEAN-- - ---EXPECTF-- -array(2) { - ["blob1"]=> - resource(%d) of type (stream) - [0]=> - resource(%d) of type (stream) -} -string(3) "foo" -array(2) { - ["blob1"]=> - resource(%d) of type (stream) - [0]=> - resource(%d) of type (stream) -} -string(0) "" diff --git a/ext/pdo_oci/tests/bug54379.phpt b/ext/pdo_oci/tests/bug54379.phpt deleted file mode 100644 index a17ac63d5e11..000000000000 --- a/ext/pdo_oci/tests/bug54379.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Bug #54379 (PDO_OCI: UTF-8 output gets truncated) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -$db->exec("CREATE TABLE test54379 (col1 NVARCHAR2(20))"); -$db->exec("INSERT INTO test54379 VALUES('12345678901234567890')"); -$db->exec("INSERT INTO test54379 VALUES('あいうえおかきくけこさしすせそたちつてと')"); -$stmt = $db->prepare("SELECT * FROM test54379"); -$stmt->execute(); -var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); -?> ---CLEAN-- - ---EXPECT-- -array(2) { - [0]=> - array(1) { - ["col1"]=> - string(20) "12345678901234567890" - } - [1]=> - array(1) { - ["col1"]=> - string(60) "あいうえおかきくけこさしすせそたちつてと" - } -} diff --git a/ext/pdo_oci/tests/bug57702.phpt b/ext/pdo_oci/tests/bug57702.phpt deleted file mode 100644 index f972bdca7d45..000000000000 --- a/ext/pdo_oci/tests/bug57702.phpt +++ /dev/null @@ -1,184 +0,0 @@ ---TEST-- -PDO OCI Bug #57702 (Multi-row BLOB fetches) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -prepare($query); -$stmt->execute(); - -function do_insert($db, $id, $data1, $data2) -{ - $db->beginTransaction(); - $stmt = $db->prepare("insert into test57702 (id, data1, data2) values (:id, empty_blob(), empty_blob()) returning data1, data2 into :blob1, :blob2"); - $stmt->bindParam(':id', $id); - $stmt->bindParam(':blob1', $blob1, PDO::PARAM_LOB); - $stmt->bindParam(':blob2', $blob2, PDO::PARAM_LOB); - $blob1 = null; - $blob2 = null; - $stmt->execute(); - - fwrite($blob1, $data1); - fclose($blob1); - fwrite($blob2, $data2); - fclose($blob2); - $db->commit(); -} - -do_insert($db, 1, "row 1 col 1", "row 1 col 2"); -do_insert($db, 2, "row 2 col 1", "row 2 col 2"); - -//////////////////// - -echo "First Query\n"; - -// Fetch it back -$stmt = $db->prepare('select data1, data2 from test57702 order by id'); -$stmt->execute(); -$row = $stmt->fetch(PDO::FETCH_ASSOC); -var_dump($row['data1']); -var_dump($row['data2']); -$row = $stmt->fetch(PDO::FETCH_ASSOC); -var_dump($row['data1']); -var_dump($row['data2']); - -//////////////////// - -echo "\nSecond Query\n"; - -foreach($db->query("select data1 as d1, data2 as d2 from test57702 order by id") as $row) { - var_dump($row['d1']); - var_dump($row['d2']); -} - -//////////////////// - -echo "\nThird Query\n"; - -$stmt = $db->prepare('select data1 as d3_1, data2 as d3_2 from test57702 order by id'); - -$rs = $stmt->execute(); -$stmt->bindColumn('d3_1' , $clob1, PDO::PARAM_LOB); -$stmt->bindColumn('d3_2' , $clob2, PDO::PARAM_LOB); - -while ($stmt->fetch(PDO::FETCH_BOUND)) { - var_dump($clob1); - var_dump($clob2); -} - -//////////////////// - -echo "\nFourth Query\n"; - -$a = array(); -$i = 0; -foreach($db->query("select data1 as d4_1, data2 as d4_2 from test57702 order by id") as $row) { - $a[$i][0] = $row['d4_1']; - $a[$i][1] = $row['d4_2']; - $i++; -} - -for ($i = 0; $i < count($a); $i++) { - var_dump($a[$i][0]); - var_dump($a[$i][1]); -} - -//////////////////// - -echo "\nFifth Query\n"; - -$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); // Let's use streams - -// Since each column only has one lob descriptor, the last row is -// shown twice because the lob descriptor for each column is reused in -// the stream - -$a = array(); -$i = 0; -foreach($db->query("select data1 as d4_1, data2 as d4_2 from test57702 order by id") as $row) { - $a[$i][0] = $row['d4_1']; - $a[$i][1] = $row['d4_2']; - $i++; -} - -for ($i = 0; $i < count($a); $i++) { - var_dump(stream_get_contents($a[$i][0])); - var_dump(stream_get_contents($a[$i][1])); -} - -//////////////////// - -echo "\nSixth Query\n"; - -$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); // Let's use streams - -$a = array(); -$i = 0; -foreach($db->query("select data1 as d4_1, data2 as d4_2 from test57702 order by id") as $row) { - $a[$i][0] = $row['d4_1']; - $a[$i][1] = $row['d4_2']; - var_dump(stream_get_contents($a[$i][0])); - var_dump(stream_get_contents($a[$i][1])); - $i++; -} - -print "done\n"; - -?> ---CLEAN-- - ---EXPECT-- -First Query -string(11) "row 1 col 1" -string(11) "row 1 col 2" -string(11) "row 2 col 1" -string(11) "row 2 col 2" - -Second Query -string(11) "row 1 col 1" -string(11) "row 1 col 2" -string(11) "row 2 col 1" -string(11) "row 2 col 2" - -Third Query -string(11) "row 1 col 1" -string(11) "row 1 col 2" -string(11) "row 2 col 1" -string(11) "row 2 col 2" - -Fourth Query -string(11) "row 1 col 1" -string(11) "row 1 col 2" -string(11) "row 2 col 1" -string(11) "row 2 col 2" - -Fifth Query -string(11) "row 2 col 1" -string(11) "row 2 col 2" -string(11) "row 2 col 1" -string(11) "row 2 col 2" - -Sixth Query -string(11) "row 1 col 1" -string(11) "row 1 col 2" -string(11) "row 2 col 1" -string(11) "row 2 col 2" -done diff --git a/ext/pdo_oci/tests/bug60994.phpt b/ext/pdo_oci/tests/bug60994.phpt deleted file mode 100644 index 14ebae69d621..000000000000 --- a/ext/pdo_oci/tests/bug60994.phpt +++ /dev/null @@ -1,140 +0,0 @@ ---TEST-- -PDO OCI Bug #60994 (Reading a multibyte CLOB caps at 8192 characters) ---CREDITS-- -Chuck Burgess -ashnazg@php.net ---EXTENSIONS-- -mbstring -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL); -$dbh->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); - -$dbh->exec('CREATE TABLE pdo_oci_bug60994 (id NUMBER, data CLOB, data2 NCLOB)'); - -$id = null; -$insert = $dbh->prepare('INSERT INTO pdo_oci_bug60994 (id, data, data2) VALUES (:id, :data, :data2)'); -$insert->bindParam(':id', $id, \PDO::PARAM_STR); -$select = $dbh->prepare("SELECT data, data2 FROM pdo_oci_bug60994 WHERE id = :id"); - - -echo PHP_EOL, 'Test 1: j', PHP_EOL; -$string1 = 'abc' . str_repeat('j', 8187) . 'xyz'; // 8193 chars total works fine here (even 1 million works fine, subject to memory_limit) -$id = 1; -$insert->bindParam(':data', $string1, \PDO::PARAM_STR, strlen($string1)); // length in bytes -$insert->bindParam(':data2', $string1, \PDO::PARAM_STR, strlen($string1)); -$insert->execute(); -$select->bindParam(':id', $id, \PDO::PARAM_STR); -$select->execute(); -$row = $select->fetch(); -$stream1 = stream_get_contents($row['DATA']); -$start1 = mb_substr($stream1, 0, 10); -$ending1 = mb_substr($stream1, -10); -echo 'size of string1 is ', strlen($string1), ' bytes, ', mb_strlen($string1), ' chars.', PHP_EOL; -echo 'size of stream1 is ', strlen($stream1), ' bytes, ', mb_strlen($stream1), ' chars.', PHP_EOL; -echo 'beg of stream1 is ', $start1, PHP_EOL; -echo 'end of stream1 is ', $ending1, PHP_EOL; -if ($string1 != $stream1 || $stream1 != stream_get_contents($row['DATA2'])) { - echo 'Expected nclob value to match clob value for stream1', PHP_EOL; -} - -echo PHP_EOL, 'Test 2: £', PHP_EOL; -$string2 = 'abc' . str_repeat('£', 8187) . 'xyz'; // 8193 chars total is when it breaks -$id = 2; -$insert->bindParam(':data', $string2, \PDO::PARAM_STR, strlen($string2)); // length in bytes -$insert->bindParam(':data2', $string2, \PDO::PARAM_STR, strlen($string2)); -$insert->execute(); -$select->bindParam(':id', $id, \PDO::PARAM_STR); -$select->execute(); -$row = $select->fetch(); -$stream2 = stream_get_contents($row['DATA']); -$start2 = mb_substr($stream2, 0, 10); -$ending2 = mb_substr($stream2, -10); -echo 'size of string2 is ', strlen($string2), ' bytes, ', mb_strlen($string2), ' chars.', PHP_EOL; -echo 'size of stream2 is ', strlen($stream2), ' bytes, ', mb_strlen($stream2), ' chars.', PHP_EOL; -echo 'beg of stream2 is ', $start2, PHP_EOL; -echo 'end of stream2 is ', $ending2, PHP_EOL; -if ($string2 != $stream2 || $stream2 != stream_get_contents($row['DATA2'])) { - echo 'Expected nclob value to match clob value for stream2', PHP_EOL; -} - -echo PHP_EOL, 'Test 3: Җ', PHP_EOL; -$string3 = 'abc' . str_repeat('Җ', 8187) . 'xyz'; // 8193 chars total is when it breaks -$id = 3; -$insert->bindParam(':data', $string3, \PDO::PARAM_STR, strlen($string3)); // length in bytes -$insert->bindParam(':data2', $string3, \PDO::PARAM_STR, strlen($string3)); -$insert->execute(); -$select->bindParam(':id', $id, \PDO::PARAM_STR); -$select->execute(); -$row = $select->fetch(); -$stream3 = stream_get_contents($row['DATA']); -$start3 = mb_substr($stream3, 0, 10); -$ending3 = mb_substr($stream3, -10); -echo 'size of string3 is ', strlen($string3), ' bytes, ', mb_strlen($string3), ' chars.', PHP_EOL; -echo 'size of stream3 is ', strlen($stream3), ' bytes, ', mb_strlen($stream3), ' chars.', PHP_EOL; -echo 'beg of stream3 is ', $start3, PHP_EOL; -echo 'end of stream3 is ', $ending3, PHP_EOL; -if ($string3 != $stream3 || $stream3 != stream_get_contents($row['DATA2'])) { - echo 'Expected nclob value to match clob value for stream3', PHP_EOL; -} - -echo PHP_EOL, 'Test 4: の', PHP_EOL; -$string4 = 'abc' . str_repeat('の', 8187) . 'xyz'; // 8193 chars total is when it breaks -$id = 4; -$insert->bindParam(':data', $string4, \PDO::PARAM_STR, strlen($string4)); // length in bytes -$insert->bindParam(':data2', $string4, \PDO::PARAM_STR, strlen($string4)); -$insert->execute(); -$select->bindParam(':id', $id, \PDO::PARAM_STR); -$select->execute(); -$row = $select->fetch(); -$stream4 = stream_get_contents($row['DATA']); -$start4 = mb_substr($stream4, 0, 10); -$ending4 = mb_substr($stream4, -10); -echo 'size of string4 is ', strlen($string4), ' bytes, ', mb_strlen($string4), ' chars.', PHP_EOL; -echo 'size of stream4 is ', strlen($stream4), ' bytes, ', mb_strlen($stream4), ' chars.', PHP_EOL; -echo 'beg of stream4 is ', $start4, PHP_EOL; -echo 'end of stream4 is ', $ending4, PHP_EOL; -if ($string4 != $stream4 || $stream4 != stream_get_contents($row['DATA2'])) { - echo 'Expected nclob value to match clob value for stream4', PHP_EOL; -} -?> ---CLEAN-- - ---EXPECT-- -Test 1: j -size of string1 is 8193 bytes, 8193 chars. -size of stream1 is 8193 bytes, 8193 chars. -beg of stream1 is abcjjjjjjj -end of stream1 is jjjjjjjxyz - -Test 2: £ -size of string2 is 16380 bytes, 8193 chars. -size of stream2 is 16380 bytes, 8193 chars. -beg of stream2 is abc£££££££ -end of stream2 is £££££££xyz - -Test 3: Җ -size of string3 is 16380 bytes, 8193 chars. -size of stream3 is 16380 bytes, 8193 chars. -beg of stream3 is abcҖҖҖҖҖҖҖ -end of stream3 is ҖҖҖҖҖҖҖxyz - -Test 4: の -size of string4 is 24567 bytes, 8193 chars. -size of stream4 is 24567 bytes, 8193 chars. -beg of stream4 is abcののののののの -end of stream4 is のののののののxyz diff --git a/ext/pdo_oci/tests/bug_33707.phpt b/ext/pdo_oci/tests/bug_33707.phpt deleted file mode 100644 index c727bd598a72..000000000000 --- a/ext/pdo_oci/tests/bug_33707.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -PDO OCI Bug #33707 (Errors in select statements not reported) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); - -$rs = $db->query('select blah from a_table_that_does_not_exist'); -var_dump($rs); -var_dump($db->errorInfo()); -?> ---EXPECTF-- -bool(false) -array(3) { - [0]=> - string(5) "HY000" - [1]=> - int(942) - [2]=> - string(%d) "OCIStmtExecute: ORA-00942: table or view does not exist - (%s:%d)" -} diff --git a/ext/pdo_oci/tests/checkliveness.phpt b/ext/pdo_oci/tests/checkliveness.phpt deleted file mode 100644 index 3c2790ccd930..000000000000 --- a/ext/pdo_oci/tests/checkliveness.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -PDO OCI checkliveness (code coverage) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- - true)); -} -catch (PDOException $e) { - echo 'Connection failed: ' . $e->getMessage(); - exit; -} - -// This triggers the call to check liveness -try { - $db = new PDO($dsn, $user, $pass, array(PDO::ATTR_PERSISTENT => true)); -} -catch (PDOException $e) { - echo 'Connection failed: ' . $e->getMessage(); - exit; -} - -$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); - -try { - $stmt = $db->prepare('SELECT * FROM dual'); - $stmt->execute(); - $row = $stmt->fetch(); - var_dump($row); -} catch (PDOException $e) { - print $e->getMessage(); -} - -$db = null; -?> ---EXPECT-- -array(2) { - ["DUMMY"]=> - string(1) "X" - [0]=> - string(1) "X" -} diff --git a/ext/pdo_oci/tests/common.phpt b/ext/pdo_oci/tests/common.phpt deleted file mode 100644 index 246e80765b50..000000000000 --- a/ext/pdo_oci/tests/common.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -OCI ---EXTENSIONS-- -pdo_oci ---REDIRECTTEST-- -# magic auto-configuration - -$config = array( - 'TESTS' => 'ext/pdo/tests' -); - - -if (false !== getenv('PDO_OCI_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_OCI_TEST_DSN'); - $config['ENV']['PDOTEST_USER'] = getenv('PDO_OCI_TEST_USER'); - $config['ENV']['PDOTEST_PASS'] = getenv('PDO_OCI_TEST_PASS'); - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_OCI_TEST_ATTR'); -} else { - $config['ENV']['PDOTEST_DSN'] = 'oci:dbname=localhost/xe;charset=WE8MSWIN1252'; - $config['ENV']['PDOTEST_USER'] = 'SYSTEM'; - $config['ENV']['PDOTEST_PASS'] = 'oracle'; -} - -return $config; diff --git a/ext/pdo_oci/tests/oci_success_with_info.phpt b/ext/pdo_oci/tests/oci_success_with_info.phpt deleted file mode 100644 index 1c56a66a4a74..000000000000 --- a/ext/pdo_oci/tests/oci_success_with_info.phpt +++ /dev/null @@ -1,121 +0,0 @@ ---TEST-- -Handling OCI_SUCCESS_WITH_INFO ---EXTENSIONS-- -pdo -pdo_oci ---XFAIL-- -This test frequently fails in CI ---SKIPIF-- - ---FILE-- -exec(<<<'SQL' -BEGIN - EXECUTE IMMEDIATE 'DROP PROFILE BUG77120_PROFILE CASCADE'; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE != -2380 THEN - RAISE; - END IF; -END; -SQL - ); -} - -function dropUser(PDO $conn): void { - $conn->exec(<<<'SQL' -BEGIN - EXECUTE IMMEDIATE 'DROP USER BUG77120_USER CASCADE'; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE != -1918 THEN - RAISE; - END IF; -END; -SQL - ); -} - -function triggerCompilationError(PDO $conn): void { - $conn->exec(<<<'SQL' -CREATE OR REPLACE FUNCTION BUG77120(INT A) RETURN INT -AS -BEGIN - RETURN 0; -END; -SQL - ); -} - -require __DIR__ . '/../../pdo/tests/pdo_test.inc'; - -$conn = connectAsAdmin(); - -dropUser($conn); -dropProfile($conn); - -$password = bin2hex(random_bytes(8)); - -$conn->exec('CREATE PROFILE BUG77120_PROFILE LIMIT PASSWORD_LIFE_TIME 1/86400 PASSWORD_GRACE_TIME 1'); -$conn->exec('CREATE USER BUG77120_USER IDENTIFIED BY "' . $password . '" PROFILE BUG77120_PROFILE'); -$conn->exec('GRANT CREATE SESSION TO BUG77120_USER'); - -// let the password expire -sleep(3); // 2 seconds is causing random test failures - -$conn = connectAsUser('BUG77120_USER', $password); -var_dump($conn->errorInfo()); - -$conn = connectAsAdmin(); -dropUser($conn); -dropProfile($conn); - -$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); -triggerCompilationError($conn); -var_dump($conn->errorInfo()); - -$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); -triggerCompilationError($conn); -var_dump($conn->errorInfo()); - -?> ---EXPECTF-- -array(3) { - [0]=> - string(5) "HY000" - [1]=> - int(28002) - [2]=> - string(%d) "OCISessionBegin: OCI_SUCCESS_WITH_INFO: ORA-28002: %s - (%s:%d)" -} -array(3) { - [0]=> - string(5) "HY000" - [1]=> - int(24344) - [2]=> - string(%d) "OCIStmtExecute: OCI_SUCCESS_WITH_INFO: ORA-24344: %s - (%s:%d)" -} -array(3) { - [0]=> - string(5) "HY000" - [1]=> - int(24344) - [2]=> - string(%d) "OCIStmtExecute: OCI_SUCCESS_WITH_INFO: ORA-24344: %s - (%s:%d)" -} diff --git a/ext/pdo_oci/tests/pdo_oci_attr_action.phpt b/ext/pdo_oci/tests/pdo_oci_attr_action.phpt deleted file mode 100644 index c272542c1828..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_action.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Setting session action ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -query($query); -$row = $stmt->fetch(); -echo 'ACTION NOT SET: '; -var_dump($row['action']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_ACTION, "some action")); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'ACTION SET: '; -var_dump($row['action']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_ACTION, "something else!")); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'ACTION RESET: '; -var_dump($row['action']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_ACTION, null)); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'ACTION NULLED: '; -var_dump($row['action']); - -echo "Done\n"; - -?> ---EXPECT-- -ACTION NOT SET: NULL -bool(true) -ACTION SET: string(11) "some action" -bool(true) -ACTION RESET: string(15) "something else!" -bool(true) -ACTION NULLED: NULL -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_autocommit_1.phpt b/ext/pdo_oci/tests/pdo_oci_attr_autocommit_1.phpt deleted file mode 100644 index 8aca1c95a8c1..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_autocommit_1.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Basic autocommit functionality ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -print "PDO::ATTR_AUTOCOMMIT: Default: "; -var_dump($dbh->getAttribute(PDO::ATTR_AUTOCOMMIT)); - -echo "Change setting to false - "; - -$dbh->setAttribute(PDO::ATTR_AUTOCOMMIT, false); - -print "PDO::ATTR_AUTOCOMMIT: "; -var_dump($dbh->getAttribute(PDO::ATTR_AUTOCOMMIT)); - -echo "Change setting back to true - "; - -$dbh->setAttribute(PDO::ATTR_AUTOCOMMIT, true); - -print "PDO::ATTR_AUTOCOMMIT: "; -var_dump($dbh->getAttribute(PDO::ATTR_AUTOCOMMIT)); - -// Use 2nd connection to check that autocommit does commit - -echo "Insert data\n"; -$dbh->exec("create table test_pdo_oci_attr_autocommit_1 (col1 varchar2(20))"); -$dbh->exec("insert into test_pdo_oci_attr_autocommit_1 (col1) values ('some data')"); - -$dbh2 = PDOTest::factory(); - -echo "Second connection should be able to see committed data\n"; -$s = $dbh2->prepare("select col1 from test_pdo_oci_attr_autocommit_1"); -$s->execute(); -while ($r = $s->fetch()) { - echo "Data is: " . $r[0] . "\n"; -} - -echo "Done\n"; - -?> ---CLEAN-- - ---EXPECT-- -PDO::ATTR_AUTOCOMMIT: Default: bool(true) -Change setting to false - PDO::ATTR_AUTOCOMMIT: bool(false) -Change setting back to true - PDO::ATTR_AUTOCOMMIT: bool(true) -Insert data -Second connection should be able to see committed data -Data is: some data -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_autocommit_2.phpt b/ext/pdo_oci/tests/pdo_oci_attr_autocommit_2.phpt deleted file mode 100644 index 54272e62e646..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_autocommit_2.phpt +++ /dev/null @@ -1,133 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: beginTransaction and native transactions ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -$dbh->exec("create table test_pdo_oci_attr_autocommit_2 (col1 varchar2(25))"); - -echo "Test 1 Check beginTransaction insertion\n"; - -$dbh->beginTransaction(); -try { - $dbh->exec("insert into test_pdo_oci_attr_autocommit_2 (col1) values ('data 1')"); - $dbh->exec("insert into test_pdo_oci_attr_autocommit_2 (col1) values ('data 2')"); - $dbh->commit(); -} -catch (PDOException $e) { - echo "Caught unexpected exception at line " . __LINE__ . "\n"; - echo $e->getMessage() . "\n"; - $dbh->rollback(); -} - -echo "Test 2 Cause an exception and test beginTransaction rollback\n"; - -$dbh->beginTransaction(); -try { - $dbh->exec("insert into test_pdo_oci_attr_autocommit_2 (col1) values ('not committed #1')"); - $dbh->exec("insert into test_pdo_oci_attr_autocommit_2 (col1) values ('data that is too long to fit and will barf')"); - $dbh->commit(); -} -catch (PDOException $e) { - echo "Caught expected exception at line " . __LINE__ . "\n"; - echo $e->getMessage() . "\n"; - $dbh->rollback(); -} - -echo "Test 3 Setting ATTR_AUTOCOMMIT to true will commit and end the transaction\n"; - -$dbh->exec("insert into test_pdo_oci_attr_autocommit_2 (col1) values ('data 3')"); -$dbh->setAttribute(PDO::ATTR_AUTOCOMMIT, true); -print "PDO::ATTR_AUTOCOMMIT: "; -var_dump($dbh->getAttribute(PDO::ATTR_AUTOCOMMIT)); -try { - $dbh->rollback(); -} -catch (PDOException $e) { - echo "Caught expected exception at line " . __LINE__ . "\n"; - echo $e->getMessage() . "\n"; -} - -echo "Test 4 Setting ATTR_AUTOCOMMIT to false will commit and end the transaction\n"; - -$dbh->beginTransaction(); -$dbh->exec("insert into test_pdo_oci_attr_autocommit_2 (col1) values ('data 4')"); -$dbh->setAttribute(PDO::ATTR_AUTOCOMMIT, false); -print "PDO::ATTR_AUTOCOMMIT: "; -var_dump($dbh->getAttribute(PDO::ATTR_AUTOCOMMIT)); -try { - $dbh->rollback(); -} -catch (PDOException $e) { - echo "Caught expected exception at line " . __LINE__ . "\n"; - echo $e->getMessage() . "\n"; -} - -echo "Test 5 Handle transactions ourselves\n"; - -print "PDO::ATTR_AUTOCOMMIT: "; -var_dump($dbh->getAttribute(PDO::ATTR_AUTOCOMMIT)); - -$dbh->exec("insert into test_pdo_oci_attr_autocommit_2 (col1) values ('not committed #2')"); -$dbh->exec("rollback"); -$dbh->exec("insert into test_pdo_oci_attr_autocommit_2 (col1) values ('data 5')"); -$dbh->exec("insert into test_pdo_oci_attr_autocommit_2 (col1) values ('data 6')"); - -$dbh->exec("commit"); - -// Open new connection to really verify what was inserted - -$dbh2 = PDOTest::factory(); - -echo "Query Results are:\n"; -$s = $dbh2->prepare("select col1 from test_pdo_oci_attr_autocommit_2"); -$s->execute(); -while ($r = $s->fetch()) { - echo $r[0] . "\n"; -} - -echo "Done\n"; - -?> ---CLEAN-- - ---EXPECTF-- -Test 1 Check beginTransaction insertion -Test 2 Cause an exception and test beginTransaction rollback -Caught expected exception at line 33 -SQLSTATE[HY000]: General error: 12899 OCIStmtExecute: ORA-12899: %s -%s -Test 3 Setting ATTR_AUTOCOMMIT to true will commit and end the transaction -PDO::ATTR_AUTOCOMMIT: bool(true) -Caught expected exception at line %d -There is no active transaction -Test 4 Setting ATTR_AUTOCOMMIT to false will commit and end the transaction -PDO::ATTR_AUTOCOMMIT: bool(false) -Caught expected exception at line %d -There is no active transaction -Test 5 Handle transactions ourselves -PDO::ATTR_AUTOCOMMIT: bool(false) -Query Results are: -data 1 -data 2 -data 3 -data 4 -data 5 -data 6 -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt b/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt deleted file mode 100644 index 52629f54b3b5..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: closing a connection in non-autocommit mode commits data ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -false))); -$dbh = PDOTest::factory(); - -$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -print "PDO::ATTR_AUTOCOMMIT: "; -var_dump($dbh->getAttribute(PDO::ATTR_AUTOCOMMIT)); - -echo "Insert data\n"; - -$dbh->exec("create table test_pdo_oci_attr_autocommit_3 (col1 varchar2(20))"); - -$dbh->exec("insert into test_pdo_oci_attr_autocommit_3 (col1) values ('some data')"); - -$dbh = null; // close first connection - -echo "Second connection should be able to see committed data\n"; -$dbh2 = PDOTest::factory(); -$s = $dbh2->prepare("select col1 from test_pdo_oci_attr_autocommit_3"); -$s->execute(); -while ($r = $s->fetch()) { - echo "Data is: " . $r[0] . "\n"; -} - -echo "Done\n"; - -?> ---CLEAN-- - ---EXPECT-- -PDO::ATTR_AUTOCOMMIT: bool(false) -Insert data -Second connection should be able to see committed data -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_call_timeout.phpt b/ext/pdo_oci/tests/pdo_oci_attr_call_timeout.phpt deleted file mode 100644 index af9e9ff11a13..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_call_timeout.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Setting and using call timeout ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- -getAttribute(PDO::ATTR_CLIENT_VERSION), $matches); -if (!(isset($matches[0]) && $matches[0] >= 18)) { - die("skip works only with Oracle 18c or greater version of Oracle client libraries"); -} - -?> ---FILE-- -prepare("begin dbms_lock.sleep(:t); end;"); - - if (!$stmt) { - $error = $dbh->errorInfo(); - echo "Prepare error was ", $error[2], "\n"; - return; - } - $stmt->bindParam(":t", $t, PDO::PARAM_INT); - - $r = $stmt->execute(); - if ($r) { - echo "Execute succeeded\n"; - } else { - $error = $dbh->errorInfo(); - echo "Execute error was ", $error[2], "\n"; - } -} - -$dbh = PDOTest::factory(); -$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); - -echo "Test 1\n"; - -$dbh->setAttribute(PDO::OCI_ATTR_CALL_TIMEOUT, 4000); // milliseconds - -echo "call timeout:\n"; -var_dump($dbh->getAttribute(PDO::OCI_ATTR_CALL_TIMEOUT)); - -$r = mysleep($dbh, 8); // seconds - -?> -===DONE=== - ---EXPECTF-- -Test 1 -call timeout: -int(4000) -Execute error was OCIStmtExecute: ORA-%r(03136|03156)%r: %s - (%s:%d) -===DONE=== diff --git a/ext/pdo_oci/tests/pdo_oci_attr_case.phpt b/ext/pdo_oci/tests/pdo_oci_attr_case.phpt deleted file mode 100644 index 35b38b7650fc..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_case.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Column Case ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -getAttribute(PDO::ATTR_CASE)); - $s = $dbh->prepare("select dummy from dual"); - $s->execute(); - while ($r = $s->fetch(PDO::FETCH_ASSOC)) { - var_dump($r); - } -} - -function do_query2($dbh, $mode) -{ - echo "Mode desired is $mode\n"; - $s = $dbh->prepare("select dummy from dual", array(PDO::ATTR_CASE, $mode)); - $s->execute(); - while ($r = $s->fetch(PDO::FETCH_ASSOC)) { - var_dump($r); - } -} - -$dbh = PDOTest::factory(); -$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -echo "Test 1 - Force column names to lower case\n"; -$dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); -do_query1($dbh); - -echo "Test 2 - Leave column names as returned by the database driver\n"; -$dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL); -do_query1($dbh); - -echo "Test 3 - Force column names to upper case\n"; -$dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_UPPER); -do_query1($dbh); - -echo "Test 4 - Setting on statement has no effect. Attempt lower case but get upper\n"; -$dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL); // reset -do_query2($dbh, PDO::CASE_LOWER); - -echo "Done\n"; - -?> ---EXPECT-- -Test 1 - Force column names to lower case -int(2) -array(1) { - ["dummy"]=> - string(1) "X" -} -Test 2 - Leave column names as returned by the database driver -int(0) -array(1) { - ["DUMMY"]=> - string(1) "X" -} -Test 3 - Force column names to upper case -int(1) -array(1) { - ["DUMMY"]=> - string(1) "X" -} -Test 4 - Setting on statement has no effect. Attempt lower case but get upper -Mode desired is 2 -array(1) { - ["DUMMY"]=> - string(1) "X" -} -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_client.phpt b/ext/pdo_oci/tests/pdo_oci_attr_client.phpt deleted file mode 100644 index f4c09f28616e..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_client.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Client version ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -getAttribute(PDO::ATTR_CLIENT_VERSION); -var_dump($cv); - -$s = explode(".", $cv); -if (count($s) > 1 && (($s[0] == 10 && $s[1] >= 2) || $s[0] >= 11)) { - if (count($s) != 5) { - echo "Wrong number of values in array\nVersion was: "; - var_dump($cv); - } else { - echo "Version OK, so far as can be portably checked\n"; - } -} else { - if (count($s) != 2) { - echo "Wrong number of values in array\nVersion was: "; - var_dump($cv); - } else { - echo "Version OK, so far as can be portably checked\n"; - } -} - -echo "Done\n"; - -?> ---EXPECTF-- -ATTR_CLIENT_VERSION: string(%d) "%d.%s" -Version OK, so far as can be portably checked -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_client_identifier.phpt b/ext/pdo_oci/tests/pdo_oci_attr_client_identifier.phpt deleted file mode 100644 index 6f9e93378ad7..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_client_identifier.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Setting session client identifier ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -query($query); -$row = $stmt->fetch(); -echo 'CLIENT_IDENTIFIER NOT SET: '; -var_dump($row['client_identifier']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_IDENTIFIER, "some client identifier")); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'CLIENT_IDENTIFIER SET: '; -var_dump($row['client_identifier']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_IDENTIFIER, "something else!")); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'CLIENT_IDENTIFIER RESET: '; -var_dump($row['client_identifier']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_IDENTIFIER, null)); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'CLIENT_IDENTIFIER NULLED: '; -var_dump($row['client_identifier']); - -echo "Done\n"; - -?> ---EXPECT-- -CLIENT_IDENTIFIER NOT SET: NULL -bool(true) -CLIENT_IDENTIFIER SET: string(22) "some client identifier" -bool(true) -CLIENT_IDENTIFIER RESET: string(15) "something else!" -bool(true) -CLIENT_IDENTIFIER NULLED: NULL -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_client_info.phpt b/ext/pdo_oci/tests/pdo_oci_attr_client_info.phpt deleted file mode 100644 index 4ccf419eb458..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_client_info.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Setting session client info ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -query($query); -$row = $stmt->fetch(); -echo 'CLIENT_INFO NOT SET: '; -var_dump($row['client_info']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_INFO, "some client info")); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'CLIENT_INFO SET: '; -var_dump($row['client_info']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_INFO, "something else!")); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'CLIENT_INFO RESET: '; -var_dump($row['client_info']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_INFO, null)); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'CLIENT_INFO NULLED: '; -var_dump($row['client_info']); - -echo "Done\n"; - -?> ---EXPECT-- -CLIENT_INFO NOT SET: NULL -bool(true) -CLIENT_INFO SET: string(16) "some client info" -bool(true) -CLIENT_INFO RESET: string(15) "something else!" -bool(true) -CLIENT_INFO NULLED: NULL -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_drivername.phpt b/ext/pdo_oci/tests/pdo_oci_attr_drivername.phpt deleted file mode 100644 index a3d9e43d742b..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_drivername.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: verify driver name ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -getAttribute(PDO::ATTR_DRIVER_NAME)); - -echo "Done\n"; -?> ---EXPECT-- -string(3) "oci" -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_module.phpt b/ext/pdo_oci/tests/pdo_oci_attr_module.phpt deleted file mode 100644 index 7194dcd78745..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_module.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Setting session module ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::OCI_ATTR_MODULE, "some module")); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'MODULE SET: '; -var_dump($row['module']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_MODULE, "something else!")); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'MODULE RESET: '; -var_dump($row['module']); - -var_dump($dbh->setAttribute(PDO::OCI_ATTR_MODULE, null)); - -$stmt = $dbh->query($query); -$row = $stmt->fetch(); -echo 'MODULE NULLED: '; -var_dump($row['module']); - -echo "Done\n"; - -?> ---EXPECT-- -bool(true) -MODULE SET: string(11) "some module" -bool(true) -MODULE RESET: string(15) "something else!" -bool(true) -MODULE NULLED: NULL -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_nulls_1.phpt b/ext/pdo_oci/tests/pdo_oci_attr_nulls_1.phpt deleted file mode 100644 index 0c70a1b41482..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_nulls_1.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Oracle Nulls ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -getAttribute(PDO::ATTR_ORACLE_NULLS)); - $s = $dbh->prepare("select '' as myempty, null as mynull from dual"); - $s->execute(); - while ($r = $s->fetch()) { - var_dump($r[0]); - var_dump($r[1]); - } -} - -$dbh = PDOTest::factory(); - -print "PDO::ATTR_ORACLE_NULLS: Default: "; -do_query($dbh); - -print "PDO::ATTR_ORACLE_NULLS: PDO::NULL_NATURAL: "; -$dbh->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_NATURAL); // No conversion. - -do_query($dbh); - -print "PDO::ATTR_ORACLE_NULLS: PDO::NULL_EMPTY_STRING: "; -$dbh->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_EMPTY_STRING); // Empty string is converted to NULL. - -do_query($dbh); - -print "PDO::ATTR_ORACLE_NULLS: PDO::NULL_TO_STRING: "; -$dbh->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_TO_STRING); // NULL is converted to an empty string. - -do_query($dbh); - -echo "Done\n"; - -?> ---EXPECT-- -PDO::ATTR_ORACLE_NULLS: Default: int(0) -NULL -NULL -PDO::ATTR_ORACLE_NULLS: PDO::NULL_NATURAL: int(0) -NULL -NULL -PDO::ATTR_ORACLE_NULLS: PDO::NULL_EMPTY_STRING: int(1) -NULL -NULL -PDO::ATTR_ORACLE_NULLS: PDO::NULL_TO_STRING: int(2) -string(0) "" -string(0) "" -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_prefetch_1.phpt b/ext/pdo_oci/tests/pdo_oci_attr_prefetch_1.phpt deleted file mode 100644 index df787d480dd2..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_prefetch_1.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Set prefetch on connection ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -101))); -$dbh = PDOTest::factory(); - -echo $dbh->getAttribute(PDO::ATTR_PREFETCH), "\n"; - -// Verify can fetch -$s = $dbh->prepare("select dummy from dual" ); -$s->execute(); -while ($r = $s->fetch()) { - echo $r[0] . "\n"; -} - -echo "Test set 102\n"; -$dbh->setAttribute(PDO::ATTR_PREFETCH, 102); -echo $dbh->getAttribute(PDO::ATTR_PREFETCH), "\n"; - -// Verify can fetch -$s = $dbh->prepare("select dummy from dual" ); -$s->execute(); -while ($r = $s->fetch()) { - echo $r[0] . "\n"; -} - -echo "Test set -1: (Uses 0)\n"; -$dbh->setAttribute(PDO::ATTR_PREFETCH, -1); -echo $dbh->getAttribute(PDO::ATTR_PREFETCH), "\n"; - -// Verify can fetch -$s = $dbh->prepare("select dummy from dual" ); -$s->execute(); -while ($r = $s->fetch()) { - echo $r[0] . "\n"; -} - -echo "Test set PHP_INT_MAX: (Uses default)\n"; -$dbh->setAttribute(PDO::ATTR_PREFETCH, PHP_INT_MAX); -echo $dbh->getAttribute(PDO::ATTR_PREFETCH), "\n"; - -// Verify can fetch -$s = $dbh->prepare("select dummy from dual" ); -$s->execute(); -while ($r = $s->fetch()) { - echo $r[0] . "\n"; -} - -echo "Done\n"; - -?> ---EXPECT-- -Test connect -101 -X -Test set 102 -102 -X -Test set -1: (Uses 0) -0 -X -Test set PHP_INT_MAX: (Uses default) -100 -X -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_prefetch_2.phpt b/ext/pdo_oci/tests/pdo_oci_attr_prefetch_2.phpt deleted file mode 100644 index 793225c89f38..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_prefetch_2.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: prefetch on statements ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -prepare("select '' as myempty, null as mynull from dual", array(PDO::ATTR_PREFETCH => 101)); - -echo "Test 1: Can't set prefetch after prepare\n"; -var_dump($s->setAttribute(PDO::ATTR_PREFETCH, 102)); - -// Verify can fetch -$s = $dbh->prepare("select dummy from dual" ); -$s->execute(); -while ($r = $s->fetch()) { - echo $r[0] . "\n"; -} - -echo "Test 2: Turn off prefetching\n"; -$s = $dbh->prepare("select '' as myempty, null as mynull from dual", array(PDO::ATTR_PREFETCH => 0)); -$s = $dbh->prepare("select dummy from dual" ); -$s->execute(); -while ($r = $s->fetch()) { - echo $r[0] . "\n"; -} - -echo "Done\n"; - -?> ---EXPECTF-- -Test 1: Can't set prefetch after prepare - -Warning: PDOStatement::setAttribute(): SQLSTATE[IM001]: Driver does not support this function: This driver doesn't support setting attributes in %s on line %d -bool(false) -X -Test 2: Turn off prefetching -X -Done diff --git a/ext/pdo_oci/tests/pdo_oci_attr_server.phpt b/ext/pdo_oci/tests/pdo_oci_attr_server.phpt deleted file mode 100644 index 6dec9f46a6c9..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_attr_server.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -PDO_OCI: Attribute: Server version and info ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -getAttribute(PDO::ATTR_SERVER_VERSION)); - -echo "Test 2\n"; -echo "ATTR_SERVER_INFO\n"; -$si = $dbh->getAttribute(PDO::ATTR_SERVER_INFO); -$pos = strpos($si, "Oracle"); -if ($pos === 0) { - echo "Found 'Oracle' at position $pos as expected\n"; -} else { - echo "Unexpected result. Server info was:\n"; - var_dump($si); -} - -echo "Done\n"; - -?> ---EXPECTF-- -Test 1 -ATTR_SERVER_VERSION: string(%d) "%d.%d.%d.%d.%d" -Test 2 -ATTR_SERVER_INFO -Found 'Oracle' at position 0 as expected -Done diff --git a/ext/pdo_oci/tests/pdo_oci_class_constants.phpt b/ext/pdo_oci/tests/pdo_oci_class_constants.phpt deleted file mode 100644 index 36290f3c077d..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_class_constants.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -PDO OCI specific class constants ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- - true, - 'OCI_ATTR_ACTION' => true, - 'OCI_ATTR_CLIENT_IDENTIFIER' => true, - 'OCI_ATTR_MODULE' => true, - 'OCI_ATTR_CALL_TIMEOUT' => true, -]; - -$ref = new ReflectionClass('PDO'); -$constants = $ref->getConstants(); -$values = []; - -foreach ($constants as $name => $value) { - if (substr($name, 0, 8) == 'OCI_ATTR') { - if (!isset($values[$value])) { - $values[$value] = [$name]; - } else { - $values[$value][] = $name; - } - - if (isset($expected[$name])) { - unset($expected[$name]); - unset($constants[$name]); - } - - } else { - unset($constants[$name]); - } -} - -if (!empty($constants)) { - printf("[001] Dumping list of unexpected constants\n"); - var_dump($constants); -} - -if (!empty($expected)) { - printf("[002] Dumping list of missing constants\n"); - var_dump($expected); -} - -if (!empty($values)) { - foreach ($values as $value => $constants) { - if (count($constants) > 1) { - printf("[003] Several constants share the same value '%s'\n", $value); - var_dump($constants); - } - } -} - -print "done!"; -?> ---EXPECT-- -done! diff --git a/ext/pdo_oci/tests/pdo_oci_debugdumpparams.phpt b/ext/pdo_oci/tests/pdo_oci_debugdumpparams.phpt deleted file mode 100644 index 98851193f7fb..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_debugdumpparams.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -PDO_OCI: Bug #69356 (PDOStatement::debugDumpParams() truncates query) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_EMULATE_PREPARES, true); -$stmt = $db->query(" - SELECT ' - Dumps the information contained by a prepared statement directly on the output. It will provide the SQL query in use, the number of parameters used (Params), the list of parameters, with their name, type (paramtype) as an integer, their key name or position, and the position in the query (if this is supported by the PDO driver, otherwise, it will be -1). - This is a debug function, which dump directly the data on the normal output. - Tip: - As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of this function, and save it in a string (for example). - This will only dumps the parameters in the statement at the moment of the dump. Extra parameters are not stored in the statement, and not displayed. - ' FROM DUAL -"); -var_dump($stmt->debugDumpParams()); -?> ---EXPECT-- -SQL: [844] - SELECT ' - Dumps the information contained by a prepared statement directly on the output. It will provide the SQL query in use, the number of parameters used (Params), the list of parameters, with their name, type (paramtype) as an integer, their key name or position, and the position in the query (if this is supported by the PDO driver, otherwise, it will be -1). - This is a debug function, which dump directly the data on the normal output. - Tip: - As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of this function, and save it in a string (for example). - This will only dumps the parameters in the statement at the moment of the dump. Extra parameters are not stored in the statement, and not displayed. - ' FROM DUAL - -Params: 0 -NULL diff --git a/ext/pdo_oci/tests/pdo_oci_fread_1.phpt b/ext/pdo_oci/tests/pdo_oci_fread_1.phpt deleted file mode 100644 index 112ba994abe1..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_fread_1.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -PDO_OCI: check fread() EOF ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); - -// Initialization -$stmtarray = array( - "create table test_oci_fread_1 (id number, data clob)", - "declare - lob1 clob := 'abc' || lpad('j',4020,'j') || 'xyz'; - begin - insert into test_oci_fread_1 (id,data) values (1, lob1); - end;" -); - -foreach ($stmtarray as $stmt) { - $dbh->exec($stmt); -} - -echo "Test 1\n"; - -$s = $dbh->query("select data from test_oci_fread_1 where id = 1"); -$r = $s->fetch(); -$sh = $r['data']; - -while (!feof($sh)) { - $buffer = fread($sh,1024); - echo '*'.$buffer.'*'; -} -echo "\n"; -fclose($sh); -?> ---CLEAN-- - ---EXPECT-- -Test 1 -*abcjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj**jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj**jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj**jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjxyz* diff --git a/ext/pdo_oci/tests/pdo_oci_phpinfo.phpt b/ext/pdo_oci/tests/pdo_oci_phpinfo.phpt deleted file mode 100644 index e24326af3f23..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_phpinfo.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -PDO_OCI: phpinfo() output ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- - enabled'; -if (!preg_match("/$reg/", $tmp)) { - printf("[001] Cannot find OCI PDO driver line in phpinfo() output\n"); -} - -print "done!"; -?> ---EXPECT-- -done! diff --git a/ext/pdo_oci/tests/pdo_oci_quote1.phpt b/ext/pdo_oci/tests/pdo_oci_quote1.phpt deleted file mode 100644 index 5a4357676878..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_quote1.phpt +++ /dev/null @@ -1,158 +0,0 @@ ---TEST-- -Test PDO->quote() for PDO_OCI ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -query("create table test_pdo_oci_quote1 (t varchar2(100))"); -$stmt = $db->prepare('select * from test_pdo_oci_quote1'); - -// The intent is that the fetched data be identical to the unquoted string. -// Remember!: use bind variables instead of PDO->quote() - -$a = array("", "a", "ab", "abc", "ab'cd", "a\b\n", "'", "''", "a'", "'z", "a''b", '"'); -foreach ($a as $u) { - $q = $db->quote($u); - echo "Unquoted : "; - var_dump($u); - echo "Quoted : "; - var_dump($q); - - $db->exec("delete from test_pdo_oci_quote1"); - - $db->query("insert into test_pdo_oci_quote1 (t) values($q)"); - $stmt->execute(); - var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); -} - -echo "Done\n"; -?> ---CLEAN-- - ---EXPECT-- -Unquoted : string(0) "" -Quoted : string(2) "''" -array(1) { - [0]=> - array(1) { - ["t"]=> - NULL - } -} -Unquoted : string(1) "a" -Quoted : string(3) "'a'" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(1) "a" - } -} -Unquoted : string(2) "ab" -Quoted : string(4) "'ab'" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(2) "ab" - } -} -Unquoted : string(3) "abc" -Quoted : string(5) "'abc'" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(3) "abc" - } -} -Unquoted : string(5) "ab'cd" -Quoted : string(8) "'ab''cd'" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(5) "ab'cd" - } -} -Unquoted : string(4) "a\b -" -Quoted : string(6) "'a\b -'" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(4) "a\b -" - } -} -Unquoted : string(1) "'" -Quoted : string(4) "''''" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(1) "'" - } -} -Unquoted : string(2) "''" -Quoted : string(6) "''''''" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(2) "''" - } -} -Unquoted : string(2) "a'" -Quoted : string(5) "'a'''" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(2) "a'" - } -} -Unquoted : string(2) "'z" -Quoted : string(5) "'''z'" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(2) "'z" - } -} -Unquoted : string(4) "a''b" -Quoted : string(8) "'a''''b'" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(4) "a''b" - } -} -Unquoted : string(1) """ -Quoted : string(3) "'"'" -array(1) { - [0]=> - array(1) { - ["t"]=> - string(1) """ - } -} -Done diff --git a/ext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt b/ext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt deleted file mode 100644 index 043b6e0ad821..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt +++ /dev/null @@ -1,320 +0,0 @@ ---TEST-- -PDO_OCI: PDOStatement->getColumnMeta ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -exec("CREATE TABLE test_pdo_oci_stmt_getcolumnmeta(id INT)"); - - $db->beginTransaction(); - - $stmt = $db->prepare('SELECT id FROM test_pdo_oci_stmt_getcolumnmeta ORDER BY id ASC'); - - echo "Test 1. calling function with invalid parameters\n"; - - // execute() has not been called yet - // NOTE: no warning - $tmp = $stmt->getColumnMeta(0); - printf(" 1.1 Expecting false got %s\n", var_export($tmp, true)); - - echo(" 1.2 "); - $stmt->execute(); - // PDOStatement::getColumnMeta() expects exactly 1 argument, 0 given in - try { - $tmp = $stmt->getColumnMeta(); - } catch (ArgumentCountError $e) { - if (false !== $tmp) { - printf("[1.2] Expecting false got %s\n", var_export($tmp, true)); - } - echo $e->getMessage(), "\n"; - } - - // invalid offset - echo " 1.3 "; - try { - $tmp = $stmt->getColumnMeta(-1); - } catch (ValueError $e) { - if (false !== $tmp) { - printf("[1.3] Expecting false got %s\n", var_export($tmp, true)); - } - echo $e->getMessage(), "\n"; - } - - // PDOStatement::getColumnMeta(): Argument #1 must be of type int, array given in - echo " 1.4 "; - try { - $tmp = $stmt->getColumnMeta(array()); - } catch (TypeError $e) { - if (false !== $tmp) - printf("[1.4] Expecting false got %s\n", var_export($tmp, true)); - echo $e->getMessage(), "\n"; - } - - // PDOStatement::getColumnMeta() expects exactly 1 argument, 2 given in - echo " 1.5 "; - try { - $tmp = $stmt->getColumnMeta(1, 1); - } catch (ArgumentCountError $e) { - if (false !== $tmp) - printf("[1.5] Expecting false got %s\n", var_export($tmp, true)); - echo $e->getMessage(), "\n"; - } - - // invalid offset - $tmp = $stmt->getColumnMeta(1); - printf(" 1.6 Expecting false because of invalid offset got %s\n", var_export($tmp, true)); - - echo "Test 2. testing return values\n"; - echo "Test 2.1 testing array returned\n"; - - $stmt = $db->prepare('SELECT id FROM test_pdo_oci_stmt_getcolumnmeta ORDER BY id ASC'); - $stmt->execute(); - $native = $stmt->getColumnMeta(0); - if (count($native) == 0) { - printf("[008] Meta data seems wrong, %s / %s\n", - var_export($native, true), var_export($emulated, true)); - } - - - function test_return($meta, $offset, $native_type, $pdo_type){ - if (empty($meta)) { - printf("[%03d + 2] getColumnMeta() failed, %d - %s\n", $offset, - $stmt->errorCode(), var_export($stmt->errorInfo(), true)); - return false; - } - $elements = array('flags', 'scale', 'name', 'len', 'precision', 'pdo_type'); - foreach ($elements as $k => $element) - if (!isset($meta[$element])) { - printf("[%03d + 3] Element %s missing, %s\n", $offset, - $element, var_export($meta, true)); - return false; - } - - if (!is_null($native_type)) { - if (!isset($meta['native_type'])) { - printf("[%03d + 4] Element native_type missing, %s\n", $offset, - var_export($meta, true)); - return false; - } - - if (!is_array($native_type)) - $native_type = array($native_type); - - $found = false; - foreach ($native_type as $k => $type) { - if ($meta['native_type'] == $type) { - $found = true; - break; - } - } - - if (!$found) { - printf("[%03d + 5] Expecting native type %s, %s\n", $offset, - var_export($native_type, true), var_export($meta, true)); - return false; - } - } - - if (!is_null($pdo_type) && ($meta['pdo_type'] != $pdo_type)) { - printf("[%03d + 6] Expecting PDO type %s got %s (%s)\n", $offset, - $pdo_type, var_export($meta, true), var_export($meta['native_type'])); - return false; - } - - return true; - } - - - function test_meta(&$db, $offset, $sql_type, $value, $native_type, $pdo_type) { - - $db->exec(<<prepare($sql); - $stmt->execute(); - - if (!$db->exec(sprintf("INSERT INTO test_pdo_oci_stmt_getcolumnmeta(id, label) VALUES (1, '%s')", $value))) { - printf("[%03d] + 1] Insert failed, %d - %s\n", $offset, - $db->errorCode(), var_export($db->errorInfo(), true)); - return false; - } - - $stmt = $db->prepare('SELECT id, label FROM test_pdo_oci_stmt_getcolumnmeta'); - $stmt->execute(); - $meta = $stmt->getColumnMeta(1); - return test_return($meta, $offset, $native_type, $pdo_type); - } - - echo "Test 2.2 testing numeric columns\n"; - - test_meta($db, 20, 'NUMBER' , 0 , 'NUMBER', PDO::PARAM_STR); - test_meta($db, 30, 'NUMBER' , 256 , 'NUMBER', PDO::PARAM_STR); - test_meta($db, 40, 'INT' , 256 , 'NUMBER', PDO::PARAM_STR); - test_meta($db, 50, 'INTEGER' , 256 , 'NUMBER', PDO::PARAM_STR); - test_meta($db, 60, 'NUMBER' , 256.01 , 'NUMBER', PDO::PARAM_STR); - test_meta($db, 70, 'NUMBER' , -8388608 , 'NUMBER', PDO::PARAM_STR); - - test_meta($db, 80, 'NUMBER' , 2147483648 , 'NUMBER', PDO::PARAM_STR); - test_meta($db, 90, 'NUMBER' , 4294967295 , 'NUMBER', PDO::PARAM_STR); - - test_meta($db, 100, 'DEC' , 1.01 , 'NUMBER' , PDO::PARAM_STR); - test_meta($db, 110, 'DECIMAL' , 1.01 , 'NUMBER' , PDO::PARAM_STR); - test_meta($db, 120, 'FLOAT' , 1.01 , 'FLOAT' , PDO::PARAM_STR); - test_meta($db, 130, 'DOUBLE PRECISION', 1.01 , 'FLOAT' , PDO::PARAM_STR); - test_meta($db, 140, 'BINARY_FLOAT' , 1.01 , 'BINARY_FLOAT' , PDO::PARAM_STR); - test_meta($db, 150, 'BINARY_DOUBLE' , 1.01 , 'BINARY_DOUBLE', PDO::PARAM_STR); - - echo "Test 2.3 testing temporal columns\n"; - - $db->exec("alter session set nls_date_format='YYYY-MM-DD'"); - test_meta($db, 160, 'DATE' , '2008-04-23' , 'DATE', PDO::PARAM_STR); - - echo "Test 2.4 testing string columns\n"; - - test_meta($db, 170, 'CHAR(1)' , 'a' , 'CHAR' , PDO::PARAM_STR); - test_meta($db, 180, 'CHAR(10)' , '0123456789' , 'CHAR' , PDO::PARAM_STR); - test_meta($db, 190, 'CHAR(255)' , str_repeat('z', 255) , 'CHAR' , PDO::PARAM_STR); - test_meta($db, 200, 'VARCHAR(1)' , 'a' , 'VARCHAR2' , PDO::PARAM_STR); - test_meta($db, 210, 'VARCHAR(10)' , '0123456789' , 'VARCHAR2' , PDO::PARAM_STR); - test_meta($db, 220, 'VARCHAR(255)' , str_repeat('z', 255) , 'VARCHAR2' , PDO::PARAM_STR); - test_meta($db, 230, 'VARCHAR2(1)' , 'a' , 'VARCHAR2' , PDO::PARAM_STR); - test_meta($db, 240, 'VARCHAR2(10)' , '0123456789' , 'VARCHAR2' , PDO::PARAM_STR); - test_meta($db, 250, 'VARCHAR2(255)' , str_repeat('z', 255) , 'VARCHAR2' , PDO::PARAM_STR); - - test_meta($db, 260, 'NCHAR(1)' , 'a' , 'NCHAR' , PDO::PARAM_STR); - test_meta($db, 270, 'NCHAR(10)' , '0123456789' , 'NCHAR' , PDO::PARAM_STR); - test_meta($db, 280, 'NCHAR(255)' , str_repeat('z', 255) , 'NCHAR' , PDO::PARAM_STR); - test_meta($db, 290, 'NVARCHAR2(1)' , 'a' , 'NVARCHAR2', PDO::PARAM_STR); - test_meta($db, 300, 'NVARCHAR2(10)' , '0123456789' , 'NVARCHAR2', PDO::PARAM_STR); - test_meta($db, 310, 'NVARCHAR2(255)', str_repeat('z', 255) , 'NVARCHAR2', PDO::PARAM_STR); - - echo "Test 2.5 testing lobs columns\n"; - - test_meta($db, 320, 'CLOB' , str_repeat('b', 255) , 'CLOB' , PDO::PARAM_LOB); - test_meta($db, 330, 'BLOB' , str_repeat('b', 256) , 'BLOB' , PDO::PARAM_LOB); - test_meta($db, 340, 'NCLOB' , str_repeat('b', 255) , 'NCLOB' , PDO::PARAM_LOB); - - test_meta($db, 350, 'LONG' , str_repeat('b', 256) , 'LONG' , PDO::PARAM_STR); - test_meta($db, 360, 'LONG RAW' , str_repeat('b', 256) , 'LONG RAW', PDO::PARAM_STR); - test_meta($db, 370, 'RAW(256)' , str_repeat('b', 256) , 'RAW' , PDO::PARAM_STR); - - - $db->exec(<<query('SELECT count(*) FROM dual'); - $meta = $stmt->getColumnMeta(0); - test_return($meta, 380, 'NUMBER', PDO::PARAM_STR); - $stmt = $db->query("SELECT TO_DATE('2008-04-23') FROM dual"); - $meta = $stmt->getColumnMeta(0); - test_return($meta, 390, 'DATE', PDO::PARAM_STR); - $stmt = $db->query("SELECT TO_CHAR(542) FROM dual"); - $meta = $stmt->getColumnMeta(0); - test_return($meta, 400, 'VARCHAR2', PDO::PARAM_STR); - - - echo "Test 2.7 testing flags returned\n"; - - $sql = sprintf('CREATE TABLE test_pdo_oci_stmt_getcolumnmeta(id INT NOT NULL, label INT NULL)'); - $stmt = $db->prepare($sql); - $stmt->execute(); - $db->exec('INSERT INTO test_pdo_oci_stmt_getcolumnmeta(id, label) VALUES (1, 1)'); - $stmt = $db->query('SELECT id, label FROM test_pdo_oci_stmt_getcolumnmeta'); - $meta = $stmt->getColumnMeta(0); - // verify the flags array contains a not_null flag and not nullable flags - if (!isset($meta['flags'])) { - printf("[1001] No flags contained in metadata %s\n", var_export($meta, true)); - } else { - $flags = $meta['flags']; - $found = false; - foreach ($flags as $k => $flag) { - if ($flag == 'not_null') - $found = true; - if ($flag == 'nullable') - printf("[1003] Flags seem wrong %s\n", var_export($meta, true)); - } - if (!$found) - printf("[1002] Flags seem wrong %s\n", var_export($meta, true)); - } - $meta = $stmt->getColumnMeta(1); - // verify the flags array contains a nullable flag and not not_null flags - if (!isset($meta['flags'])) { - printf("[1003] No flags contained in metadata %s\n", var_export($meta, true)); - } else { - $flags = $meta['flags']; - $found = false; - foreach ($flags as $k => $flag) { - if ($flag == 'not_null') - printf("[1004] Flags seem wrong %s\n", var_export($meta, true)); - if ($flag == 'nullable') - $found = true; - } - if (!$found) - printf("[1005] Flags seem wrong %s\n", var_export($meta, true)); - } - -} catch (PDOException $e) { - // we should never get here, we use warnings, but never trust a system... - printf("[001] %s, [%s} %s\n", - $e->getMessage(), $db->errorInfo(), implode(' ', $db->errorInfo())); -} - -print "done!"; -?> ---CLEAN-- - ---EXPECT-- -Preparations before the test -Test 1. calling function with invalid parameters - 1.1 Expecting false got false - 1.2 PDOStatement::getColumnMeta() expects exactly 1 argument, 0 given - 1.3 PDOStatement::getColumnMeta(): Argument #1 ($column) must be greater than or equal to 0 - 1.4 PDOStatement::getColumnMeta(): Argument #1 ($column) must be of type int, array given - 1.5 PDOStatement::getColumnMeta() expects exactly 1 argument, 2 given - 1.6 Expecting false because of invalid offset got false -Test 2. testing return values -Test 2.1 testing array returned -Test 2.2 testing numeric columns -Test 2.3 testing temporal columns -Test 2.4 testing string columns -Test 2.5 testing lobs columns -Test 2.6 testing function return -Test 2.7 testing flags returned -done! diff --git a/ext/pdo_oci/tests/pdo_oci_stream_1.phpt b/ext/pdo_oci/tests/pdo_oci_stream_1.phpt deleted file mode 100644 index b414e5024f60..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_stream_1.phpt +++ /dev/null @@ -1,108 +0,0 @@ ---TEST-- -PDO_OCI: stream_get_contents length & offset test ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); - -// Initialization -$stmtarray = array( - "create table test_pdo_oci_stream_1 (id number, data clob)", -); - -foreach ($stmtarray as $stmt) { - $dbh->exec($stmt); -} - -$dbh->exec(" - declare - lob1 clob := 'abc' || lpad('j',30000,'j') || 'xyz'; - begin - insert into test_pdo_oci_stream_1 (id,data) values (1, 'abcdefghijklmnopqrstuvwxyz'); - insert into test_pdo_oci_stream_1 (id,data) values (2, lob1); - end;"); - -echo "Test 1\n"; - -$s = $dbh->prepare("select data from test_pdo_oci_stream_1 where id = 1"); -$s->execute(); -$r = $s->fetch(); - -// stream_get_contents ( resource $handle [, int $maxlength = -1 [, int $offset = -1 ]] ) -echo 'Read '.stream_get_contents($r['data'], 1, 1)."$\n"; // b -echo 'Read '.stream_get_contents($r['data'], 2, 1)."$\n"; // cd -echo 'Read '.stream_get_contents($r['data'], 2, 0)."$\n"; // ab -echo 'Read '.stream_get_contents($r['data'], 26, 0)."$\n"; // abcdefghijklmnopqrstuvwxyz -echo 'Read '.stream_get_contents($r['data'], 27, 0)."$\n"; // abcdefghijklmnopqrstuvwxyz -echo 'Read '.stream_get_contents($r['data'], 27, 1)."$\n"; // bcdefghijklmnopqrstuvwxyz -echo 'Read '.stream_get_contents($r['data'], 1, 20)."$\n"; // u -echo 'Read '.stream_get_contents($r['data'], 1, 25)."$\n"; // z -echo 'Read '.stream_get_contents($r['data'], 1, 26)."$\n"; // -echo 'Read '.stream_get_contents($r['data'], 1, 0)."$\n"; // a - -echo "\nTest 2\n"; - -$s = $dbh->prepare("select data from test_pdo_oci_stream_1 where id = 2"); -$s->execute(); -$r = $s->fetch(); - -echo 'Read '.stream_get_contents($r['data'], 5, 0)."\n"; // abcjj -echo 'Read '.stream_get_contents($r['data'], 5, 2)."\n"; // cjjjj -echo 'Read '.stream_get_contents($r['data'], 6, 1)."\n"; // bcjjjj -echo 'Read '.strlen(stream_get_contents($r['data'], -1,0))."\n"; // 30006 -echo 'Read '.strlen(stream_get_contents($r['data'], 0,0))."\n"; // 0 -echo 'Read '.strlen(stream_get_contents($r['data'], 0,1))."\n"; // 0 -echo 'Read '.strlen(stream_get_contents($r['data'], 10,100))."\n"; // 10 -echo 'Read '.stream_get_contents($r['data'], 6, 30000)."\n"; // jjjxyz -echo 'Read '.stream_get_contents($r['data'], 7, 30000)."\n"; // jjjxyz -echo 'Read '.strlen(stream_get_contents($r['data']))."\n"; // 0 -echo 'Read '.strlen(stream_get_contents($r['data'], 0))."\n"; // 0 -echo 'Read '.strlen(stream_get_contents($r['data'], -1))."\n"; // 0 -echo 'Read '.stream_get_contents($r['data'], -1, 30000)."\n"; // jjjxyz -?> ---CLEAN-- - ---EXPECT-- -Test 1 -Read b$ -Read cd$ -Read ab$ -Read abcdefghijklmnopqrstuvwxyz$ -Read abcdefghijklmnopqrstuvwxyz$ -Read bcdefghijklmnopqrstuvwxyz$ -Read u$ -Read z$ -Read $ -Read a$ - -Test 2 -Read abcjj -Read cjjjj -Read bcjjjj -Read 30006 -Read 0 -Read 0 -Read 10 -Read jjjxyz -Read jjjxyz -Read 0 -Read 0 -Read 0 -Read jjjxyz diff --git a/ext/pdo_oci/tests/pdo_oci_stream_2.phpt b/ext/pdo_oci/tests/pdo_oci_stream_2.phpt deleted file mode 100644 index a610ea692d38..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_stream_2.phpt +++ /dev/null @@ -1,122 +0,0 @@ ---TEST-- -PDO OCI: Insert and fetch 1K records from a table that contains 1 number and 2 LOB columns (stress test) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -prepare($query); -$stmt->execute(); - -function do_insert($db, $id, $data1, $data2) -{ - $db->beginTransaction(); - $stmt = $db->prepare("insert into test_pdo_oci_stream_2 (id, data1, data2) values (:id, empty_blob(), empty_blob()) returning data1, data2 into :blob1, :blob2"); - $stmt->bindParam(':id', $id); - $stmt->bindParam(':blob1', $blob1, PDO::PARAM_LOB); - $stmt->bindParam(':blob2', $blob2, PDO::PARAM_LOB); - $blob1 = null; - $blob2 = null; - $stmt->execute(); - - fwrite($blob1, $data1); - fclose($blob1); - fwrite($blob2, $data2); - fclose($blob2); - $db->commit(); -} - -$a1 = str_repeat('a', 4086); -$a2 = str_repeat('b', 4087); -$a3 = str_repeat('c', 4088); -$a4 = str_repeat('d', 4089); -$a5 = str_repeat('e', 4090); -$a6 = str_repeat('f', 4091); -$a7 = str_repeat('g', 4092); -$a8 = str_repeat('h', 4093); -$a9 = str_repeat('i', 4094); -$a10 = str_repeat('j', 4095); - -printf("Inserting 1000 Records ... "); -for($i=0; $i<100; $i++) { - do_insert($db, $i * 10 + 1, $a1, $a10); - do_insert($db, $i * 10 + 2, $a2, $a9); - do_insert($db, $i * 10 + 3, $a3, $a8); - do_insert($db, $i * 10 + 4, $a4, $a7); - do_insert($db, $i * 10 + 5, $a5, $a6); - do_insert($db, $i * 10 + 6, $a6, $a5); - do_insert($db, $i * 10 + 7, $a7, $a4); - do_insert($db, $i * 10 + 8, $a8, $a3); - do_insert($db, $i * 10 + 9, $a9, $a2); - do_insert($db, $i * 10 + 10, $a10, $a1); -} -printf("Done\n"); - -$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); // Let's use streams - -// Since each column only has one lob descriptor, the last row is -// shown twice because the lob descriptor for each column is reused in -// the stream - -$i = 0; -$j = 9; -$a_val = ord('a'); -foreach($db->query("select data1 as d4_1, data2 as d4_2 from test_pdo_oci_stream_2 order by id") as $row) { - $a = $row['d4_1']; - $a1 = $row['d4_2']; - - $str1 = stream_get_contents($a); - $str2 = stream_get_contents($a1); - - $str1len = strlen($str1); - $str2len = strlen($str2); - - $b = ord($str1[0]); - $b1 = ord($str2[0]); - - if (($b != ($a_val + $i)) && ($str1len != (4086 + $i)) && - ($b1 != ($a_val + $j)) && ($str2len != (4086 + $j))) { - printf("There is a bug!\n"); - printf("Col1:\n"); - printf("a_val = %d\n", $a_val); - printf("b = %d\n", $b); - printf("i = %d\n", $i); - printf("str1len = %d\n", $str1len); - - printf("Col2:\n"); - printf("a_val = %d\n", $a_val); - printf("b1 = %d\n", $b1); - printf("j = %d\n", $j); - printf("str2len = %d\n", $str1len); - - } - $i++; - if ($i>9) - $i = 0; - $j--; - if ($j<0) - $j = 9; -} -echo "Fetch operation done!\n"; -?> ---CLEAN-- - ---EXPECT-- -Inserting 1000 Records ... Done -Fetch operation done! diff --git a/ext/pdo_oci/tests/pdo_oci_templob_1.phpt b/ext/pdo_oci/tests/pdo_oci_templob_1.phpt deleted file mode 100644 index 6605d978ec8d..000000000000 --- a/ext/pdo_oci/tests/pdo_oci_templob_1.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -PDO OCI: Test to verify all implicitly created temporary LOB are cleaned up ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -prepare($clobquery1); -$stmt->execute(); -$row = $stmt->fetch(); -$stmt= $db->prepare($clobquery2); -$stmt->execute(); -$row = $stmt->fetch(); -$stmt= $db->prepare($clobquery3); -$stmt->execute(); -$row = $stmt->fetch(); -$stmt= $db->prepare($clobquery4); -$stmt->execute(); -$row = $stmt->fetch(); -$stmt= $db->prepare($clobquery5); -$stmt->execute(); -$row = $stmt->fetch(); -$stmt= $db->prepare($clobquery6); -$stmt->execute(); -$row = $stmt->fetch(); -$stmt= $db->prepare($clobquery7); -$stmt->execute(); -$row = $stmt->fetch(); -$stmt= $db->prepare($clobquery8); -$stmt->execute(); -$row = $stmt->fetch(); -$stmt= $db->prepare($clobquery9); -$stmt->execute(); -$row = $stmt->fetch(); -$stmt= $db->prepare($clobquery10); -$stmt->execute(); -$row = $stmt->fetch(); - -$query1 = "SELECT SYS_CONTEXT('USERENV', 'SID') SID FROM DUAL"; - -$stmt1 = $db->prepare($query1); -$stmt1->execute(); - -$row1 = $stmt1->fetch(); -$sid_value = $row1[0]; - -$query2 = "SELECT (CACHE_LOBS+NOCACHE_LOBS+ABSTRACT_LOBS) FROM V\$TEMPORARY_LOBS WHERE SID = :SID_VALUE"; - -$stmt2 = $db->prepare($query2); -$stmt2->bindParam(':SID_VALUE', $sid_value); -$stmt2->execute(); - -$row2 = $stmt2->fetch(); -/* 1 temporary LOB still exists in V$TEMPORARY_LOBS since the destructor of $stmt is not yet called by PHP */ -if ($row2[0] > 1) -{ - echo "TEMP_LOB is not yet cleared!" . $row2[0] . "\n"; -} -else -{ - echo "Success! All the temporary LOB in previously closed statements are properly cleaned.\n"; -} - -?> ---EXPECT-- -Success! All the temporary LOB in previously closed statements are properly cleaned. diff --git a/ext/pdo_oci/tests/pecl_bug_11345.phpt b/ext/pdo_oci/tests/pecl_bug_11345.phpt deleted file mode 100644 index d36279a49eda..000000000000 --- a/ext/pdo_oci/tests/pecl_bug_11345.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -PECL PDO_OCI Bug #11345 (Test invalid character set name) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -getMessage(). "\n"; - exit; -} - -echo "Done\n"; - -?> ---EXPECTF-- -Connection failed: SQLSTATE[HY000]: OCINlsCharSetNameToId: unknown character set name (%s) diff --git a/ext/pdo_oci/tests/pecl_bug_6364.phpt b/ext/pdo_oci/tests/pecl_bug_6364.phpt deleted file mode 100644 index 9c5e031e9f87..000000000000 --- a/ext/pdo_oci/tests/pecl_bug_6364.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -PECL PDO_OCI Bug #6364 (segmentation fault on stored procedure call with OUT binds) ---EXTENSIONS-- -pdo -pdo_oci ---SKIPIF-- - ---FILE-- -exec ("create table test6364 (c1 varchar2(10), c2 varchar2(10), c3 varchar2(10), c4 varchar2(10), c5 varchar2(10))"); - -$dbh->exec ("create procedure test6364_sp(p1 IN varchar2, p2 IN varchar2, p3 IN varchar2, p4 OUT varchar2, p5 OUT varchar2) as begin insert into test6364 (c1, c2, c3) values (p1, p2, p3); p4 := 'val4'; p5 := 'val5'; end;"); - -$stmt = $dbh->prepare("call test6364_sp('p1','p2','p3',?,?)"); - -$out_param1 = "a"; -$out_param2 = "a"; - -$stmt->bindParam(1, $out_param1,PDO::PARAM_STR, 1024); -$stmt->bindParam(2, $out_param2,PDO::PARAM_STR, 1024); - -$stmt->execute() or die ("Execution error: " . var_dump($dbh->errorInfo())); - -var_dump($out_param1); -var_dump($out_param2); - -foreach ($dbh->query("select * from test6364") as $row) { - var_dump($row); -} - -print "Done\n"; -?> ---CLEAN-- -exec("DROP PROCEDURE test6364_sp"); -?> ---EXPECT-- -string(4) "val4" -string(4) "val5" -array(10) { - ["c1"]=> - string(2) "p1" - [0]=> - string(2) "p1" - ["c2"]=> - string(2) "p2" - [1]=> - string(2) "p2" - ["c3"]=> - string(2) "p3" - [2]=> - string(2) "p3" - ["c4"]=> - NULL - [3]=> - NULL - ["c5"]=> - NULL - [4]=> - NULL -} -Done diff --git a/php.ini-development b/php.ini-development index 438ee5ba045b..730a400ec940 100644 --- a/php.ini-development +++ b/php.ini-development @@ -945,13 +945,10 @@ default_socket_timeout = 60 ;extension=mbstring ;extension=exif ; Must be after mbstring as it depends on it ;extension=mysqli -;extension=oci8_12c ; Use with Oracle Database 12c Instant Client -;extension=oci8_19 ; Use with Oracle Database 19 Instant Client ;extension=odbc ;extension=openssl ;extension=pdo_firebird ;extension=pdo_mysql -;extension=pdo_oci ;extension=pdo_odbc ;extension=pdo_pgsql ;extension=pdo_sqlite @@ -1242,66 +1239,6 @@ mysqlnd.collect_memory_statistics = On ; key. ;mysqlnd.sha256_server_public_key = -[OCI8] - -; Connection: Enables privileged connections using external -; credentials (OCI_SYSOPER, OCI_SYSDBA) -; https://php.net/oci8.privileged-connect -;oci8.privileged_connect = Off - -; Connection: The maximum number of persistent OCI8 connections per -; process. Using -1 means no limit. -; https://php.net/oci8.max-persistent -;oci8.max_persistent = -1 - -; Connection: The maximum number of seconds a process is allowed to -; maintain an idle persistent connection. Using -1 means idle -; persistent connections will be maintained forever. -; https://php.net/oci8.persistent-timeout -;oci8.persistent_timeout = -1 - -; Connection: The number of seconds that must pass before issuing a -; ping during oci_pconnect() to check the connection validity. When -; set to 0, each oci_pconnect() will cause a ping. Using -1 disables -; pings completely. -; https://php.net/oci8.ping-interval -;oci8.ping_interval = 60 - -; Connection: Set this to a user chosen connection class to be used -; for all pooled server requests with Oracle Database Resident -; Connection Pooling (DRCP). To use DRCP, this value should be set to -; the same string for all web servers running the same application, -; the database pool must be configured, and the connection string must -; specify to use a pooled server. -;oci8.connection_class = - -; High Availability: Using On lets PHP receive Fast Application -; Notification (FAN) events generated when a database node fails. The -; database must also be configured to post FAN events. -;oci8.events = Off - -; Tuning: This option enables statement caching, and specifies how -; many statements to cache. Using 0 disables statement caching. -; https://php.net/oci8.statement-cache-size -;oci8.statement_cache_size = 20 - -; Tuning: Enables row prefetching and sets the default number of -; rows that will be fetched automatically after statement execution. -; https://php.net/oci8.default-prefetch -;oci8.default_prefetch = 100 - -; Tuning: Sets the amount of LOB data that is internally returned from -; Oracle Database when an Oracle LOB locator is initially retrieved as -; part of a query. Setting this can improve performance by reducing -; round-trips. -; https://php.net/oci8.prefetch-lob-size -; oci8.prefetch_lob_size = 0 - -; Compatibility. Using On means oci_close() will not close -; oci_connect() and oci_new_connect() connections. -; https://php.net/oci8.old-oci-close-semantics -;oci8.old_oci_close_semantics = Off - [PostgreSQL] ; Allow or prevent persistent links. ; https://php.net/pgsql.allow-persistent diff --git a/php.ini-production b/php.ini-production index 89b383622520..56b0905f2e09 100644 --- a/php.ini-production +++ b/php.ini-production @@ -947,13 +947,10 @@ default_socket_timeout = 60 ;extension=mbstring ;extension=exif ; Must be after mbstring as it depends on it ;extension=mysqli -;extension=oci8_12c ; Use with Oracle Database 12c Instant Client -;extension=oci8_19 ; Use with Oracle Database 19 Instant Client ;extension=odbc ;extension=openssl ;extension=pdo_firebird ;extension=pdo_mysql -;extension=pdo_oci ;extension=pdo_odbc ;extension=pdo_pgsql ;extension=pdo_sqlite @@ -1244,66 +1241,6 @@ mysqlnd.collect_memory_statistics = Off ; key. ;mysqlnd.sha256_server_public_key = -[OCI8] - -; Connection: Enables privileged connections using external -; credentials (OCI_SYSOPER, OCI_SYSDBA) -; https://php.net/oci8.privileged-connect -;oci8.privileged_connect = Off - -; Connection: The maximum number of persistent OCI8 connections per -; process. Using -1 means no limit. -; https://php.net/oci8.max-persistent -;oci8.max_persistent = -1 - -; Connection: The maximum number of seconds a process is allowed to -; maintain an idle persistent connection. Using -1 means idle -; persistent connections will be maintained forever. -; https://php.net/oci8.persistent-timeout -;oci8.persistent_timeout = -1 - -; Connection: The number of seconds that must pass before issuing a -; ping during oci_pconnect() to check the connection validity. When -; set to 0, each oci_pconnect() will cause a ping. Using -1 disables -; pings completely. -; https://php.net/oci8.ping-interval -;oci8.ping_interval = 60 - -; Connection: Set this to a user chosen connection class to be used -; for all pooled server requests with Oracle Database Resident -; Connection Pooling (DRCP). To use DRCP, this value should be set to -; the same string for all web servers running the same application, -; the database pool must be configured, and the connection string must -; specify to use a pooled server. -;oci8.connection_class = - -; High Availability: Using On lets PHP receive Fast Application -; Notification (FAN) events generated when a database node fails. The -; database must also be configured to post FAN events. -;oci8.events = Off - -; Tuning: This option enables statement caching, and specifies how -; many statements to cache. Using 0 disables statement caching. -; https://php.net/oci8.statement-cache-size -;oci8.statement_cache_size = 20 - -; Tuning: Enables row prefetching and sets the default number of -; rows that will be fetched automatically after statement execution. -; https://php.net/oci8.default-prefetch -;oci8.default_prefetch = 100 - -; Tuning: Sets the amount of LOB data that is internally returned from -; Oracle Database when an Oracle LOB locator is initially retrieved as -; part of a query. Setting this can improve performance by reducing -; round-trips. -; https://php.net/oci8.prefetch-lob-size -; oci8.prefetch_lob_size = 0 - -; Compatibility. Using On means oci_close() will not close -; oci_connect() and oci_new_connect() connections. -; https://php.net/oci8.old-oci-close-semantics -;oci8.old_oci_close_semantics = Off - [PostgreSQL] ; Allow or prevent persistent links. ; https://php.net/pgsql.allow-persistent