diff options
Diffstat (limited to 'libmysqld')
-rw-r--r-- | libmysqld/lib_sql.cc | 25 | ||||
-rw-r--r-- | libmysqld/lib_vio.c | 2 |
2 files changed, 16 insertions, 11 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 323bf42cf92..a633d6f583b 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -74,6 +74,9 @@ bool lib_dispatch_command(enum enum_server_command command, NET *net, { THD *thd=(THD *) net->vio->dest_thd; thd->store_globals(); // Fix if more than one connect + thd->net.last_error[0]=0; // Clear error message + thd->net.last_errno=0; + net_new_transaction(&thd->net); return dispatch_command(command, thd, (char *) arg, length + 1); } @@ -83,17 +86,17 @@ bool lib_dispatch_command(enum enum_server_command command, NET *net, void lib_connection_phase(NET * net, int phase) { - THD * thd; - thd = (THD *)(net->vio->dest_thd); - if (thd) - { - switch (phase) - { - case 2: - check_connections2(thd); - break; - } - } + THD * thd; + thd = (THD *)(net->vio->dest_thd); + if (thd) + { + switch (phase) + { + case 2: + check_connections2(thd); + break; + } + } } } void start_embedded_conn1(NET * net) diff --git a/libmysqld/lib_vio.c b/libmysqld/lib_vio.c index 35deaf8d090..fd4eb4ac29f 100644 --- a/libmysqld/lib_vio.c +++ b/libmysqld/lib_vio.c @@ -139,6 +139,8 @@ int vio_read(Vio * vio, gptr buf, int size) uint4korr(vio->packets + sizeof(char *)); vio->packets = *(char **)vio->packets; } + if (vio->where_in_packet + size > vio->end_of_packet) + size = vio->end_of_packet - vio->where_in_packet; memcpy(buf, vio->where_in_packet, size); vio->where_in_packet += size; return (size); |