From ba05aef9306f3cac9a7280c8197b7eda5fda29c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Mar 2005 13:59:28 +0100 Subject: Fixed crash if max_connections is exceeded. BUG#8996 sql/mysqld.cc: mark the thread as killed in close_connection sql/protocol.cc: don't bother remembering warnings if the thread is dying --- 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 4cecd016553..6bec4dbe47f 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -122,8 +122,9 @@ void send_error(THD *thd, uint sql_errno, const char *err) } VOID(net_write_command(net,(uchar) 255, "", 0, (char*) err,length)); #endif /* EMBEDDED_LIBRARY*/ - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, sql_errno, - orig_err ? orig_err : ER(sql_errno)); + if (!thd->killed) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, sql_errno, + orig_err ? orig_err : ER(sql_errno)); thd->is_fatal_error=0; // Error message is given thd->net.report_error= 0; -- cgit v1.2.1 From 2934567449504594cfc378aa7ff964de8df1faf7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Mar 2005 16:45:19 +0100 Subject: additional safety --- 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 6bec4dbe47f..773bbe697a3 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -252,8 +252,9 @@ net_printf(THD *thd, uint errcode, ...) strmake(net->last_error, text_pos, length); strmake(net->sqlstate, mysql_errno_to_sqlstate(errcode), SQLSTATE_LENGTH); #endif - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, errcode, - text_pos ? text_pos : ER(errcode)); + if (!thd->killed) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, errcode, + text_pos ? text_pos : ER(errcode)); thd->is_fatal_error=0; // Error message is given DBUG_VOID_RETURN; } -- cgit v1.2.1