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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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: Thu Apr 25 20:01:45 2024 UTC