don't use session locale for the error log
This commit is contained in:
parent
9cb0bb1de0
commit
aebd16201f
@ -3418,7 +3418,7 @@ err:
|
|||||||
if (!write_error)
|
if (!write_error)
|
||||||
{
|
{
|
||||||
write_error= 1;
|
write_error= 1;
|
||||||
sql_print_error(ER_THD(thd, ER_ERROR_ON_WRITE), name, errno);
|
sql_print_error(ER_DEFAULT(ER_ERROR_ON_WRITE), name, errno);
|
||||||
}
|
}
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -829,7 +829,7 @@ err:
|
|||||||
ER_THD(thd, ER_JSON_HISTOGRAM_PARSE_FAILED),
|
ER_THD(thd, ER_JSON_HISTOGRAM_PARSE_FAILED),
|
||||||
db_name, table_name,
|
db_name, table_name,
|
||||||
err, (je.s.c_str - (const uchar*)hist_data));
|
err, (je.s.c_str - (const uchar*)hist_data));
|
||||||
sql_print_error(ER_THD(thd, ER_JSON_HISTOGRAM_PARSE_FAILED),
|
sql_print_error(ER_DEFAULT(ER_JSON_HISTOGRAM_PARSE_FAILED),
|
||||||
db_name, table_name, err,
|
db_name, table_name, err,
|
||||||
(je.s.c_str - (const uchar*)hist_data));
|
(je.s.c_str - (const uchar*)hist_data));
|
||||||
|
|
||||||
|
@ -1038,7 +1038,7 @@ void partition_info::vers_check_limit(THD *thd)
|
|||||||
table->s->db.str, table->s->table_name.str,
|
table->s->db.str, table->s->table_name.str,
|
||||||
vers_info->hist_part->partition_name.str, "LIMIT");
|
vers_info->hist_part->partition_name.str, "LIMIT");
|
||||||
|
|
||||||
sql_print_warning(ER_THD(thd, WARN_VERS_PART_FULL),
|
sql_print_warning(ER_DEFAULT(WARN_VERS_PART_FULL),
|
||||||
table->s->db.str, table->s->table_name.str,
|
table->s->db.str, table->s->table_name.str,
|
||||||
vers_info->hist_part->partition_name.str, "LIMIT");
|
vers_info->hist_part->partition_name.str, "LIMIT");
|
||||||
}
|
}
|
||||||
|
@ -1188,8 +1188,7 @@ bool Master_info_index::init_all_master_info()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Master_info already in HASH */
|
/* Master_info already in HASH */
|
||||||
sql_print_error(ER_THD_OR_DEFAULT(current_thd,
|
sql_print_error(ER_DEFAULT(ER_CONNECTION_ALREADY_EXISTS),
|
||||||
ER_CONNECTION_ALREADY_EXISTS),
|
|
||||||
(int) connection_name.length, connection_name.str,
|
(int) connection_name.length, connection_name.str,
|
||||||
(int) connection_name.length, connection_name.str);
|
(int) connection_name.length, connection_name.str);
|
||||||
mi->unlock_slave_threads();
|
mi->unlock_slave_threads();
|
||||||
@ -1207,8 +1206,7 @@ bool Master_info_index::init_all_master_info()
|
|||||||
Sql_condition::WARN_LEVEL_NOTE))
|
Sql_condition::WARN_LEVEL_NOTE))
|
||||||
{
|
{
|
||||||
/* Master_info was already registered */
|
/* Master_info was already registered */
|
||||||
sql_print_error(ER_THD_OR_DEFAULT(current_thd,
|
sql_print_error(ER_DEFAULT(ER_CONNECTION_ALREADY_EXISTS),
|
||||||
ER_CONNECTION_ALREADY_EXISTS),
|
|
||||||
(int) connection_name.length, connection_name.str,
|
(int) connection_name.length, connection_name.str,
|
||||||
(int) connection_name.length, connection_name.str);
|
(int) connection_name.length, connection_name.str);
|
||||||
mi->unlock_slave_threads();
|
mi->unlock_slave_threads();
|
||||||
|
@ -13326,7 +13326,7 @@ static void login_failed_error(THD *thd)
|
|||||||
*/
|
*/
|
||||||
if (global_system_variables.log_warnings > 1)
|
if (global_system_variables.log_warnings > 1)
|
||||||
{
|
{
|
||||||
sql_print_warning(ER_THD(thd, access_denied_error_code(thd->password)),
|
sql_print_warning(ER_DEFAULT(access_denied_error_code(thd->password)),
|
||||||
thd->main_security_ctx.user,
|
thd->main_security_ctx.user,
|
||||||
thd->main_security_ctx.host_or_ip,
|
thd->main_security_ctx.host_or_ip,
|
||||||
thd->password ? ER_THD(thd, ER_YES) : ER_THD(thd, ER_NO));
|
thd->password ? ER_THD(thd, ER_YES) : ER_THD(thd, ER_NO));
|
||||||
@ -14966,7 +14966,7 @@ bool acl_authenticate(THD *thd, uint com_change_user_pkt_len)
|
|||||||
if (global_system_variables.log_warnings > 1)
|
if (global_system_variables.log_warnings > 1)
|
||||||
{
|
{
|
||||||
Security_context* sctx = thd->security_ctx;
|
Security_context* sctx = thd->security_ctx;
|
||||||
sql_print_warning(ER_THD(thd, err),
|
sql_print_warning(ER_DEFAULT(err),
|
||||||
sctx->priv_user, sctx->priv_host, mpvio.db.str);
|
sctx->priv_user, sctx->priv_host, mpvio.db.str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7651,7 +7651,7 @@ static void print_unsafe_warning_to_log(THD *thd, int unsafe_type, char* buf,
|
|||||||
DBUG_ENTER("print_unsafe_warning_in_log");
|
DBUG_ENTER("print_unsafe_warning_in_log");
|
||||||
sprintf(buf, ER_THD(thd, ER_BINLOG_UNSAFE_STATEMENT),
|
sprintf(buf, ER_THD(thd, ER_BINLOG_UNSAFE_STATEMENT),
|
||||||
ER_THD(thd, LEX::binlog_stmt_unsafe_errcode[unsafe_type]));
|
ER_THD(thd, LEX::binlog_stmt_unsafe_errcode[unsafe_type]));
|
||||||
sql_print_warning(ER_THD(thd, ER_MESSAGE_AND_STATEMENT), buf, query);
|
sql_print_warning(ER_DEFAULT(ER_MESSAGE_AND_STATEMENT), buf, query);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5440,7 +5440,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Security_context *sctx= &main_security_ctx;
|
Security_context *sctx= &main_security_ctx;
|
||||||
sql_print_warning(ER_THD(this, ER_NEW_ABORTING_CONNECTION),
|
sql_print_warning(ER_DEFAULT(ER_NEW_ABORTING_CONNECTION),
|
||||||
thread_id, (db.str ? db.str : "unconnected"),
|
thread_id, (db.str ? db.str : "unconnected"),
|
||||||
sctx->user ? sctx->user : "unauthenticated",
|
sctx->user ? sctx->user : "unauthenticated",
|
||||||
sctx->host_or_ip, real_ip_str, reason);
|
sctx->host_or_ip, real_ip_str, reason);
|
||||||
|
@ -589,7 +589,7 @@ bool load_db_opt(THD *thd, const char *path, Schema_specification_st *create)
|
|||||||
get_charset_by_name(pos+1, MYF(utf8_flag))))
|
get_charset_by_name(pos+1, MYF(utf8_flag))))
|
||||||
{
|
{
|
||||||
sql_print_error("Error while loading database options: '%s':",path);
|
sql_print_error("Error while loading database options: '%s':",path);
|
||||||
sql_print_error(ER_THD(thd, ER_UNKNOWN_CHARACTER_SET),pos+1);
|
sql_print_error(ER_DEFAULT(ER_UNKNOWN_CHARACTER_SET),pos+1);
|
||||||
create->default_table_charset= default_charset_info;
|
create->default_table_charset= default_charset_info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -598,7 +598,7 @@ bool load_db_opt(THD *thd, const char *path, Schema_specification_st *create)
|
|||||||
if (!(create->default_table_charset= get_charset_by_name(pos+1, MYF(utf8_flag))))
|
if (!(create->default_table_charset= get_charset_by_name(pos+1, MYF(utf8_flag))))
|
||||||
{
|
{
|
||||||
sql_print_error("Error while loading database options: '%s':",path);
|
sql_print_error("Error while loading database options: '%s':",path);
|
||||||
sql_print_error(ER_THD(thd, ER_UNKNOWN_COLLATION),pos+1);
|
sql_print_error(ER_DEFAULT(ER_UNKNOWN_COLLATION),pos+1);
|
||||||
create->default_table_charset= default_charset_info;
|
create->default_table_charset= default_charset_info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1962,7 +1962,7 @@ static void plugin_load(MEM_ROOT *tmp_root)
|
|||||||
mysql_mutex_unlock(&LOCK_plugin);
|
mysql_mutex_unlock(&LOCK_plugin);
|
||||||
}
|
}
|
||||||
if (unlikely(error > 0))
|
if (unlikely(error > 0))
|
||||||
sql_print_error(ER_THD(new_thd, ER_GET_ERRNO), my_errno,
|
sql_print_error(ER_DEFAULT(ER_GET_ERRNO), my_errno,
|
||||||
table->file->table_type());
|
table->file->table_type());
|
||||||
end_read_record(&read_record_info);
|
end_read_record(&read_record_info);
|
||||||
table->mark_table_for_reopen();
|
table->mark_table_for_reopen();
|
||||||
|
@ -98,7 +98,7 @@ static const char *init_syms(udf_func *tmp, char *nm)
|
|||||||
if (!opt_allow_suspicious_udfs)
|
if (!opt_allow_suspicious_udfs)
|
||||||
return nm;
|
return nm;
|
||||||
if (thd->variables.log_warnings)
|
if (thd->variables.log_warnings)
|
||||||
sql_print_warning(ER_THD(thd, ER_CANT_FIND_DL_ENTRY), nm, tmp->name.str);
|
sql_print_warning(ER_DEFAULT(ER_CANT_FIND_DL_ENTRY), nm, tmp->name.str);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ void udf_init()
|
|||||||
if (!(dl= dlopen(dlpath, RTLD_NOW)))
|
if (!(dl= dlopen(dlpath, RTLD_NOW)))
|
||||||
{
|
{
|
||||||
/* Print warning to log */
|
/* Print warning to log */
|
||||||
sql_print_error(ER_THD(new_thd, ER_CANT_OPEN_LIBRARY),
|
sql_print_error(ER_DEFAULT(ER_CANT_OPEN_LIBRARY),
|
||||||
tmp->dl, errno, my_dlerror(dlpath));
|
tmp->dl, errno, my_dlerror(dlpath));
|
||||||
/* Keep the udf in the hash so that we can remove it later */
|
/* Keep the udf in the hash so that we can remove it later */
|
||||||
continue;
|
continue;
|
||||||
@ -265,7 +265,7 @@ void udf_init()
|
|||||||
const char *missing;
|
const char *missing;
|
||||||
if ((missing= init_syms(tmp, buf)))
|
if ((missing= init_syms(tmp, buf)))
|
||||||
{
|
{
|
||||||
sql_print_error(ER_THD(new_thd, ER_CANT_FIND_DL_ENTRY), missing,
|
sql_print_error(ER_DEFAULT(ER_CANT_FIND_DL_ENTRY), missing,
|
||||||
tmp->name.str);
|
tmp->name.str);
|
||||||
del_udf(tmp);
|
del_udf(tmp);
|
||||||
if (new_dl)
|
if (new_dl)
|
||||||
|
@ -54,7 +54,7 @@ extern "C" {
|
|||||||
/* Skip writing to the error log to avoid mtr complaints */
|
/* Skip writing to the error log to avoid mtr complaints */
|
||||||
DBUG_EXECUTE_IF("simulate_out_of_memory", return;);
|
DBUG_EXECUTE_IF("simulate_out_of_memory", return;);
|
||||||
|
|
||||||
sql_print_error("%s", ER_THD_OR_DEFAULT(thd, ER_OUT_OF_RESOURCES));
|
sql_print_error(ER_DEFAULT(ER_OUT_OF_RESOURCES));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user