summaryrefslogtreecommitdiff
path: root/sql/sql_error.cc
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@sun.com>2008-10-06 14:36:15 -0600
committerMarc Alff <marc.alff@sun.com>2008-10-06 14:36:15 -0600
commitff4fde18c40fa92caabff596100357c2b411116f (patch)
tree21983f574849b98ac46959575f1a0410aeae950f /sql/sql_error.cc
parent1fd6774b3df26a8e2f6b05878d23859796e21c2f (diff)
downloadmariadb-git-ff4fde18c40fa92caabff596100357c2b411116f.tar.gz
Bug#36768 (partition_info::check_partition_info() reports mal formed
warnings) Before this fix, several places in the code would raise a warning with an error code 0, making it impossible for a stored procedure, a connector, or a client application to trigger logic to handle the warning. Also, the warning text was hard coded, and therefore not translated. With this fix, new errors numbers have been created to represent these warnings, and the warning text is coded in the errmsg.txt file.
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r--sql/sql_error.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 0b74e3455eb..79da1936eb9 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -109,6 +109,9 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
DBUG_ENTER("push_warning");
DBUG_PRINT("enter", ("code: %d, msg: %s", code, msg));
+ DBUG_ASSERT(code != 0);
+ DBUG_ASSERT(msg != NULL);
+
if (level == MYSQL_ERROR::WARN_LEVEL_NOTE &&
!(thd->options & OPTION_SQL_NOTES))
DBUG_RETURN(0);
@@ -177,7 +180,10 @@ void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
char warning[ERRMSGSIZE+20];
DBUG_ENTER("push_warning_printf");
DBUG_PRINT("enter",("warning: %u", code));
-
+
+ DBUG_ASSERT(code != 0);
+ DBUG_ASSERT(format != NULL);
+
va_start(args,format);
my_vsnprintf(warning, sizeof(warning), format, args);
va_end(args);