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

refactor THD::raise_condition() family

to remove

Sql_condition*
raise_condition(const Sql_condition *cond)
{
  Sql_condition *raised= raise_condition(cond->get_sql_errno(),
                                         cond->get_sqlstate(),
                                         cond->get_level(),
                                         *cond,
                                         cond->get_message_text());
  return raised;
}
This commit is contained in:
Sergei Golubchik
2021-10-08 18:43:56 +02:00
parent a398fcbff6
commit b73b736506
10 changed files with 79 additions and 120 deletions

View File

@ -217,7 +217,7 @@ Sql_condition::set_builtin_message_text(const char* str)
*/
const char* copy;
copy= strdup_root(m_mem_root, str);
copy= m_mem_root ? strdup_root(m_mem_root, str) : str;
m_message_text.set(copy, strlen(copy), error_message_charset_info);
DBUG_ASSERT(! m_message_text.is_alloced());
}
@ -727,7 +727,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;
(void) thd->raise_condition(code, NULL, level, msg);
(void) thd->raise_condition(code, "\0\0\0\0\0", level, msg);
/* Make sure we also count warnings pushed after calling set_ok_status(). */
thd->get_stmt_da()->increment_warning();