summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index a490c63fa79..0f38c45729e 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -2584,7 +2584,7 @@ int my_message_sql(uint error, const char *str, myf MyFlags)
TODO: There are two exceptions mechanism (THD and sp_rcontext),
this could be improved by having a common stack of handlers.
*/
- if (thd->handle_error(error,
+ if (thd->handle_error(error, str,
MYSQL_ERROR::WARN_LEVEL_ERROR))
DBUG_RETURN(0);
@@ -2594,7 +2594,7 @@ int my_message_sql(uint error, const char *str, myf MyFlags)
DBUG_RETURN(0);
}
- thd->query_error= 1; // needed to catch query errors during replication
+ thd->is_slave_error= 1; // needed to catch query errors during replication
if (!thd->no_warnings_for_error)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str);
@@ -4303,6 +4303,7 @@ void create_thread_to_handle_connection(THD *thd)
}
else
{
+ char error_message_buff[MYSQL_ERRMSG_SIZE];
/* Create new thread to handle connection */
int error;
thread_created++;
@@ -4321,7 +4322,10 @@ void create_thread_to_handle_connection(THD *thd)
thd->killed= THD::KILL_CONNECTION; // Safety
(void) pthread_mutex_unlock(&LOCK_thread_count);
statistic_increment(aborted_connects,&LOCK_status);
- net_printf_error(thd, ER_CANT_CREATE_THREAD, error);
+ /* Can't use my_error() since store_globals has not been called. */
+ my_snprintf(error_message_buff, sizeof(error_message_buff),
+ ER(ER_CANT_CREATE_THREAD), error);
+ net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff);
(void) pthread_mutex_lock(&LOCK_thread_count);
close_connection(thd,0,0);
delete thd;