Skip to content

Commit

Permalink
cleanup: remove useless internal fied flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Nov 24, 2015
1 parent 4434c5c commit 13989b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion client/mysql.cc
Expand Up @@ -3452,7 +3452,6 @@ static char *fieldflags2str(uint f) {
ff2s_check_flag(NUM);
ff2s_check_flag(PART_KEY);
ff2s_check_flag(GROUP);
ff2s_check_flag(UNIQUE);
ff2s_check_flag(BINCMP);
ff2s_check_flag(ON_UPDATE_NOW);
#undef ff2s_check_flag
Expand Down
1 change: 0 additions & 1 deletion include/mysql_com.h
Expand Up @@ -139,7 +139,6 @@ enum enum_server_command
#define NUM_FLAG 32768 /* Field is num (for clients) */
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */
#define GROUP_FLAG 32768 /* Intern: Group field */
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
#define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */
#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */
Expand Down
12 changes: 6 additions & 6 deletions sql/sql_yacc.yy
Expand Up @@ -6148,7 +6148,7 @@ field_spec:

if (f->flags & PRI_KEY_FLAG)
add_key_to_list(lex, &$1, Key::PRIMARY, Lex->check_exists);
else if (f->flags & (UNIQUE_FLAG | UNIQUE_KEY_FLAG))
else if (f->flags & UNIQUE_KEY_FLAG)
add_key_to_list(lex, &$1, Key::UNIQUE, Lex->check_exists);
}
;
Expand Down Expand Up @@ -6194,13 +6194,13 @@ vcol_attribute:
UNIQUE_SYM
{
LEX *lex=Lex;
lex->last_field->flags|= UNIQUE_FLAG;
lex->last_field->flags|= UNIQUE_KEY_FLAG;
lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX;
}
| UNIQUE_SYM KEY_SYM
{
LEX *lex=Lex;
lex->last_field->flags|= UNIQUE_FLAG;
lex->last_field->flags|= UNIQUE_KEY_FLAG;
lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX;
}
| COMMENT_SYM TEXT_STRING_sys { Lex->last_field->comment= $2; }
Expand Down Expand Up @@ -6407,7 +6407,7 @@ field_type:
{
$$.set(MYSQL_TYPE_LONGLONG);
Lex->last_field->flags|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG |
UNIQUE_FLAG);
UNIQUE_KEY_FLAG);
}
;

Expand Down Expand Up @@ -6544,7 +6544,7 @@ attribute:
| SERIAL_SYM DEFAULT VALUE_SYM
{
LEX *lex=Lex;
lex->last_field->flags|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG;
lex->last_field->flags|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_KEY_FLAG;
lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX;
}
| opt_primary KEY_SYM
Expand All @@ -6556,7 +6556,7 @@ attribute:
| UNIQUE_SYM
{
LEX *lex=Lex;
lex->last_field->flags|= UNIQUE_FLAG;
lex->last_field->flags|= UNIQUE_KEY_FLAG;
lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX;
}
| UNIQUE_SYM KEY_SYM
Expand Down

0 comments on commit 13989b3

Please sign in to comment.