提交 1799d910 编写于 作者: R Ryuta Kamizono

`bytes_margin` is only needed when `previous_packet` exists

上级 7020c6f9
...@@ -145,15 +145,12 @@ def max_allowed_packet_reached?(current_packet, previous_packet) ...@@ -145,15 +145,12 @@ def max_allowed_packet_reached?(current_packet, previous_packet)
elsif previous_packet.nil? elsif previous_packet.nil?
true true
else else
(current_packet.bytesize + previous_packet.bytesize) > max_allowed_packet (current_packet.bytesize + previous_packet.bytesize + 2) > max_allowed_packet
end end
end end
def max_allowed_packet def max_allowed_packet
@max_allowed_packet ||= begin @max_allowed_packet ||= show_variable("max_allowed_packet")
bytes_margin = 2
show_variable("max_allowed_packet") - bytes_margin
end
end end
def exec_stmt_and_free(sql, name, binds, cache_stmt: false) def exec_stmt_and_free(sql, name, binds, cache_stmt: false)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册