From:             kenji dot uui at gmail dot com
Operating system: Ubuntu
PHP version:      5.3.21
Package:          PDO related
Bug Type:         Bug
Bug description:nextRowset() returns false

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 bug report at https://bugs.php.net/bug.php?id=64055&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64055&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64055&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64055&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64055&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64055&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64055&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64055&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64055&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64055&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64055&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64055&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64055&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64055&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64055&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64055&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64055&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64055&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64055&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64055&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64055&r=mysqlcfg

Reply via email to