php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72488 PDO Dblib doesn't work with multiple rowsets
Submitted: 2016-06-24 13:55 UTC Modified: 2016-09-25 04:22 UTC
Votes:6
Avg. Score:4.3 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:0 (0.0%)
Same OS:3 (50.0%)
From: jamesking56 at me dot com Assigned:
Status: No Feedback Package: PDO DBlib
PHP Version: 5.6.23 OS: Centos 7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-06-24 13:55 UTC] jamesking56 at me dot com
Description:
------------
When I call an MSSQL stored procedure using PDO DBLIB that returns multiple rowsets, When I request the next row set, PDO throws an exception.

The same query using sqlsrv in a Windows environment works as normal.

Test script:
---------------
<?php

$pdo = new PDO('dblib:server=example.com,dbname=db1', 'user', 'password');
$stmt = $pdo->prepare('EXEC [dbo].[spProcedure] ?,?,?');
$stmt->bindParam(1, 'test');
$stmt->bindParam(2, 'test');
$stmt->bindParam(3, 'test');

$stmt->execute();

$result = $stmt->fetch();

$stmt->nextRowset();

$result2 = $stmt->fetch();

Actual result:
--------------
SQLSTATE[HY000]: General error: PDO_DBLIB: dbresults() returned FAIL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-12 22:24 UTC] adambaratz@php.net
I've successfully run queries that produce multiple rowsets. There's also a test that should cover this case:
https://github.com/php/php-src/blob/master/ext/pdo_dblib/tests/bug_68957.phpt

Sometimes dbresults() errors occur when there's an issue with the query itself. Do you have any more details on the query itself?

Alternatively, you could test this statement:
'SELECT 1; SELECT 2; SELECT 3;'
 [2016-09-14 21:48 UTC] adambaratz@php.net
-Status: Open +Status: Feedback
 [2016-09-25 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 16:01:28 2024 UTC