mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Auto merged
This commit is contained in:
@ -80,14 +80,19 @@ void mysql_reset_errors(THD *thd)
|
||||
level Severity of warning (note, warning, error ...)
|
||||
code Error number
|
||||
msg Clear error message
|
||||
|
||||
RETURN
|
||||
pointer on MYSQL_ERROR object
|
||||
*/
|
||||
|
||||
void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, uint code,
|
||||
const char *msg)
|
||||
MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
|
||||
uint code, const char *msg)
|
||||
{
|
||||
if (thd->query_id != thd->warn_id)
|
||||
mysql_reset_errors(thd);
|
||||
|
||||
MYSQL_ERROR *err = NULL;
|
||||
|
||||
if (thd->warn_list.elements < thd->variables.max_error_count)
|
||||
{
|
||||
/*
|
||||
@ -96,13 +101,14 @@ void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, uint code,
|
||||
*/
|
||||
MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC);
|
||||
my_pthread_setspecific_ptr(THR_MALLOC, &thd->warn_root);
|
||||
MYSQL_ERROR *err= new MYSQL_ERROR(code, level, msg);
|
||||
err = new MYSQL_ERROR(code, level, msg);
|
||||
if (err)
|
||||
thd->warn_list.push_back(err);
|
||||
my_pthread_setspecific_ptr(THR_MALLOC, old_root);
|
||||
}
|
||||
thd->warn_count[(uint) level]++;
|
||||
thd->total_warn_count++;
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user