Commit bf62d8e7 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup

parent 1f784008
......@@ -108,7 +108,7 @@ static int prepare_for_fill(TABLE_LIST *tables)
thd->security_ctx->master_access= ALL_KNOWN_ACL;
bzero((char*) &thd->net, sizeof(thd->net));
lex_start(thd);
mysql_init_select(thd->lex);
thd->lex->init_select();
LEX_CSTRING tbl_name= {i_s_feedback->table_name, strlen(i_s_feedback->table_name) };
......
......@@ -6402,7 +6402,7 @@ bool LEX::sf_return_fill_definition(const Lex_field_type_st &def)
void LEX::set_stmt_init()
{
sql_command= SQLCOM_SET_OPTION;
mysql_init_select(this);
init_select();
option_type= OPT_SESSION;
autocommit= 0;
var_list.empty();
......@@ -10384,8 +10384,7 @@ bool LEX::parsed_TVC_start()
save_values_list_state();
many_values.empty();
insert_list= 0;
if (!(sel= alloc_select(TRUE)) ||
push_select(sel))
if (!(sel= alloc_select(TRUE)) || push_select(sel))
return true;
sel->init_select();
sel->braces= FALSE; // just initialisation
......@@ -10397,9 +10396,7 @@ SELECT_LEX *LEX::parsed_TVC_end()
{
SELECT_LEX *res= pop_select(); // above TVC select
if (!(res->tvc=
new (thd->mem_root) table_value_constr(many_values,
res,
res->options)))
new (thd->mem_root) table_value_constr(many_values, res, res->options)))
return NULL;
restore_values_list_state();
return res;
......
......@@ -7610,21 +7610,6 @@ void THD::reset_for_next_command(bool do_clear_error)
}
/**
Resets the lex->current_select object.
@note It is assumed that lex->current_select != NULL
This function is a wrapper around select_lex->init_select() with an added
check for the special situation when using INTO OUTFILE and LOAD DATA.
*/
void
mysql_init_select(LEX *lex)
{
lex->init_select();
}
/**
Used to allocate a new SELECT_LEX object on the current thd mem_root and
link it into the relevant lists.
......@@ -7741,7 +7726,7 @@ void create_select_for_variable(THD *thd, LEX_CSTRING *var_name)
DBUG_ENTER("create_select_for_variable");
lex= thd->lex;
mysql_init_select(lex);
lex->init_select();
lex->sql_command= SQLCOM_SELECT;
/*
We set the name of Item to @@session.var_name because that then is used
......@@ -7760,7 +7745,7 @@ void create_select_for_variable(THD *thd, LEX_CSTRING *var_name)
void mysql_init_multi_delete(LEX *lex)
{
lex->sql_command= SQLCOM_DELETE_MULTI;
mysql_init_select(lex);
lex->init_select();
lex->first_select_lex()->limit_params.clear();
lex->unit.lim.clear();
lex->first_select_lex()->table_list.
......
......@@ -87,7 +87,6 @@ bool stmt_causes_implicit_commit(THD *thd, uint mask);
bool is_update_query(enum enum_sql_command command);
bool is_log_table_write_query(enum enum_sql_command command);
bool alloc_query(THD *thd, const char *packet, size_t packet_length);
void mysql_init_select(LEX *lex);
void mysql_parse(THD *thd, char *rawbuf, uint length,
Parser_state *parser_state);
bool mysql_new_select(LEX *lex, bool move_down, SELECT_LEX *sel);
......
......@@ -985,7 +985,7 @@ Item *Item_func_in::in_predicate_to_in_subs_transformer(THD *thd,
*/
if (mysql_new_select(lex, 1, NULL))
goto err;
mysql_init_select(lex);
lex->init_select();
/* Create item list as '*' for the subquery SQ */
Item *item;
SELECT_LEX *sq_select; // select for IN subquery;
......@@ -1003,7 +1003,7 @@ Item *Item_func_in::in_predicate_to_in_subs_transformer(THD *thd,
SELECT_LEX_UNIT *derived_unit; // unit for tvc_select
if (mysql_new_select(lex, 1, NULL))
goto err;
mysql_init_select(lex);
lex->init_select();
tvc_select= lex->current_select;
derived_unit= tvc_select->master_unit();
tvc_select->set_linkage(DERIVED_TABLE_TYPE);
......
......@@ -12761,7 +12761,7 @@ do:
lex->sql_command = SQLCOM_DO;
if (lex->main_select_push(true))
MYSQL_YYABORT;
mysql_init_select(lex);
lex->init_select();
}
expr_list
{
......@@ -12985,7 +12985,7 @@ replace:
insert_start: {
if (Lex->main_select_push())
MYSQL_YYABORT;
mysql_init_select(Lex);
Lex->init_select();
Lex->inc_select_stack_outer_barrier();
Lex->current_select->parsing_place= BEFORE_OPT_LIST;
}
......@@ -13252,7 +13252,7 @@ update:
LEX *lex= Lex;
if (Lex->main_select_push())
MYSQL_YYABORT;
mysql_init_select(lex);
lex->init_select();
lex->sql_command= SQLCOM_UPDATE;
lex->duplicates= DUP_ERROR;
}
......@@ -13334,7 +13334,7 @@ delete:
YYPS->m_mdl_type= MDL_SHARED_WRITE;
if (Lex->main_select_push())
MYSQL_YYABORT;
mysql_init_select(lex);
lex->init_select();
lex->ignore= 0;
lex->first_select_lex()->order_list.empty();
}
......@@ -13611,7 +13611,7 @@ show:
lex->ident= null_clex_str;
if (Lex->main_select_push())
MYSQL_YYABORT;
mysql_init_select(lex);
lex->init_select();
lex->current_select->parsing_place= SELECT_LIST;
lex->create_info.init();
}
......@@ -14111,7 +14111,7 @@ describe:
LEX *lex= Lex;
if (lex->main_select_push())
MYSQL_YYABORT;
mysql_init_select(lex);
lex->init_select();
lex->current_select->parsing_place= SELECT_LIST;
lex->sql_command= SQLCOM_SHOW_FIELDS;
lex->first_select_lex()->db= null_clex_str;
......@@ -14202,7 +14202,7 @@ explain_for_connection:
lex->ident= null_clex_str;
if (Lex->main_select_push())
MYSQL_YYABORT;
mysql_init_select(lex);
lex->init_select();
lex->current_select->parsing_place= SELECT_LIST;
lex->create_info.init();
Select->parsing_place= NO_MATTER;
......@@ -14572,7 +14572,7 @@ load:
}
if (lex->main_select_push())
MYSQL_YYABORT;
mysql_init_select(lex);
lex->init_select();
}
load_data_lock opt_local INFILE TEXT_STRING_filesystem
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment