Bug #64055 [Opn->Fbk]: nextRowset() returns false
Edit report at https://bugs.php.net/bug.php?id=64055&edit=1
ID: 64055
Updated by: cmb@php.net
Reported by: kenji dot uui at gmail dot com
Summary: nextRowset() returns false
-Status: Open
+Status: Feedback
Type: Bug
Package: PDO MySQL
Operating System: Ubuntu
PHP Version: 5.3.21
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I cannot reproduce this; I get 3 result sets (PHP-7.3 and PHP-7.4
on Windows with mysqlnd). Does this fail for you with any of the
actively supported PHP versions[1]?
[1] <https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2013-01-23 11:03:15] kenji dot uui at gmail dot com
Description:
------------
The below code expects 3 result sets, but only 2 returned.
Test script:
---------------
<?php
$db = new PDO('mysql:host=localhost;dbname=information_schema', 'root',
'');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = <<<SQL
SELECT * FROM CHARACTER_SETS WHERE CHARACTER_SET_NAME = 'sjis';
SELECT * FROM CHARACTER_SETS WHERE CHARACTER_SET_NAME = 'utf8';
SELECT * FROM CHARACTER_SETS WHERE CHARACTER_SET_NAME = 'ujis';
SQL;
$result = $db->query($sql);
$i = 1;
do {
echo "<br />";
echo "Result set ", $i++, ":\n";
print_r($result->fetchAll());
} while ($result->nextRowset());
Expected result:
----------------
Result set 1: Array ( [0] => Array ( [CHARACTER_SET_NAME] => sjis [0] => sjis
[DEFAULT_COLLATE_NAME] => sjis_japanese_ci [1] => sjis_japanese_ci [DESCRIPTION] =>
Shift-JIS Japanese [2] => Shift-JIS Japanese [MAXLEN] => 2 [3] => 2 ) )
Result set 2: Array ( [0] => Array ( [CHARACTER_SET_NAME] => utf8 [0] => utf8
[DEFAULT_COLLATE_NAME] => utf8_general_ci [1] => utf8_general_ci [DESCRIPTION] => UTF-8
Unicode [2] => UTF-8 Unicode [MAXLEN] => 3 [3] => 3 ) )
Result set 3: Array ( [0] => Array ( [CHARACTER_SET_NAME] => ujis [0] => ujis
[DEFAULT_COLLATE_NAME] => ujis_japanese_ci [1] => ujis_japanese_ci [DESCRIPTION] => EUC-JP
Japanese [2] => EUC-JP Japanese [MAXLEN] => 3 [3] => 3 ) )
Actual result:
--------------
Result set 1: Array ( [0] => Array ( [CHARACTER_SET_NAME] => sjis [0] => sjis
[DEFAULT_COLLATE_NAME] => sjis_japanese_ci [1] => sjis_japanese_ci [DESCRIPTION] =>
Shift-JIS Japanese [2] => Shift-JIS Japanese [MAXLEN] => 2 [3] => 2 ) )
Result set 2: Array ( [0] => Array ( [CHARACTER_SET_NAME] => utf8 [0] => utf8
[DEFAULT_COLLATE_NAME] => utf8_general_ci [1] => utf8_general_ci [DESCRIPTION] => UTF-8
Unicode [2] => UTF-8 Unicode [MAXLEN] => 3 [3] => 3 ) )
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64055&edit=1
Thread (4 messages)