From:             nikic
Operating system: 
PHP version:      master-Git-2012-08-14 (Git)
Package:          PDO related
Bug Type:         Bug
Bug description:mysqlnd API incompatability breaks PDOStatement->nextRowset()

Description:
------------
When the mysqlnd driver is used PDOStatement->nextRowset() does not return
bool(false) when there are no more result sets. This causes several test 
failures, which all have a diff looking similar to this:

    008+
    009+ Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error
in %s/bug_41997.php on line 11
    010+ array(0) {
    011+ }

This can be traced down to mysql_next_result() returning 0 instead of -1 in
http://lxr.php.net/xref/PHP_TRUNK/ext/pdo_mysql/mysql_statement.c#415.

The reason is that (when using mysqlnd) mysql_next_result is aliased to
mysqlnd_next_result, but both have different APIs: The mysqlnd_ version
only returns PASS = 0 or FAIL = 1, whereas the mysql_ version returns -1 if
the call worked, but there were no more resultsets.

This is documented at
http://dev.mysql.com/doc/refman/5.0/en/mysql-next-result.html in the
"Return Values" section. The default mysqlnd next_result implementation is
here: http://lxr.php.net/xref/PHP_TRUNK/ext/mysqlnd/mysqlnd.c#2100.


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

Reply via email to