From 1d062682f5098ea5c30b9b3fef844195790a095e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Nov 2007 10:37:07 +0400 Subject: Bug #32624 Error with multi queries in MySQL embedded server 5.1.22. server status wasn't properly sent to the client after the error by the embedded server. Wasn't noticed before as one usually stopped retrieving results after he gets an error. libmysqld/lib_sql.cc: Bug #32624 Error with multi queries in MySQL embedded server 5.1.22. server status transferred to the client after errors sql/protocol.cc: Bug #32624 Error with multi queries in MySQL embedded server 5.1.22. set server status before net_send_error_packet() call as this function sends it to the client in the embedded server tests/mysql_client_test.c: Bug #32624 Error with multi queries in MySQL embedded server 5.1.22. testcase added --- sql/protocol.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql/protocol.cc') diff --git a/sql/protocol.cc b/sql/protocol.cc index 2bdbe83eea1..ac562a9f5ab 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -110,13 +110,14 @@ void net_send_error(THD *thd, uint sql_errno, const char *err) push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, sql_errno, err); } + /* Abort multi-result sets */ + thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS; + net_send_error_packet(thd, sql_errno, err); thd->is_fatal_error=0; // Error message is given thd->net.report_error= 0; - /* Abort multi-result sets */ - thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS; DBUG_VOID_RETURN; } -- cgit v1.2.1