From:             berlioz at nicematin dot fr
Operating system: Linux (All ?)
PHP version:      5.2.6
PHP Bug Type:     PDO related
Bug description:  PDO(OCI)::fetchAll with stream (CLOB) : resource contains 
always same value

Description:
------------
in PDO_OCI when you retrieve records from a table with a CLOB field using
fetchAll(), fetchAll() returns different resource ids but they all contain
the same datas from the last record of the set. Other fields are ok.

if you loop with fetch it works fine.



Reproduce code:
---------------
$conn = new PDO("oci:dbname=".$tns,$db_username,$db_password);

$stmt=$conn->query('select * from my_table_with_clob');

$records=$stmt->fetchAll(PDO::FETCH_ASSOC);

print_r($records);

foreach($records as $record)
{
        echo "my_clob=".stream_get_contents($record['MY_CLOB'])."\n";
}

Expected result:
----------------
my_clob=Data from record 0
my_clob=Data from record 1
my_clob=Data from record 2
my_clob=Data from record 3
my_clob=Data from record 4

Actual result:
--------------
my_clob=Data from record 4
my_clob=Data from record 4
my_clob=Data from record 4
my_clob=Data from record 4
my_clob=Data from record 4

-- 
Edit bug report at http://bugs.php.net/?id=46728&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=46728&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=46728&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=46728&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=46728&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46728&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=46728&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=46728&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=46728&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=46728&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=46728&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=46728&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=46728&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=46728&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=46728&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=46728&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=46728&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=46728&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=46728&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=46728&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=46728&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=46728&r=mysqlcfg

Reply via email to