Bug #77823 [NEW]: Constant MYSQL_ATTR_MULTI_STATEMENTS not supported
| From: | alan at aondra dot com | Date: | Fri, 29 Mar 2019 16:20:32 +0000 |
| Subject: | Bug #77823 [NEW]: Constant MYSQL_ATTR_MULTI_STATEMENTS not supported | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-220250@lists.php.net to get a copy of this message | ||
From: alan at aondra dot com
Operating system: Windows 10 x64
PHP version: 7.3.3
Package: PDO MySQL
Bug Type: Bug
Bug description:Constant MYSQL_ATTR_MULTI_STATEMENTS not supported
Description:
------------
PDO does not support running multiple queries out of the box. Installed
7.3.3 x64 TS. This also goes back to at least 7.3.0.
Test script:
---------------
$db = new PDO($dsn, $username, $password, [
PDO::ATTR_EMULATE_PREPARES => true,
PDO::ATTR_AUTOCOMMIT => false,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_MULTI_STATEMENTS => true,
]);
// mysqlnd 5.0.12-dev - 20150407 - $Id:
7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $
echo $db->getAttribute(PDO::ATTR_CLIENT_VERSION) . PHP_EOL;
// PDOException#0: SQLSTATE[IM001]: Driver does not support this
function: driver does not support that attribute
echo $db->getAttribute(PDO::MYSQL_ATTR_MULTI_STATEMENTS) . PHP_EOL;
$stmt = $db->query('SELECT 1; SELECT 2;');
// SELECT 1; SELECT 2;
echo $stmt->queryString . PHP_EOL;
Expected result:
----------------
I expect that the query be executed as multiple queries, with each
result being a rowset, and each rowset having a non-zero number of rows.
Actual result:
--------------
An empty result, or a PDOException being thrown for multiple queries
being incorrect syntax (depending on other configurations).
--
Edit bug report at https://bugs.php.net/bug.php?id=77823&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77823&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77823&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77823&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77823&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77823&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77823&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77823&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77823&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77823&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77823&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77823&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77823&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77823&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77823&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77823&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77823&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77823&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77823&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77823&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77823&r=mysqlcfg