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) ...@@ -108,7 +108,7 @@ static int prepare_for_fill(TABLE_LIST *tables)
thd->security_ctx->master_access= ALL_KNOWN_ACL; thd->security_ctx->master_access= ALL_KNOWN_ACL;
bzero((char*) &thd->net, sizeof(thd->net)); bzero((char*) &thd->net, sizeof(thd->net));
lex_start(thd); 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) }; 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) ...@@ -6402,7 +6402,7 @@ bool LEX::sf_return_fill_definition(const Lex_field_type_st &def)
void LEX::set_stmt_init() void LEX::set_stmt_init()
{ {
sql_command= SQLCOM_SET_OPTION; sql_command= SQLCOM_SET_OPTION;
mysql_init_select(this); init_select();
option_type= OPT_SESSION; option_type= OPT_SESSION;
autocommit= 0; autocommit= 0;
var_list.empty(); var_list.empty();
...@@ -10384,8 +10384,7 @@ bool LEX::parsed_TVC_start() ...@@ -10384,8 +10384,7 @@ bool LEX::parsed_TVC_start()
save_values_list_state(); save_values_list_state();
many_values.empty(); many_values.empty();
insert_list= 0; insert_list= 0;
if (!(sel= alloc_select(TRUE)) || if (!(sel= alloc_select(TRUE)) || push_select(sel))
push_select(sel))
return true; return true;
sel->init_select(); sel->init_select();
sel->braces= FALSE; // just initialisation sel->braces= FALSE; // just initialisation
...@@ -10397,9 +10396,7 @@ SELECT_LEX *LEX::parsed_TVC_end() ...@@ -10397,9 +10396,7 @@ SELECT_LEX *LEX::parsed_TVC_end()
{ {
SELECT_LEX *res= pop_select(); // above TVC select SELECT_LEX *res= pop_select(); // above TVC select
if (!(res->tvc= if (!(res->tvc=
new (thd->mem_root) table_value_constr(many_values, new (thd->mem_root) table_value_constr(many_values, res, res->options)))
res,
res->options)))
return NULL; return NULL;
restore_values_list_state(); restore_values_list_state();
return res; return res;
......
...@@ -7610,21 +7610,6 @@ void THD::reset_for_next_command(bool do_clear_error) ...@@ -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 Used to allocate a new SELECT_LEX object on the current thd mem_root and
link it into the relevant lists. link it into the relevant lists.
...@@ -7741,7 +7726,7 @@ void create_select_for_variable(THD *thd, LEX_CSTRING *var_name) ...@@ -7741,7 +7726,7 @@ void create_select_for_variable(THD *thd, LEX_CSTRING *var_name)
DBUG_ENTER("create_select_for_variable"); DBUG_ENTER("create_select_for_variable");
lex= thd->lex; lex= thd->lex;
mysql_init_select(lex); lex->init_select();
lex->sql_command= SQLCOM_SELECT; lex->sql_command= SQLCOM_SELECT;
/* /*
We set the name of Item to @@session.var_name because that then is used 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) ...@@ -7760,7 +7745,7 @@ void create_select_for_variable(THD *thd, LEX_CSTRING *var_name)
void mysql_init_multi_delete(LEX *lex) void mysql_init_multi_delete(LEX *lex)
{ {
lex->sql_command= SQLCOM_DELETE_MULTI; lex->sql_command= SQLCOM_DELETE_MULTI;
mysql_init_select(lex); lex->init_select();
lex->first_select_lex()->limit_params.clear(); lex->first_select_lex()->limit_params.clear();
lex->unit.lim.clear(); lex->unit.lim.clear();
lex->first_select_lex()->table_list. lex->first_select_lex()->table_list.
......
...@@ -87,7 +87,6 @@ bool stmt_causes_implicit_commit(THD *thd, uint mask); ...@@ -87,7 +87,6 @@ bool stmt_causes_implicit_commit(THD *thd, uint mask);
bool is_update_query(enum enum_sql_command command); bool is_update_query(enum enum_sql_command command);
bool is_log_table_write_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); 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, void mysql_parse(THD *thd, char *rawbuf, uint length,
Parser_state *parser_state); Parser_state *parser_state);
bool mysql_new_select(LEX *lex, bool move_down, SELECT_LEX *sel); 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, ...@@ -985,7 +985,7 @@ Item *Item_func_in::in_predicate_to_in_subs_transformer(THD *thd,
*/ */
if (mysql_new_select(lex, 1, NULL)) if (mysql_new_select(lex, 1, NULL))
goto err; goto err;
mysql_init_select(lex); lex->init_select();
/* Create item list as '*' for the subquery SQ */ /* Create item list as '*' for the subquery SQ */
Item *item; Item *item;
SELECT_LEX *sq_select; // select for IN subquery; SELECT_LEX *sq_select; // select for IN subquery;
...@@ -1003,7 +1003,7 @@ Item *Item_func_in::in_predicate_to_in_subs_transformer(THD *thd, ...@@ -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 SELECT_LEX_UNIT *derived_unit; // unit for tvc_select
if (mysql_new_select(lex, 1, NULL)) if (mysql_new_select(lex, 1, NULL))
goto err; goto err;
mysql_init_select(lex); lex->init_select();
tvc_select= lex->current_select; tvc_select= lex->current_select;
derived_unit= tvc_select->master_unit(); derived_unit= tvc_select->master_unit();
tvc_select->set_linkage(DERIVED_TABLE_TYPE); tvc_select->set_linkage(DERIVED_TABLE_TYPE);
......
...@@ -12761,7 +12761,7 @@ do: ...@@ -12761,7 +12761,7 @@ do:
lex->sql_command = SQLCOM_DO; lex->sql_command = SQLCOM_DO;
if (lex->main_select_push(true)) if (lex->main_select_push(true))
MYSQL_YYABORT; MYSQL_YYABORT;
mysql_init_select(lex); lex->init_select();
} }
expr_list expr_list
{ {
...@@ -12985,7 +12985,7 @@ replace: ...@@ -12985,7 +12985,7 @@ replace:
insert_start: { insert_start: {
if (Lex->main_select_push()) if (Lex->main_select_push())
MYSQL_YYABORT; MYSQL_YYABORT;
mysql_init_select(Lex); Lex->init_select();
Lex->inc_select_stack_outer_barrier(); Lex->inc_select_stack_outer_barrier();
Lex->current_select->parsing_place= BEFORE_OPT_LIST; Lex->current_select->parsing_place= BEFORE_OPT_LIST;
} }
...@@ -13252,7 +13252,7 @@ update: ...@@ -13252,7 +13252,7 @@ update:
LEX *lex= Lex; LEX *lex= Lex;
if (Lex->main_select_push()) if (Lex->main_select_push())
MYSQL_YYABORT; MYSQL_YYABORT;
mysql_init_select(lex); lex->init_select();
lex->sql_command= SQLCOM_UPDATE; lex->sql_command= SQLCOM_UPDATE;
lex->duplicates= DUP_ERROR; lex->duplicates= DUP_ERROR;
} }
...@@ -13334,7 +13334,7 @@ delete: ...@@ -13334,7 +13334,7 @@ delete:
YYPS->m_mdl_type= MDL_SHARED_WRITE; YYPS->m_mdl_type= MDL_SHARED_WRITE;
if (Lex->main_select_push()) if (Lex->main_select_push())
MYSQL_YYABORT; MYSQL_YYABORT;
mysql_init_select(lex); lex->init_select();
lex->ignore= 0; lex->ignore= 0;
lex->first_select_lex()->order_list.empty(); lex->first_select_lex()->order_list.empty();
} }
...@@ -13611,7 +13611,7 @@ show: ...@@ -13611,7 +13611,7 @@ show:
lex->ident= null_clex_str; lex->ident= null_clex_str;
if (Lex->main_select_push()) if (Lex->main_select_push())
MYSQL_YYABORT; MYSQL_YYABORT;
mysql_init_select(lex); lex->init_select();
lex->current_select->parsing_place= SELECT_LIST; lex->current_select->parsing_place= SELECT_LIST;
lex->create_info.init(); lex->create_info.init();
} }
...@@ -14111,7 +14111,7 @@ describe: ...@@ -14111,7 +14111,7 @@ describe:
LEX *lex= Lex; LEX *lex= Lex;
if (lex->main_select_push()) if (lex->main_select_push())
MYSQL_YYABORT; MYSQL_YYABORT;
mysql_init_select(lex); lex->init_select();
lex->current_select->parsing_place= SELECT_LIST; lex->current_select->parsing_place= SELECT_LIST;
lex->sql_command= SQLCOM_SHOW_FIELDS; lex->sql_command= SQLCOM_SHOW_FIELDS;
lex->first_select_lex()->db= null_clex_str; lex->first_select_lex()->db= null_clex_str;
...@@ -14202,7 +14202,7 @@ explain_for_connection: ...@@ -14202,7 +14202,7 @@ explain_for_connection:
lex->ident= null_clex_str; lex->ident= null_clex_str;
if (Lex->main_select_push()) if (Lex->main_select_push())
MYSQL_YYABORT; MYSQL_YYABORT;
mysql_init_select(lex); lex->init_select();
lex->current_select->parsing_place= SELECT_LIST; lex->current_select->parsing_place= SELECT_LIST;
lex->create_info.init(); lex->create_info.init();
Select->parsing_place= NO_MATTER; Select->parsing_place= NO_MATTER;
...@@ -14572,7 +14572,7 @@ load: ...@@ -14572,7 +14572,7 @@ load:
} }
if (lex->main_select_push()) if (lex->main_select_push())
MYSQL_YYABORT; MYSQL_YYABORT;
mysql_init_select(lex); lex->init_select();
} }
load_data_lock opt_local INFILE TEXT_STRING_filesystem 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