Commit 94c71f4b authored by konstantin@mysql.com's avatar konstantin@mysql.com

Another implementation of send_eof() cleanup

parent dc696d2e
...@@ -313,6 +313,7 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message) ...@@ -313,6 +313,7 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message)
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
static char eof_buff[1]= { (char) 254 }; /* Marker for end of fields */
/* /*
Send eof (= end of result set) to the client Send eof (= end of result set) to the client
...@@ -339,12 +340,11 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message) ...@@ -339,12 +340,11 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message)
void void
send_eof(THD *thd, bool no_flush) send_eof(THD *thd, bool no_flush)
{ {
static char eof_buff[1]= { (char) 254 }; /* Marker for end of fields */
NET *net= &thd->net; NET *net= &thd->net;
DBUG_ENTER("send_eof"); DBUG_ENTER("send_eof");
if (net->vio != 0) if (net->vio != 0)
{ {
if (!no_flush && (thd->client_capabilities & CLIENT_PROTOCOL_41)) if (thd->client_capabilities & CLIENT_PROTOCOL_41)
{ {
uchar buff[5]; uchar buff[5];
uint tmp= min(thd->total_warn_count, 65535); uint tmp= min(thd->total_warn_count, 65535);
...@@ -384,9 +384,8 @@ send_eof(THD *thd, bool no_flush) ...@@ -384,9 +384,8 @@ send_eof(THD *thd, bool no_flush)
bool send_old_password_request(THD *thd) bool send_old_password_request(THD *thd)
{ {
static char buff[1]= { (char) 254 };
NET *net= &thd->net; NET *net= &thd->net;
return my_net_write(net, buff, 1) || net_flush(net); return my_net_write(net, eof_buff, 1) || net_flush(net);
} }
#endif /* EMBEDDED_LIBRARY */ #endif /* EMBEDDED_LIBRARY */
...@@ -585,7 +584,7 @@ bool Protocol::send_fields(List<Item> *list, uint flag) ...@@ -585,7 +584,7 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
#endif #endif
} }
send_eof(thd, 1); my_net_write(&thd->net, eof_buff, 1);
DBUG_RETURN(prepare_for_send(list)); DBUG_RETURN(prepare_for_send(list));
err: err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment