diff options
author | venu@myvenu.com <> | 2002-12-04 03:19:08 -0800 |
---|---|---|
committer | venu@myvenu.com <> | 2002-12-04 03:19:08 -0800 |
commit | 91558620e0932b6eccbdbd8d2da8886c5dac0894 (patch) | |
tree | a4e71aed04340d274de207969d7c92c7570c95f4 /sql/sql_error.cc | |
parent | ed8cc2a844738386ae3eef3b3b01c0e784a0b3f6 (diff) | |
download | mariadb-git-91558620e0932b6eccbdbd8d2da8886c5dac0894.tar.gz |
Return a warning for DROP DATABASE/TABLE IF EXISTS <non_existing_db/table(s)>
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r-- | sql/sql_error.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc index d2735073461..5c9bef15ea7 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -104,6 +104,32 @@ void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, uint code, thd->total_warn_count++; } +/* + Store warning to the list +*/ + +void store_warning(THD *thd, uint errcode, ...) +{ + va_list args; + const char *format; + char warning[ERRMSGSIZE+20]; + DBUG_ENTER("store_warning"); + DBUG_PRINT("enter",("warning: %u",errcode)); + + va_start(args,errcode); + if (errcode) + format= ER(errcode); + else + { + format=va_arg(args,char*); + errcode= ER_UNKNOWN_ERROR; + } + (void) vsprintf (warning,format,args); + va_end(args); + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, errcode, warning); + DBUG_VOID_RETURN; +} + /* Send all notes, errors or warnings to the client in a result set |