summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 1dc6b22c6ac..b5edf084b53 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -827,9 +827,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
pos--;
packet_length--;
}
- *pos=0;
- if (!(thd->query= (char*) thd->memdup((gptr) (packet),packet_length)))
+ if (!(thd->query= (char*) thd->memdup((gptr) (packet),packet_length+1)))
break;
+ thd->query[packet_length]=0;
thd->packet.shrink(net_buffer_length); // Reclaim some memory
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),QUERY_PRIOR);