php.net |  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
3 + 47 = ?
Subscribe to this entry?

 
 [2015-07-08 11:20 UTC] mail at tomsommer dot dk
Description:
------------
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');
$mysqli->multi_query($largefiledata);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-06 09:52 UTC] johannes@php.net
-Status: Open +Status: Wont fix
 [2017-04-06 09:52 UTC] johannes@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 19:01:30 2024 UTC