Bug #81286 [NEW]: PDO return phantom rowset and no error when MYSQL_ATTR_USE_BUFFERED_QUERY=FALSE

From: Date: Sat, 24 Jul 2021 12:30:27 +0000
Subject: Bug #81286 [NEW]: PDO return phantom rowset and no error when MYSQL_ATTR_USE_BUFFERED_QUERY=FALSE
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235315@lists.php.net to get a copy of this message
From: tropicano at ukr dot net Operating system: All PHP version: 7.4.21 Package: PDO MySQL Bug Type: Bug Bug description:PDO return phantom rowset and no error when MYSQL_ATTR_USE_BUFFERED_QUERY=FALSE Description: ------------ Unexpected phantom rowset and no error when PDO::MYSQL_ATTR_USE_BUFFERED_QUERY = FALSE. When PDO::MYSQL_ATTR_USE_BUFFERED_QUERY = TRUE then result expected. Test script: --------------- $db = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass, [PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => FALSE]); $qr = $db->query('SELECT IF(1, (SELECT 1 UNION ALL SELECT 2), 0)'); print_r($db->errorInfo()); // here is no error if ($qr) { print_r($qr->errorInfo()); // here is no error too $qr->nextRowset(); // return false; print_r($qr->errorInfo()); // here is no error again } Expected result: ---------------- Array ( [0] => 21000 [1] => 1242 [2] => Subquery returns more than 1 row ) Actual result: -------------- Array ( [0] => 00000 [1] => [2] => ) Array ( [0] => 00000 [1] => [2] => ) Array ( [0] => 00000 [1] => [2] => ) -- Edit bug report at https://bugs.php.net/bug.php?id=81286&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=81286&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=81286&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=81286&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=81286&r=needscript Try newer version: https://bugs.php.net/fix.php?id=81286&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=81286&r=support Expected behavior: https://bugs.php.net/fix.php?id=81286&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=81286&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=81286&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=81286&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=81286&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=81286&r=dst IIS Stability: https://bugs.php.net/fix.php?id=81286&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=81286&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=81286&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=81286&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=81286&r=mysqlcfg

« previous php.bugs (#235315) next »