From 9d5d847835475f9195c0b9a3e83d2e9770f1b7b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 24 Feb 2005 13:56:09 +0100 Subject: Fixed BUG#8638: Test 'sp' fails: Stored Procedure often sends warning 1329 The warning sent is by itself ok, the problem was rather why it wasn't sent on some other platforms... The real problem was that a total_warn_count which was inconsistent with warn_list was sent back with send_eof() during SP execution, which in turn cause a protocol error in mysqltest. mysql-test/r/sp.result: Updated results after fixing bug in how total_warn_count is handled. sql/protocol.cc: Fixed bug that caused protocol errors with mysqltest. Don't send total_warn_count with send_eof() during SP execution, as it's usually wrong anyway. (warn_list is cleared) sql/sql_parse.cc: Reset total_warn_count if the warn_list has been cleared. This gets rid of "empty" warnings after some CALLs. --- sql/sql_parse.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sql/sql_parse.cc') diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 9a1b2eb0430..6e28f5bcefb 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4185,6 +4185,12 @@ unsent_create_error: thd->row_count_func= 0; res= sp->execute_procedure(thd, &lex->value_list); + /* If warnings have been cleared, we have to clear total_warn_count + * too, otherwise the clients get confused. + */ + if (thd->warn_list.is_empty()) + thd->total_warn_count= 0; + thd->variables.select_limit= select_limit; #ifndef NO_EMBEDDED_ACCESS_CHECKS sp_restore_security_context(thd, sp, &save_ctx); -- cgit v1.2.1