mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
fix "enforce no trailing \n in Diagnostic_area messages"
cannot have an assert in Warning_info::push_warning()
because SQL command SIGNAL can set an absolutely arbitrary
message, even an empty one or ending with '\n'
move the assert into push_warning() and my_message_sql().
followup for 9508a44c37
This commit is contained in:
@ -692,7 +692,6 @@ Sql_condition *Warning_info::push_warning(THD *thd,
|
||||
const char *msg)
|
||||
{
|
||||
Sql_condition *cond= NULL;
|
||||
DBUG_ASSERT(msg[strlen(msg)-1] != '\n');
|
||||
|
||||
if (! m_read_only)
|
||||
{
|
||||
@ -750,6 +749,7 @@ void push_warning(THD *thd, Sql_condition::enum_warning_level level,
|
||||
if (level == Sql_condition::WARN_LEVEL_ERROR)
|
||||
level= Sql_condition::WARN_LEVEL_WARN;
|
||||
|
||||
DBUG_ASSERT(msg[strlen(msg)-1] != '\n');
|
||||
(void) thd->raise_condition(code, NULL, level, msg);
|
||||
|
||||
/* Make sure we also count warnings pushed after calling set_ok_status(). */
|
||||
|
Reference in New Issue
Block a user