diff options
author | unknown <wax@kishkin.ru> | 2003-04-02 18:15:16 +0600 |
---|---|---|
committer | unknown <wax@kishkin.ru> | 2003-04-02 18:15:16 +0600 |
commit | 994a9abab551b6fd2cc0ce6cd439b1860dc10b15 (patch) | |
tree | 488579564c80c09c40acdafd8ff903c433ef47c1 /sql/sql_error.cc | |
parent | 16ce6b7173ff558a51de3d5e7d1b6eecdf7367dd (diff) | |
parent | 1de0ce8677d1913dcb6001d701dc08712d5e93d3 (diff) | |
download | mariadb-git-994a9abab551b6fd2cc0ce6cd439b1860dc10b15.tar.gz |
Auto merged
BitKeeper/etc/logging_ok:
auto-union
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r-- | sql/sql_error.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc index c7b1814c1d7..380d42e2580 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -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; } /* |