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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mail at tomsommer dot dk
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sat Dec 21 12:01:31 2024 UTC