Changing %type of opt_place from <NONE> to <const_simple_string>.

A prerequisite change for:
- MDEV-8093 sql_yacc.yy: add %type create_field for field_spec and column_def
- MDEV-8094 sql_yacc.yy: get rid of the rules "opt_if_not_exists_table_element"
            and "opt_if_exists_table_element"
- MDEV-8095 Split Create_field
This commit is contained in:
Alexander Barkov 2015-11-24 12:44:35 +04:00
parent 58a6b9ebff
commit 80ca997faa
3 changed files with 10 additions and 12 deletions

View file

@ -7371,13 +7371,6 @@ bool mysql_test_parse_for_slave(THD *thd, char *rawbuf, uint length)
#endif
/** Store position for column in ALTER TABLE .. ADD column. */
void store_position_for_column(const char *name)
{
current_thd->lex->last_field->after=(char*) (name);
}
bool
add_proc_to_list(THD* thd, Item *item)
{

View file

@ -115,7 +115,6 @@ bool add_proc_to_list(THD *thd, Item *item);
bool push_new_name_resolution_context(THD *thd,
TABLE_LIST *left_op,
TABLE_LIST *right_op);
void store_position_for_column(const char *name);
void init_update_queries(void);
bool check_simple_select();
Item *normalize_cond(THD *thd, Item *cond);

View file

@ -949,6 +949,7 @@ bool LEX::set_bincmp(CHARSET_INFO *cs, bool bin)
TABLE_LIST *table_list;
Table_ident *table;
char *simple_string;
const char *const_simple_string;
chooser_compare_func_creator boolfunc2creator;
class my_var *myvar;
class sp_condition_value *spcondvalue;
@ -1704,6 +1705,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
wild_and_where
field_length opt_field_length opt_field_length_default_1
%type <const_simple_string>
opt_place
%type <string>
text_string hex_or_bin_String opt_gconcat_separator
@ -1892,7 +1896,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
ref_list opt_match_clause opt_on_update_delete use
opt_delete_options opt_delete_option varchar nchar nvarchar
opt_outer table_list table_name table_alias_ref_list table_alias_ref
opt_place
opt_attribute opt_attribute_list attribute column_list column_list_id
opt_column_list grant_privileges grant_ident grant_list grant_option
object_privilege object_privilege_list user_list user_and_role_list
@ -7561,6 +7564,7 @@ alter_list_item:
add_column column_def opt_place
{
Lex->create_last_non_select_table= Lex->last_table();
Lex->last_field->after= $3;
}
| ADD key_def
{
@ -7578,6 +7582,7 @@ alter_list_item:
Lex->alter_info.flags|= Alter_info::ALTER_CHANGE_COLUMN;
Lex->create_last_non_select_table= Lex->last_table();
Lex->last_field->change= $4.str;
Lex->last_field->after= $6;
}
| MODIFY_SYM opt_column opt_if_exists_table_element
field_spec opt_place
@ -7585,6 +7590,7 @@ alter_list_item:
Lex->alter_info.flags|= Alter_info::ALTER_CHANGE_COLUMN;
Lex->create_last_non_select_table= Lex->last_table();
Lex->last_field->change= Lex->last_field->field_name;
Lex->last_field->after= $5;
}
| DROP opt_column opt_if_exists_table_element field_ident opt_restrict
{
@ -7797,15 +7803,15 @@ opt_restrict:
;
opt_place:
/* empty */ {}
/* empty */ { $$= NULL; }
| AFTER_SYM ident
{
store_position_for_column($2.str);
$$= $2.str;
Lex->alter_info.flags |= Alter_info::ALTER_COLUMN_ORDER;
}
| FIRST_SYM
{
store_position_for_column(first_keyword);
$$= first_keyword;
Lex->alter_info.flags |= Alter_info::ALTER_COLUMN_ORDER;
}
;