php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25818 Valid select using OCI8 causes integer overflow error in Oracle
Submitted: 2003-10-10 05:32 UTC Modified: 2003-12-06 07:12 UTC
From: iolaire dot mckinnon at vcint dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.3.3 OS: RedHat Linux 9
Private report: No CVE-ID: None
 [2003-10-10 05:32 UTC] iolaire dot mckinnon at vcint dot com
Description:
------------
I'm using Redhat 9, connecting to a Oracle 8.7.1 db. I have the following PHP configuration:
 './configure' '--with-iodbc' '--with-mssql=/usr/local' '--sysconfdir=/etc' '--with-mysql' '--with-layout=GNU' '--with-gettext' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-config-file-path=/etc/' '--enable-ftp' '--enable-memory-limit' '--enable-xslt' '--with-xslt-sablot' '--with-oracle=/store/OraHome1' '--with-oci8=/store/OraHome1'

I connect successfully to the db using OCI8, but when I perform any select, I get an "ORA-03120: two-task conversion routine: integer overflow" error. This occurs even if I am only selecting one row. I can successfully select using the same query with the standard Oracle interface, and with SQLPlus. I also had this problem with php-4.3.2.


Reproduce code:
---------------
putenv("ORACLE_SID=REP");
putenv("ORACLE_HOME=/store/OraHome1");
putenv("TNS_ADMIN=/store/tnsnames.ora");
OCIInternalDebug(1);
$username = "MCKINNONI";
$passwd = "xxxxxxx";
$db="(DESCRIPTION=
          (ADDRESS_LIST=
            (ADDRESS=
              (PROTOCOL=TCP)
              (HOST=xxxx)(PORT=1521)
            )
          )
           (CONNECT_DATA=(SERVICE_NAME=REP))
     )";
$conn = OCILogon($username,$passwd,$db);
$stmt = ociparse($conn,"select EMAIL from SpinroomEmailAddresses where EMAIL = 'iolaire.mckinnon@vc
int.com'");
ociexecute($stmt);
while (ocifetch($stmt))
   echo "[".ociresult($stmt,"EMAIL")."]\n";



Expected result:
----------------
[iolaire.mckinnon@vcint.com]

Actual result:
--------------
OCIDebug: _oci_open_server new conn=0 dname=(DESCRIPTION=
          (ADDRESS_LIST=
            (ADDRESS=
              (PROTOCOL=TCP)
              (HOST=xxxx)(PORT=1521)
            )
          )
           (CONNECT_DATA=(SERVICE_NAME=REP))
     )<br />
OCIDebug: _oci_open_session new sess=5 user=MCKINNONI<br />
OCIDebug: oci_do_connect: id=6<br />
OCIDebug: oci_parse "select EMAIL from SpinroomEmailAddresses where EMAIL = 'iolaire.mckinnon@vcint.com'" id=7 conn=6<br />

Warning: ociexecute(): OCIStmtExecute: ORA-03120: two-task conversion routine: integer overflow
 in /var/www/html/oracletest2.php on line 21
OCIDebug: START php_rshutdown_oci<br />
OCIDebug: END   php_rshutdown_oci<br />


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-10 06:57 UTC] sniper@php.net
Setting those environment variables in script is not gonna work, they need to be set BEFORE apache/php is started.

 [2003-10-10 08:17 UTC] iolaire dot mckinnon at vcint dot com
I have the variables I'm putenv()ing there in SetEnv (httpd.conf) and export (.bash_profile) as well. It hasn't made a difference. The oracle is not running locally therefore the other comments regarding shared oracle/httpd groups don't appear to apply in this case. I compiled against Oracle 9r2.
 [2003-10-10 11:46 UTC] sniper@php.net
See bug #19304. Is the remote oracle running on Solaris perhaps?

 [2003-10-10 12:57 UTC] iolaire dot mckinnon at vcint dot com
Yes, the database is running on Solaris 8. As mentioned, there's no problem with standard oracle, only OCI8.
 [2003-10-17 03:00 UTC] cjbj at hotmail dot com
ORA-03120 has sometimes been seen with cross-version or cross-platform
Oracle connections.  I think it might also have been seen in some
obscure case when the characters sets differed on the client and
server.  Are you using a view or a dblink?  Have you relinked PHP with 
your most recent Oracle client libraries?

Maybe if you gave the Oracle version(s) and the datatype of the EMAIL
column someone else might be able to identify what it happening.

The comments in http://bugs.php.net/bug.php?id=19304 about contacting
Oracle Support and checking Metalink are good suggestions.
 [2003-10-28 10:11 UTC] iolaire dot mckinnon at vcint dot com
I'm using a view. PHP is linked against the latest Oracle (9r2). I'm talking with Oracle now to see what they find.
 [2003-12-06 07:12 UTC] thies@php.net
please ask oracle-support. i don't see anything we could 
do to fix this in php (it's either yourr setup or a bug 
in oracle)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC