From: info at programmiernutte dot net
Operating system: no matter
PHP version: 5.3.0RC1
PHP Bug Type: PDO related
Bug description: Only the date fields of the first row are fetched, others are
empty
Description:
------------
PDO::fetch() only returns date fields on the first call.
subsequent calls return empty strings instead of dates.
Configure Command => './configure' '--
prefix=/usr/local/php' '--with-apxs2' '--without-pdo-sqlite'
'--without-mysql'
php.ini-settings don't seem to matter, I only have these:
date.timezone = "Europe/Berlin"
include_path = "/Library/WebServer/php-includes/"
allow_call_time_pass_reference = Off
expose_php = Off
magic_quotes_gpc = Off
register_argc_argv = Off
output_buffering = On
plus settings for xdebug, apc and memcache, I already tried
disabling them, no difference.
PDO_FIREBIRD is loaded as an
extension:extension=pdo_firebird.so
Reproduce code:
---------------
isql:
SQL> create database 'test.fdb';
SQL> CREATE TABLE FOO (ID INTEGER, BAR DATE);
SQL> INSERT INTO FOO (ID, BAR) VALUES ('1', '11.04.2009');
SQL> INSERT INTO FOO (ID, BAR) VALUES ('2', '12.04.2009');
SQL> INSERT INTO FOO (ID, BAR) VALUES ('3', '13.04.2009');
php:
<?php
$oPDO = new PDO(
'firebird:dbname=localhost:test.fdb;charset=ISO8859_1',
'sysdba',
'masterkey',
array(
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ
)
);
$oStmt = $oPDO->query('select id, bar from foo');
foreach($oStmt as $oRow)
{
var_dump($oRow);
}
?>
Expected result:
----------------
object(stdClass)#3 (2) {
["ID"]=>
string(1) "1"
["BAR"]=>
string(10) "2009-04-11"
}
object(stdClass)#4 (2) {
["ID"]=>
string(1) "2"
["BAR"]=>
string(10) "2009-04-12"
}
object(stdClass)#3 (2) {
["ID"]=>
string(1) "3"
["BAR"]=>
string(10) "2009-04-13"
}
Actual result:
--------------
object(stdClass)#3 (2) {
["ID"]=>
string(1) "1"
["BAR"]=>
string(10) "2009-04-11"
}
object(stdClass)#4 (2) {
["ID"]=>
string(1) "2"
["BAR"]=>
string(0) ""
}
object(stdClass)#3 (2) {
["ID"]=>
string(1) "3"
["BAR"]=>
string(0) ""
}
--
Edit bug report at http://bugs.php.net/?id=48057&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48057&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48057&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48057&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48057&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48057&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48057&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48057&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48057&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48057&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48057&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48057&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48057&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48057&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48057&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48057&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48057&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48057&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48057&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48057&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48057&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48057&r=mysqlcfg