php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3552 Ora_Error causes fake "not connected to Oracle" error to remote database
Submitted: 2000-02-21 14:24 UTC Modified: 2005-03-31 16:13 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: joop dot vriend at ddnh dot nl Assigned:
Status: Wont fix Package: Oracle related
PHP Version: 3.0.12 OS: Linux 2.2.10 SMP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joop dot vriend at ddnh dot nl
New email:
PHP Version: OS:

 

 [2000-02-21 14:24 UTC] joop dot vriend at ddnh dot nl
We use the following function (in a "library" file we include with PHP at the top of a page) to parse and execute a query on an Oracle-database:

function ParseExec($conn, $curs, $query) {
	if (! $conn)
		ErrorClose("<BR><BR><B>ERROR:</B> GEEN VERBINDING!!!");

	if (ora_Parse($curs, $query, 0) == -1)
		ErrorClose("<BR><BR><B>ERROR:</B> SQL parse error");

	// Bewaar de evt. parse error
	$orcl_error = ora_Error($curs);

	if (! ora_Exec($curs)) {
		if (strstr($orcl_error, "ORA-00000")) $orcl_error = ora_Error($curs);
		$fout  = "<BR><BR><B>ERROR:</B> Execute error\n\n";
		$fout .= "<BR><BR><B>QUERY:</B> " . $query . "\n\n";
		$fout .= "<BR><BR><B>ORACLE ERROR:</B> " . $orcl_error . "\n\n";
		if ($conn && ! ora_RollBack($conn))
			$fout .= "<BR><BR><B>ERROR:</B> Could not rollback\n\n";
		ErrorClose($fout);
	}
}

If we use this function with a database on the same machine (Ora_Logon without TNSNAME), there is no problem. If we are connected to a remote database (Ora_Logon with a TNSNAME) the Ora_Error statement -- $orcl_error = ora_Error($curs); -- causes the Ora_Exec statement to give the following error message (mind the OPARSE !):

ORA-03114: not connected to ORACLE -- while processing OCI function OPARSE

If we comment out the Ora_Error statement, the problem does not occur.

I have not checked whether this problem also exists with PHP 3.0.14. If it does not, sorry for the inconvenience and I would appreciate it very much if you would tell me.

This is our configure line:

./configure --with-apache=/usr/src/apache --with-gd=/usr/src/gd --with-oracle=/u01/app/oracle/product/8.0.5 --with-pgsql --with-dbase=yes --with-config-file-path=/usr/local/apache/conf --enable-debug=no --enable-track-vars=yes --enable-magic-quotes=yes


Joop Vriend
DD&H Internet Vision
Enschede, The Netherlands

Keep up the good work!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-31 16:13 UTC] php-bugs at lists dot php dot net
We are sorry, but we do not support PHP 3 related problems anymore.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 18:01:34 2024 UTC