1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Return a warning for DROP DATABASE/TABLE IF EXISTS <non_existing_db/table(s)>

This commit is contained in:
unknown
2002-12-04 03:19:08 -08:00
parent 265bf23895
commit 07f797a9bf
4 changed files with 38 additions and 5 deletions

View File

@ -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