Bug 1381905

Summary: php-mssql: After first query to MSSQL (DBLIB) all the other queries return null values
Product: [Fedora] Fedora EPEL Reporter: Martin Lindner <mlindner>
Component: php-extrasAssignee: Dmitry Butskoy <dmitry>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: epel7CC: dmitry, fedora
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-05 14:15:45 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:

Description Martin Lindner 2016-10-05 10:53:01 UTC
Description of problem:
-----------------------
One of our dev teams is moving an application from RHEL 6.8 / PHP 5.3.3 to RHEL 7.2 / PHP 5.4.16. 

They ran into the the following upstream PHP bug:
https://bugs.php.net/bug.php?id=64522

We can reproduce the issue with our in-house code and also with the simple test script from the upstream bug.

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
php.x86_64                  5.4.16-36.3.el7_2      @rhel-7-server-rpms
php-pdo.x86_64              5.4.16-36.3.el7_2      @rhel-7-server-rpms
php-mssql.x86_64            5.4.16-4.el7           @epel 

How reproducible:
-----------------
Run the following test script (from upstream bug) against Microsoft SQL server (tested with 2012 SP3):

$pdo=new PDO('dblib:host=db;dbname=admin;charset=UTF-8',$username,$password);

$statement=$pdo->query('select 1+1 as result');
print_r($statement->fetchAll());
$statement->closeCursor();

$statement=$pdo->query('select 1+1 as result');
print_r($statement->fetchAll());


Actual results:
---------------
Array
(
    [0] => Array
        (
            [result] => 2
            [0] => 2
        )

)
Array
(
    [0] => Array
        (
            [result] => 2
            [0] => 2
        )

)

Expected results:
-----------------
Array
(
    [0] => Array
        (
            [result] => 2
            [0] => 2
        )

)
Array
(
)

Additional info:
----------------
-

Thanks a lot for looking into this.

Kind regards,
Martin

Comment 1 Remi Collet 2016-10-05 14:15:45 UTC

*** This bug has been marked as a duplicate of bug 1381442 ***

Comment 2 Martin Lindner 2016-10-05 15:01:33 UTC
Hi Remi, I originally had a ticket with RH support about this - until realizing that the affected library (pdo_dblib.so) is in in php-mssql / EPEL and not in php-pdo.

Unfortunately I didn't notice that support already had bug 1381442 open.

Sorry about the duplicate, thanks a lot for the quick fix!