diff options
author | unknown <monty@narttu.mysql.fi> | 2003-04-03 21:19:14 +0300 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2003-04-03 21:19:14 +0300 |
commit | 0dbfff461472b3dd308713102b0abce3b5d4d0c4 (patch) | |
tree | b27e4cc9b07c5b7c391798dccc4673d37d45e6dd /sql/sql_error.cc | |
parent | c9d2e7759a97c7f32cc28182a171b5ae84622d8f (diff) | |
download | mariadb-git-0dbfff461472b3dd308713102b0abce3b5d4d0c4.tar.gz |
Fixed bug in warning handling (Memory was allocated from wrong MEM_ROOT)
sql/item_sum.cc:
Fixed bug in warning handling.
sql/item_sum.h:
Fixed bug in warning handling.
sql/sql_class.h:
Fixed bug in warning handling.
sql/sql_error.cc:
Fixed bug in warning handling.
strings/my_vsnprintf.c:
After merge fix
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r-- | sql/sql_error.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 380d42e2580..3b9c329d5e5 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -45,6 +45,19 @@ This file contains the implementation of error and warnings related #include "mysql_priv.h" /* + Store a new message in an error object + + This is used to in group_concat() to register how many warnings we actually + got after the query has been executed. +*/ + +void MYSQL_ERROR::set_msg(THD *thd, const char *msg_arg) +{ + msg= strdup_root(&thd->warn_root, msg_arg); +} + + +/* Reset all warnings for the thread SYNOPSIS @@ -91,7 +104,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, if (thd->query_id != thd->warn_id) mysql_reset_errors(thd); - MYSQL_ERROR *err = NULL; + MYSQL_ERROR *err= NULL; if (thd->warn_list.elements < thd->variables.max_error_count) { @@ -101,7 +114,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, */ MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); my_pthread_setspecific_ptr(THR_MALLOC, &thd->warn_root); - err = new MYSQL_ERROR(code, level, msg); + err= new MYSQL_ERROR(thd, code, level, msg); if (err) thd->warn_list.push_back(err); my_pthread_setspecific_ptr(THR_MALLOC, old_root); |