Bug 1381442

Summary: php-pdo: No results when re-executing PDO dblib query using same variable
Product: [Fedora] Fedora EPEL Reporter: Masaharu Kawada <mkawada>
Component: php-extrasAssignee: Remi Collet <fedora>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: epel7CC: menthos, mlindner, rcollet
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: php-extras-5.4.16-5.el7 php-extras-5.4.16-7.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-25 02:52:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test script to reproduce the issue listed in the Description of problem section. none

Description Masaharu Kawada 2016-10-04 06:35:23 UTC
Created attachment 1207088 [details]
Test script to reproduce the issue listed in the Description of problem section.

Description of problem:

A customer hits the issue described in the following upstream bug report and he wants us to backport the patch to fix it.

https://bugs.php.net/bug.php?id=64328
https://bugs.php.net/bug.php?id=64522

Version-Release number of selected component (if applicable):

php-5.4.16-36.3.el7_2.x86_64
php-pdo-5.4.16-36.3.el7_2.x86_64 

How reproducible:

Always

Steps to Reproduce:

Run the attached test script provided by the customer

Actual results:

# php testit.php 
---------------------------------------------------------------------------------------------------------------------------------------
No results are returned from dblib PDO::query() + PDOStatement::fetchAll() if the same variable is re-used from a previous query/fetch.
---------------------------------------------------------------------------------------------------------------------------------------
Result after first query execution : 
Array
(
    [0] => Array
        (
            [result] => 2
            [0] => 2
        )

)

Result after second query execution : 
Array
(
)

Expected results:

Results are returned from dblib PDO::query() + PDOStatement::fetchAll() if the different variables are used for query/fetch.
----------------------------------------------------------------------------------------------------------------------------
Result after first query execution : 
Array
(
    [0] => Array
        (
            [result] => 2
            [0] => 2
        )

)

Result after second query execution : 
Array
(
    [0] => Array
        (
            [result] => 2
            [0] => 2
        )

)

Additional info:

Comment 2 Remi Collet 2016-10-04 11:46:11 UTC
These upstream bugs are related to pdo_dblib which is not provides in RHEL, so which cannot be supported.


Changing component to EPEL / php-extras which provides this extension.

Comment 3 Fedora Update System 2016-10-05 13:19:28 UTC
php-extras-5.4.16-5.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-5529730b10

Comment 4 Remi Collet 2016-10-05 14:15:45 UTC
*** Bug 1381905 has been marked as a duplicate of this bug. ***

Comment 5 Remi Collet 2016-10-05 14:16:33 UTC
@Dmitry, thanks for this quick fix (you was faster than me)

Comment 6 Fedora Update System 2016-10-21 15:51:11 UTC
php-extras-5.4.16-5.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Dmitry Butskoy 2016-11-07 17:00:48 UTC
Remi,

some regression reported: bug #1390201

Could you look onto it?

Comment 8 Remi Collet 2016-11-08 08:14:35 UTC
@Dmitry, I need a Microsoft SQL server... not so easy for me...

Comment 9 Fedora Update System 2016-11-08 09:43:18 UTC
php-extras-5.4.16-6.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-f876dc4049

Comment 10 Fedora Update System 2016-11-10 04:20:11 UTC
php-extras-5.4.16-7.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-f876dc4049

Comment 11 Fedora Update System 2016-11-25 02:52:16 UTC
php-extras-5.4.16-7.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.