summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index c1fc1ce8643..420912b0b63 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -88,12 +88,13 @@ void net_send_error(THD *thd, uint sql_errno, const char *err)
*/
thd->main_da.can_overwrite_status= TRUE;
+ /* Abort multi-result sets */
+ thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
+
net_send_error_packet(thd, sql_errno, err);
thd->main_da.can_overwrite_status= FALSE;
- /* Abort multi-result sets */
- thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
DBUG_VOID_RETURN;
}
@@ -272,7 +273,10 @@ void net_send_error_packet(THD *thd, uint sql_errno, const char *err)
{
NET *net= &thd->net;
uint length;
- uchar buff[MYSQL_ERRMSG_SIZE+2], *pos;
+ /*
+ buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + MYSQL_ERRMSG_SIZE:512
+ */
+ uchar buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
DBUG_ENTER("send_error_packet");