php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64055 nextRowset() returns false
Submitted: 2013-01-23 11:03 UTC Modified: 2014-01-01 12:34 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: kenji dot uui at gmail dot com Assigned:
Status: Open Package: PDO MySQL
PHP Version: 5.3.21 OS: Ubuntu
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-01-23 11:03 UTC] 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 ) ) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-01 12:34 UTC] felipe@php.net
-Package: PDO related +Package: PDO MySQL
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Wed Apr 26 11:01:42 2017 UTC