Bug #72969 [Opn->Csd]: SET ROWCOUNT returns no result
| From: | adambaratz@php.net | Date: | Fri, 27 Jan 2017 23:49:51 +0000 |
| Subject: | Bug #72969 [Opn->Csd]: SET ROWCOUNT returns no result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206988@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72969&edit=1
ID: 72969
Updated by: adambaratz@php.net
Reported by: plebrun at wayfair dot com
Summary: SET ROWCOUNT returns no result
-Status: Open
+Status: Closed
Type: Bug
Package: PDO DBlib
Operating System: CentOS7
PHP Version: 7.0Git-2016-08-29 (Git)
-Assigned To:
+Assigned To: adambaratz
Block user comment: N
Private report: N
New Comment:
This was not an issue with pdo_dblib, but rather with FreeTDS. FreeTDS has been fixed as of the
fc820490336c50d5c175d2a15327383256add4c9 on that repo. Corresponding tests were pushed to our master
branch (f45e6364b46d40a747d183ee11cbaa5c8743a141).
Previous Comments:
------------------------------------------------------------------------
[2016-08-29 20:14:05] plebrun at wayfair dot com
Description:
------------
Using SET ROWCOUNT does not return a result set (which could be expected), but it also affects the
rowcounts of other queries. The same with SET NOCOUNT ON. I would expect one of the following
behaviors:
1. Return empty resultset with columnCount() = 0 and rowCount() = -1; call to nextRowset() returns
true
2. Does not return any resultset BUT ALSO doesn't affect other queries.
See example below.
Test script:
---------------
<?php
$db = new \PDO("dblib:host=server;dbname=database", "username",
"password");
$stmt = $db->query("SET ROWCOUNT 10; INSERT INTO tbl VALUES (1, 'a'), (2,
'b');");
var_dump($stmt->rowCount());
var_dump($stmt->nextRowset());
var_dump($stmt->rowCount());
?>
Expected result:
----------------
int(-1)
bool(true)
int(2)
Actual result:
--------------
int(-1)
bool(false)
int(-1)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72969&edit=1