MCPcopy Create free account
hub / github.com/MariaDB/server / push_warning

Function push_warning

sql/sql_error.cc:748–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

746*/
747
748void push_warning(THD *thd, Sql_condition::enum_warning_level level,
749 uint code, const char *msg)
750{
751 DBUG_ENTER("push_warning");
752 DBUG_PRINT("enter", ("code: %d, msg: %s", code, msg));
753
754 /*
755 Calling push_warning/push_warning_printf with a level of
756 WARN_LEVEL_ERROR *is* a bug. Either use my_printf_error(),
757 my_error(), or WARN_LEVEL_WARN.
758 */
759 DBUG_ASSERT(level != Sql_condition::WARN_LEVEL_ERROR);
760
761 if (level == Sql_condition::WARN_LEVEL_ERROR)
762 level= Sql_condition::WARN_LEVEL_WARN;
763
764 DBUG_ASSERT(strlen(msg));
765 DBUG_ASSERT(msg[strlen(msg)-1] != '\n');
766 (void) thd->raise_condition(code, "\0\0\0\0\0", level, msg);
767
768 /* Make sure we also count warnings pushed after calling set_ok_status(). */
769 thd->get_stmt_da()->increment_warning();
770
771 DBUG_VOID_RETURN;
772}
773
774
775/*

Callers 15

send_explainMethod · 0.85
check_if_in_the_pastMethod · 0.85
select_transformerMethod · 0.85
val_intMethod · 0.85
val_strMethod · 0.85
signal_divide_by_nullMethod · 0.85
ha_commit_transFunction · 0.85
ha_rollback_transFunction · 0.85
plugin_deinitializeFunction · 0.85

Calls 3

increment_warningMethod · 0.80
get_stmt_daMethod · 0.80
raise_conditionMethod · 0.45

Tested by

no test coverage detected