ID: 45763
User updated by: michael dot kofler at gmx dot com
Reported By: michael dot kofler at gmx dot com
Status: Assigned
Bug Type: MySQLi related
Operating System: linux
PHP Version: 5.3.0alpha1
Assigned To: johannes
New Comment:
also does not work with PDO:
$sql = "SELECT 1; SELECT 2; SELECT 3";
$result = $conn->query($sql);
do {
echo "<p>----\n";
$rowset = $result->fetch(PDO::FETCH_NUM);
foreach($rowset as $row) {
echo "<p>$row[0]";
}
} while($result->nextRowset());
Expected result (which I get with libmysql)
----
1
----
2
----
3
Actual result (with myslqnd, apparently only the first SQL command is
evaluated)
----
1
Previous Comments:
------------------------------------------------------------------------
[2008-08-09 07:52:08] [EMAIL PROTECTED]
Hmm, I'm wrong its more tricky.
More like - first execution fails, second and all after work fine. It
does not matter if you use the procedural or OO interface.
The test does not catch it because it first does parameter tests (e.g.
mysqli_multi_query($link, "") - expected to fail) before it runs a
query. And "runs a query" is the second function call.
But anyway Johannes, if its not in the inner workings of mysqlnd
itself, try to shield Andrey from PHP works.
Ulf
------------------------------------------------------------------------
[2008-08-09 07:34:53] [EMAIL PROTECTED]
Works with the procedural interface, use procedural style until fix has
been committed.
Re-assigning to Johannes. Andrey is busy with non-PHP work at the
moment. Johannes please have a look
------------------------------------------------------------------------
[2008-08-09 00:21:13] [EMAIL PROTECTED]
Assigning to primary maintainer
------------------------------------------------------------------------
[2008-08-08 13:44:27] michael dot kofler at gmx dot com
Description:
------------
mysqli::multi_query returns FALSE if more than one query is given
Reproduce code:
---------------
$mysqli = new mysqli($mysqlhost, $mysqluser, $mysqlpasswd, $mysqldb);
$sql = "SELECT 1; SELECT 2; SELECT 3";
$ok = $mysqli->multi_query($sql);
if($ok === FALSE) {
echo $mysqli->error();
}
Expected result:
----------------
non (because $ok === TRUE)
(works with mysqli + libmysql)
Actual result:
--------------
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '; SELECT
2; SELECT 3' at line 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45763&edit=1