| 1100 | */ |
| 1101 | |
| 1102 | void create_select_for_variable(const char *var_name) |
| 1103 | { |
| 1104 | THD *thd; |
| 1105 | LEX *lex; |
| 1106 | LEX_STRING tmp, null_lex_string; |
| 1107 | Item *var; |
| 1108 | char buff[MAX_SYS_VAR_LENGTH*2+4+8], *end; |
| 1109 | DBUG_ENTER("create_select_for_variable"); |
| 1110 | |
| 1111 | thd= current_thd; |
| 1112 | lex= thd->lex; |
| 1113 | mysql_init_select(lex); |
| 1114 | lex->sql_command= SQLCOM_SELECT; |
| 1115 | tmp.str= (char*) var_name; |
| 1116 | tmp.length=strlen(var_name); |
| 1117 | memset(&null_lex_string, 0, sizeof(null_lex_string)); |
| 1118 | /* |
| 1119 | We set the name of Item to @@session.var_name because that then is used |
| 1120 | as the column name in the output. |
| 1121 | */ |
| 1122 | if ((var= get_system_var(thd, OPT_SESSION, tmp, null_lex_string))) |
| 1123 | { |
| 1124 | end= strxmov(buff, "@@session.", var_name, NullS); |
| 1125 | var->item_name.copy(buff, end - buff); |
| 1126 | add_item_to_list(thd, var); |
| 1127 | } |
| 1128 | DBUG_VOID_RETURN; |
| 1129 | } |
| 1130 | |
| 1131 | |
| 1132 | void mysql_init_multi_delete(LEX *lex) |
nothing calls this directly
no test coverage detected