PHP 4.0 Bug #4784 Updated: ocilogoff fails when using clobs and mod_perl
| From: | Bug Database | Date: | Fri, 02 Jun 2000 19:20:05 +0000 |
| Subject: | PHP 4.0 Bug #4784 Updated: ocilogoff fails when using clobs and mod_perl | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-20087@lists.php.net to get a copy of this message | ||
ID: 4784
User Update by: dave.dunkin@vista.com
Status: Open
Bug Type: Oracle related
Description: ocilogoff fails when using clobs and mod_perl
The following scripts will reproduce the problem:
lobtest.php3:
<?php
//ociinternaldebug(1);
echo "connecting to the database<br>\n";
flush();
$conn = ociplogon("scott", "tiger", "dbhost");
echo "creating table 'lobs'<br>\n";
flush();
$sql = "create table lobs (lob CLOB)";
$stmt = ociparse($conn, $sql);
ociexecute($stmt);
ocifreestatement($stmt);
echo "inserting 'test' into 'lob' in 'lobs'<br>\n";
flush();
$sql = "insert into lobs (lob) values (EMPTY_CLOB()) returning lob into :lob";
$clob = ocinewdescriptor($conn, OCI_D_LOB);
$stmt = ociparse($conn, $sql);
ocibindbyname($stmt, ":lob", &$clob, -1, OCI_B_CLOB);
ociexecute($stmt, OCI_DEFAULT);
$clob->save("test");
ocicommit($conn);
flush();
ocifreedescriptor($clob);
ocifreestatement($stmt);
/*
echo "retreiving 'lob' from 'lobs'<br>\n";
flush();
$sql = "select lob from lobs";
$stmt = ociparse($conn, $sql);
ociexecute($stmt);
ocifetchinto($stmt, &$row, OCI_ASSOC);
$lob = $row["LOB"]->load();
ocifreestatement($stmt);
echo "value of 'lob': ".$lob."<br>\n";
flush();
*/
echo "dropping table 'lobs'<br>\n";
flush();
$sql = "drop table lobs";
$stmt = ociparse($conn, $sql);
ociexecute($stmt);
ocifreestatement($stmt);
echo "disconnecting from the database<br>\n";
flush();
ocilogoff($conn);
ociinternaldebug(0);
?>
dbdconnect.cgi:
#!/usr/bin/perl
use DBI;
use DBD::Oracle;
$ENV{ORACLE_HOME} = "/usr/oracle";
print "Content-Type: text/plain\n\n";
print "Connecting to the database\n";
my $dbh = DBI->connect("dbi:Oracle:", "scott/tiger\@dbhost", "");
print "Connected.\n";
print "Disconnecting.\n";
$dbh->disconnect();
print "Disconnected.\n";
exit(0);
dbdconnect.cgi MUST be run in mod_perl for the failure to occur. It works okay as a CGI.
To reproduce the problem, run lobtest.php3 (to show that it works) then dbdconnect.cgi, then
lobtest.php3 again.
mod_perl is compiled:
perl Makefile.PL ALL_HOOKS=1 EVERYTHING=1 USE_APXS=1 WITH_APXS=/usr/local/apache/bin/apxs
PHP is compiled:
./configure --with-oracle --with-apxs=/usr/local/apache/bin/apxs
--with-config-file-path=/usr/local/apache
DBI version 1.13
DBD::Oracle version 1.03
We are also using Raven SSL 1.4.1.
Full Bug description available at: http://bugs.php.net/version4/?id=4784