|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #70020 Make mysqli->multi_query use separate packets
Submitted: 2015-07-08 11:20 UTC Modified: 2017-04-06 09:52 UTC
From: mail at tomsommer dot dk Assigned:
Status: Wont fix Package: MySQLi related
PHP Version: 5.6.10 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-07-08 11:20 UTC] mail at tomsommer dot dk
When executing a large query through mysqli->multi_query() you can hit MySQL's max_allowed_packet setting, because all queries are sent as one packet, rather than one query per packet.

Test script:
$largefiledata = file_get_contents('10G.sql');


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-06 09:52 UTC]
-Status: Open +Status: Wont fix
 [2017-04-06 09:52 UTC]
doing this would require parsing the string, as a MySQL package only allows complete commands. Also the client doesn't know the servers max packet size, making it hard to find the optimal splitting. Thirdly we'd have an issue with error situations. If sent in one big query the server won't continue after an error with the remaining items. To emulate this behaviour we'd have to wait for the response from first batch, till we can send the next batch.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon May 29 09:03:40 2023 UTC