|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-01-27 23:49 UTC] adambaratz@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: adambaratz
[2017-01-27 23:49 UTC] adambaratz@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 14:00:01 2025 UTC |
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)