Ensure we do not send an empty query, if a single query is larger than the max_allowed_packet setting. This way, we most probably get disconnected anyway, but that clearly leaves responsibility to the user to make the query smaller.

This commit is contained in:
Ansgar Becker
2012-12-31 10:33:32 +00:00
parent 65d7e2ffab
commit 551864a06c

View File

@ -2629,7 +2629,7 @@ begin
BatchStartOffset := FBatch[i].LeftOffset;
while i < FBatch.Count do begin
PacketSize := FBatch[i].RightOffset - BatchStartOffset + ((i-FBatchPosition) * 20);
if PacketSize >= MaxAllowedPacket then begin
if (PacketSize >= MaxAllowedPacket) and (SQL <> '') then begin
// TODO: Log('Limiting batch packet size to '+FormatByteNumber(Length(SQL))+' with '+FormatNumber(i-FUserQueryOffset)+' queries.', lcDebug);
break;
end;