php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63466 PDO_MYSQL ignores PDO::FETCH_ORI_ABS in PDOStatement::fetch()
Submitted: 2012-11-08 09:48 UTC Modified: 2021-09-27 16:31 UTC
Votes:16
Avg. Score:4.6 ± 0.7
Reproduced:15 of 15 (100.0%)
Same Version:2 (13.3%)
Same OS:7 (46.7%)
From: vicrry at yahoo dot com dot hk Assigned:
Status: Open Package: PDO MySQL
PHP Version: 5.4.8 OS: CentOS
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vicrry at yahoo dot com dot hk
New email:
PHP Version: OS:

 

 [2012-11-08 09:48 UTC] vicrry at yahoo dot com dot hk
Description:
------------
When fetching with PDO::FETCH_ORI_ABS from MySQL with PDOStatement::fetch(), the 
driver silently swallows the options and work as if I passed PDO::FETCH_ORI_NEXT.

Test script:
---------------
$stmt = $pdo->prepare('SELECT * FROM table', array(
  PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL
));

$stmt->execute();

$row = $stmt->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_ABS, 5);

Expected result:
----------------
The sixth row returned.

Actual result:
--------------
The first row returned.

Patches

patch_against_5.3.3 (last revision 2013-05-02 19:46 UTC by brianj at technews dot co dot za)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-30 16:08 UTC] uw@php.net
-Type: Bug +Type: Feature/Change Request
 [2013-01-30 16:08 UTC] uw@php.net
If its a bug, its a docs bug. Where in the PDO spec is written that every PDO driver has to support random flags of other drivers? I do not remember anything like that. Nonetheless the docs create the impression this is the case.
 [2017-10-24 08:33 UTC] kalle@php.net
-Package: PDO related +Package: PDO MySQL
 [2021-09-27 16:31 UTC] cmb@php.net
> Where in the PDO spec is written that every PDO driver has to
> support random flags of other drivers?

These flags are not driver specific, but rather general.  That
does not imply, that these flags need to be supported, though.

Anyhow, I'm not sure whether this can be implemented for
PDO_MySQL; the attached patch calls mysqlnd_stmt_seek() which
apparently was never implemented.
 [2023-01-09 12:06 UTC] sheyda dot babi5161 at gmail dot com
I have the same problem and really know ***** I do not know what to do I can not find a solution help me  (https://www.hyveehuddle.net/)github.com
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 14 02:01:27 2024 UTC