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

Function create_select_for_variable

sql/sql_parse.cc:7647–7668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7645*/
7646
7647void create_select_for_variable(THD *thd, LEX_CSTRING *var_name)
7648{
7649 LEX *lex;
7650 Item *var;
7651 char buff[MAX_SYS_VAR_LENGTH*2+4+8], *end;
7652 DBUG_ENTER("create_select_for_variable");
7653
7654 lex= thd->lex;
7655 lex->init_select();
7656 lex->sql_command= SQLCOM_SELECT;
7657 /*
7658 We set the name of Item to @@session.var_name because that then is used
7659 as the column name in the output.
7660 */
7661 if ((var= get_system_var(thd, OPT_SESSION, var_name, &null_clex_str)))
7662 {
7663 end= strxmov(buff, "@@session.", var_name->str, NullS);
7664 var->set_name(thd, buff, (uint)(end-buff), system_charset_info);
7665 add_item_to_list(thd, var);
7666 }
7667 DBUG_VOID_RETURN;
7668}
7669
7670
7671void mysql_init_delete(LEX *lex)

Callers

nothing calls this directly

Calls 5

get_system_varFunction · 0.85
strxmovFunction · 0.85
add_item_to_listFunction · 0.85
init_selectMethod · 0.45
set_nameMethod · 0.45

Tested by

no test coverage detected