#36318 [Fbk->Opn]: Core Dump when using bindParam with PDO_OCI

From: Date: Tue, 07 Feb 2006 12:55:43 +0000
Subject: #36318 [Fbk->Opn]: Core Dump when using bindParam with PDO_OCI
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93013@lists.php.net to get a copy of this message
 ID:               36318
 User updated by:  bernhard dot hari at multisports dot ch
 Reported By:      bernhard dot hari at multisports dot ch
-Status:           Feedback
+Status:           Open
 Bug Type:         PDO related
 Operating System: RedHat Linux Enterprise 4 Upd 2
 PHP Version:      5.1.2
 New Comment:

Version: php5.1-200602071130
[harb@mdsl03 dataAccessComponent]$ /opt/php5.1-latest/bin/php
Test.class.php
Segmentation fault (core dumped)
[harb@mdsl03 dataAccessComponent]$ /opt/php5.1-latest/bin/php
--version
PHP 5.1.3-dev (cli) (built: Feb  7 2006 12:40:50)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies


Previous Comments:
------------------------------------------------------------------------

[2006-02-07 13:26:48] tony2001@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip



------------------------------------------------------------------------

[2006-02-07 13:18:00] bernhard dot hari at multisports dot ch

Description:
------------
When using a named parameters array, PDO_OCI crashes.
--> using bindParam() = crash
--> using bindValue() = works (also with 5.1.2)

The following code works fine in 5.1.0. But fails with 5.1.1, 5.1.2 and
the snapshot php5.1-200602070530.

This Bug is similar to #35671.

System:
RedHat Enterprise Linux 4 Update 2.
Oracle 10gr2 (10.2.0.1) with Patch 4516865
(Patch solves wrong permissions after installation.)
Same compile options, configuration and environment for all tested PHP
Versions.

Reproduce code:
---------------
$database = new PDO('oci:','scott','tiger');
$database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);

$query = "select machine from v\$session where osuser = :username";
$statement = $database->prepare($query);
$username = 'harb';

//$statement->bindValue(':username', $username);
$statement->bindParam(':username', $username);
//$statement->bindParam(':username', $username,
PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT);

$result = $statement->execute();
if($result == true) {
   $rows = $statement->fetchAll(PDO::FETCH_NUM);
   print_r($rows);
} else {
   print_r($statement->errorInfo());
}

Expected result:
----------------
The (local) machine hostname.

e.g.
Array
(
    [0] => Array
        (
            [0] => mdsl03
        )

)

Actual result:
--------------
[harb@mdsl03 dataAccessComponent]$ /opt/php5.1.0/bin/php Test.php
Array
(
    [0] => Array
        (
            [0] => mdsl03
        )
)
[harb@mdsl03 dataAccessComponent]$ php Test.php
Segmentation fault (core dumped)
[harb@mdsl03 dataAccessComponent]$ php --version
PHP 5.1.2 (cli) (built: Jan 26 2006 08:55:32)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36318&edit=1


Thread (9 messages)

« previous php.bugs (#93013) next »