Commit 24728104 authored by serg@serg.mylan's avatar serg@serg.mylan

Fixed crash if max_connections is exceeded. BUG#8996

parent 35f0c372
...@@ -1432,6 +1432,7 @@ void close_connection(THD *thd, uint errcode, bool lock) ...@@ -1432,6 +1432,7 @@ void close_connection(THD *thd, uint errcode, bool lock)
errcode ? ER(errcode) : "")); errcode ? ER(errcode) : ""));
if (lock) if (lock)
(void) pthread_mutex_lock(&LOCK_thread_count); (void) pthread_mutex_lock(&LOCK_thread_count);
thd->killed=1;
if ((vio=thd->net.vio) != 0) if ((vio=thd->net.vio) != 0)
{ {
if (errcode) if (errcode)
......
...@@ -122,8 +122,9 @@ void send_error(THD *thd, uint sql_errno, const char *err) ...@@ -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)); VOID(net_write_command(net,(uchar) 255, "", 0, (char*) err,length));
#endif /* EMBEDDED_LIBRARY*/ #endif /* EMBEDDED_LIBRARY*/
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, sql_errno, if (!thd->killed)
orig_err ? orig_err : ER(sql_errno)); 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->is_fatal_error=0; // Error message is given
thd->net.report_error= 0; thd->net.report_error= 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment