Bug #75201 [NEW]: 0-column rowsets not identified
| From: | fandrieu at gmail dot com | Date: | Wed, 13 Sep 2017 08:22:13 +0000 |
| Subject: | Bug #75201 [NEW]: 0-column rowsets not identified | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-211117@lists.php.net to get a copy of this message | ||
From: fandrieu at gmail dot com
Operating system: Linux
PHP version: Irrelevant
Package: PDO DBlib
Bug Type: Bug
Bug description:0-column rowsets not identified
Description:
------------
This is a follow up to the bug #69592 about skipping 0-column rowsets
I've been using the suggested "if ($statement->columnCount())"
workaround to avoid this problem, but it doesn't work after a non empty
rowset: columnCount is not set correctly and reports the column count of
the previous rowset.
Test script:
---------------
$pdo = new PDO("dblib:host=<host>;dbname=<dbname>", "username",
"password");
$stmt = $pdo->query("
SET NOCOUNT ON
SELECT 1
SET NOCOUNT ON
SELECT 1
");
do
{
echo "columns: " . $stmt->columnCount() . "\n";
print_r($stmt->fetchAll(PDO::FETCH_ASSOC));
}
while ($stmt->nextRowset());
Expected result:
----------------
[with bug #69592]
columns: 0
Array
(
)
columns: 1
Array
(
[0] => Array
(
[computed] => 1
)
)
columns: 0
Array
(
)
columns: 1
Array
(
[0] => Array
(
[computed] => 1
)
)
Actual result:
--------------
columns: 0
Array
(
)
columns: 1
Array
(
[0] => Array
(
[computed] => 1
)
)
columns: 1
Array
(
)
columns: 1
Array
(
[0] => Array
(
[computed] => 1
)
)
--
Edit bug report at https://bugs.php.net/bug.php?id=75201&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75201&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75201&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75201&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75201&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75201&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75201&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75201&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75201&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75201&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75201&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75201&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75201&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75201&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75201&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75201&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75201&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75201&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75201&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75201&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75201&r=mysqlcfg