|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43139 PDO ignore ATTR_DEFAULT_FETCH_MODE in some cases
Submitted: 2007-10-30 11:49 UTC Modified: 2007-10-31 12:58 UTC
From: develar at gmail dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5.2.4 OS: Windows XP SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: develar at gmail dot com
New email:
PHP Version: OS:


 [2007-10-30 11:49 UTC] develar at gmail dot com
In 5.2.4 (earlier all worked) and 5.2.5RC2dev (I now use this version) PDO ignore ATTR_DEFAULT_FETCH_MODE.

PostgreSQL 8.2.4 and 8.3beta1.

Reproduce code:

$Db = new PDO('pgsql:host=localhost;dbname=test', 'postgres', 'password');

print_r($Db->query('select 0 as name, 1 as table, 2 as schema')->fetchAll(PDO::FETCH_GROUP));


Expected result:
    [0] => Array
            [0] => Array
                    [table] => 1
                    [schema] => 2



Actual result:
    [0] => Array
            [0] => Array
                    [table] => 1
                    [0] => 1
                    [schema] => 2
                    [1] => 2




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-30 14:29 UTC] stochnagara at hotmail dot com
I have a similar problem with 5.2.4 on a linux/mysql installation. The things worked on 5.2.0. The only difference is that I have a class that overrides PDOStatement and there I use $this->setFetchMode (PDO::FETCH_OBJ) which is not taken into account if FETCH_OBJ is not explicitly set in further fetch/fetchAll calls.
 [2007-10-31 12:58 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 24 07:03:43 2023 UTC