Bug #62820 [Opn->Csd]: mysqlnd API incompatability breaks PDOStatement->nextRowset()

From: Date: Wed, 09 Dec 2020 15:49:55 +0000
Subject: Bug #62820 [Opn->Csd]: mysqlnd API incompatability breaks PDOStatement->nextRowset()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230963@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62820&edit=1 ID: 62820 Updated by: nikic@php.net Reported by: nikic@php.net Summary: mysqlnd API incompatability breaks PDOStatement->nextRowset() -Status: Open +Status: Closed Type: Bug Package: PDO MySQL PHP Version: master-Git-2012-08-14 (Git) -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: The original hypothesis here was incorrect, and various rowset handling issues have recently been fixed, so I think it's safe to close this one. Previous Comments: ------------------------------------------------------------------------ [2013-03-24 15:38:48] nikic@php.net Just looked at the code again, what I said above is wrong. The code checks mysql_more_results() before (http://lxr.php.net/xref/PHP_TRUNK/ext/pdo_mysql/mysql_statement.c#414), so it should not be related to the return value of mysql_next_result(). Something else is wrong. ------------------------------------------------------------------------ [2012-08-14 18:29:18] nikic@php.net Related bug report: https://bugs.php.net/bug.php?id=62803 ------------------------------------------------------------------------ [2012-08-14 18:28:31] nikic@php.net 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 this bug report at https://bugs.php.net/bug.php?id=62820&edit=1

« previous php.bugs (#230963) next »