summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorpem@mysql.com <>2004-02-10 18:44:02 +0100
committerpem@mysql.com <>2004-02-10 18:44:02 +0100
commitc8585f3283816dea04c28774ef87537521b6aa80 (patch)
treef04786f8a211a4c03eab547b7332792201289ac1 /sql/protocol.cc
parent5344528b0034f0254d4c72b203c5888f1c8526c2 (diff)
parent9de20058342fa7387071a3d70291a26db2e210c0 (diff)
downloadmariadb-git-c8585f3283816dea04c28774ef87537521b6aa80.tar.gz
Merge 4.1 into 5.0.
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 89aa7203e17..4be74c74134 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -128,7 +128,7 @@ void send_error(THD *thd, uint sql_errno, const char *err)
/* Abort multi-result sets */
thd->lex->found_colon= 0;
- thd->server_status= ~SERVER_MORE_RESULTS_EXISTS;
+ thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
DBUG_VOID_RETURN;
}
@@ -326,6 +326,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
@@ -352,12 +353,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 && !net->no_send_eof)
{
- 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);
@@ -369,7 +369,7 @@ send_eof(THD *thd, bool no_flush)
other queries (see the if test in dispatch_command / COM_QUERY)
*/
if (thd->is_fatal_error)
- thd->server_status= ~SERVER_MORE_RESULTS_EXISTS;
+ thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
int2store(buff+3, thd->server_status);
VOID(my_net_write(net,(char*) buff,5));
VOID(net_flush(net));
@@ -397,9 +397,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 */
@@ -598,7 +597,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: