php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47845 PDO_Firebird omits first row from query
Submitted: 2009-03-31 08:03 UTC Modified: 2009-04-03 22:14 UTC
From: piotrt at itisit dot pl Assigned:
Status: Closed Package: PDO related
PHP Version: 5.2.9 OS: Windows XP
Private report: No CVE-ID: None
 [2009-03-31 08:03 UTC] piotrt at itisit dot pl
Description:
------------
PDO_Firebird omits first row from query.

Reproduce code:
---------------
First create sample table:
CREATE TABLE PDO_BUG(
  ID Integer NOT NULL,
  TEXTFIELD Varchar(20),
  NUMFIELD Numeric(18,2),
  PRIMARY KEY (ID)
);
INSERT INTO PDO_BUG (ID, TEXTFIELD, NUMFIELD) VALUES ('1', 'val1', '992831.00');
INSERT INTO PDO_BUG (ID, TEXTFIELD, NUMFIELD) VALUES ('2', 'val2', '488111.00');
INSERT INTO PDO_BUG (ID, TEXTFIELD, NUMFIELD) VALUES ('3', 'val3', '1109911.00');

 $dbh = new PDO('firebird:dbname=localhost:database','SYSDBA','masterkey');
 $sql = "select * from PDO_BUG order by ID" ;
 $stm = $dbh->prepare($sql);
 $stm->execute();
 $result = $stm->fetchAll(PDO::FETCH_ASSOC);
 print_r($result);

Expected result:
----------------
$result should containt 3 rows from query.

Actual result:
--------------
First row is omitted. I already tried different methods (with or without prepare, fetching single rows etc.). I didn't find a way to make PDO return all rows from query including first one.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-03 10:56 UTC] felipe@php.net
I can reproduce it. This just was fixed in 5.3+ (bug #35386)

 [2009-04-03 22:14 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

The fix has been backported to 5.2CVS.


Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC