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

Method execute

sql/sql_signal.cc:385–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385bool Sql_cmd_signal::execute(THD *thd)
386{
387 bool result= TRUE;
388 DBUG_ASSERT(m_cond);
389 Sql_condition cond(thd->mem_root, m_cond->get_user_condition_identity());
390
391 DBUG_ENTER("Sql_cmd_signal::execute");
392
393 /*
394 WL#2110 SIGNAL specification says:
395
396 When SIGNAL is executed, it has five effects, in the following order:
397
398 (1) First, the diagnostics area is completely cleared. So if the
399 SIGNAL is in a DECLARE HANDLER then any pending errors or warnings
400 are gone. So is 'row count'.
401
402 This has roots in the SQL standard specification for SIGNAL.
403 */
404
405 thd->get_stmt_da()->reset_diagnostics_area();
406 thd->set_row_count_func(0);
407 thd->get_stmt_da()->clear_warning_info(thd->query_id);
408
409 result= raise_condition(thd, &cond);
410
411 DBUG_RETURN(result);
412}
413
414
415/**

Callers

nothing calls this directly

Calls 12

get_stmt_daMethod · 0.80
set_row_count_funcMethod · 0.80
clear_warning_infoMethod · 0.80
set_warning_info_idMethod · 0.80
raised_conditionMethod · 0.80
raise_errorMethod · 0.80
has_sql_conditionMethod · 0.45
reserve_spaceMethod · 0.45
push_warningMethod · 0.45

Tested by

no test coverage detected