From ec0fb660d7ac9d62374926e0e3f025a48975e806 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Mon, 21 Mar 2016 11:00:35 +0100 Subject: [PATCH] MDEV-9058: protocol: COM_MULTI command (post-post-review changes) Now we do not swap buffers back but just free old one. --- sql/sql_parse.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2f3e20a9744..6211bcc02a8 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2230,7 +2230,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, /* We have to store next length because it will be destroyed by '\0' */ uint next_subpacket_length= uint3korr(packet); unsigned char *readbuff= net->buff; - unsigned long readbuff_max_packet= net->max_packet; if (net_allocate_new_packet(net, thd, MYF(0))) break; @@ -2266,13 +2265,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, } com_multi_end: - /* restore buffer to the original one */ + /* release old buffer */ DBUG_ASSERT(net->buff == net->write_pos); // nothing to send - my_free(net->buff); - net->buff= readbuff; - net->max_packet= readbuff_max_packet; - net->buff_end=net->buff + net->max_packet; - net->write_pos=net->read_pos = net->buff; + my_free(readbuff); } break; }