PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » MDB » Bug #718

oci8 fetchInto ->causing some values are overwritten

Details

Submitted2004-02-09 18:28 UTC
Fromthierry dot bo at netcourrier dot com
Assignedlsmith
StatusClosed
PackageMDB
PHP Version4.3.2
OSWin32 XP
Roadmaps(Not assigned)

Comments

[2004-02-09 18:28 UTC] thierry dot bo at netcourrier dot com

Description:
------------
[MDB1.x, latest cvs]

Hi,

I use $mdb->fetchInto, with MDB_FETCHMODE_ORDERED (default). In spite of that, I experience the bug described here http://www.php.net/manual/en/function.ocifetchinto.php
read :

>>>>>>
Guillaume Cocatre-Zilgien
18-Dec-2003 10:39
The use of ocifetchinto() with the OCI_ASSOC parameter is not suitable for queries with aliased columns: the columns' real names, *not* their aliases, are used as keys in the associative array, causing some values to be overwritten.

<?php
$sql = "select a.id, b.id from ref a, library b where a.id = b.id";
// ...parsed and executed...
ocifetchinto($stmt, $row, OCI_ASSOC);
/* print_r($row) will return only one value instead of two:
Array
(
[ID] => 948
)
*/
?>
<<<<<

Reading the oci8 fetchInto code, it appears that even if we use MDB_FETCHMODE_ORDERED, there is some code that use OCI_ASSOC:
&& @OCIFetchInto($result, $buffer, OCI_ASSOC+OCI_RETURN_NULLS)

Thierry Bothorel