diff options
author | unknown <konstantin@mysql.com> | 2004-02-10 18:33:06 +0300 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2004-02-10 18:33:06 +0300 |
commit | 98216bc9d4a65bd133d9a374fd3fe77d8c333d33 (patch) | |
tree | 3a66440121ea574316055b9956e6de92a67eff16 /sql/protocol.cc | |
parent | f709bc18607a52d280e13aab3fb0a29ff09a214b (diff) | |
download | mariadb-git-98216bc9d4a65bd133d9a374fd3fe77d8c333d33.tar.gz |
Another implementation of send_eof() cleanup
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r-- | sql/protocol.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index bef567ad346..40adc9e8961 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -313,6 +313,7 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message) DBUG_VOID_RETURN; } +static char eof_buff[1]= { (char) 254 }; /* Marker for end of fields */ /* 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) void send_eof(THD *thd, bool no_flush) { - static char eof_buff[1]= { (char) 254 }; /* Marker for end of fields */ NET *net= &thd->net; DBUG_ENTER("send_eof"); if (net->vio != 0) { - if (!no_flush && (thd->client_capabilities & CLIENT_PROTOCOL_41)) + if (thd->client_capabilities & CLIENT_PROTOCOL_41) { uchar buff[5]; uint tmp= min(thd->total_warn_count, 65535); @@ -384,9 +384,8 @@ send_eof(THD *thd, bool no_flush) bool send_old_password_request(THD *thd) { - static char buff[1]= { (char) 254 }; 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 */ @@ -585,7 +584,7 @@ bool Protocol::send_fields(List<Item> *list, uint flag) #endif } - send_eof(thd, 1); + my_net_write(&thd->net, eof_buff, 1); DBUG_RETURN(prepare_for_send(list)); err: |