summaryrefslogtreecommitdiff
path: root/sql/sql_error.cc
diff options
context:
space:
mode:
authorunknown <venu@myvenu.com>2002-12-04 03:19:08 -0800
committerunknown <venu@myvenu.com>2002-12-04 03:19:08 -0800
commit07f797a9bf71c19ae0d9c4cdf2b3a11def3bac03 (patch)
treea4e71aed04340d274de207969d7c92c7570c95f4 /sql/sql_error.cc
parent265bf238951c3a123c4d6f7fea600175a399cf96 (diff)
downloadmariadb-git-07f797a9bf71c19ae0d9c4cdf2b3a11def3bac03.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.cc26
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