diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/lex.h | 1 | ||||
-rw-r--r-- | sql/sql_lex.h | 3 | ||||
-rw-r--r-- | sql/sql_parse.cc | 1 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 16 |
4 files changed, 19 insertions, 2 deletions
diff --git a/sql/lex.h b/sql/lex.h index 3e64e3d12b8..7916eb467ef 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -248,6 +248,7 @@ static SYMBOL symbols[] = { { "RENAME", SYM(RENAME),0,0}, { "REPAIR", SYM(REPAIR),0,0}, { "REPLACE", SYM(REPLACE),0,0}, + { "RESET", SYM(RESET_SYM),0,0}, { "RESTORE", SYM(RESTORE_SYM),0,0}, { "RESTRICT", SYM(RESTRICT),0,0}, { "RETURNS", SYM(UDF_RETURNS_SYM),0,0}, diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 05189afc907..aa1a326cad7 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -47,7 +47,8 @@ enum enum_sql_command { SQLCOM_ROLLBACK, SQLCOM_COMMIT, SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP, SQLCOM_BEGIN, SQLCOM_LOAD_MASTER_TABLE, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT, SQLCOM_CHANGE_MASTER, - SQLCOM_RENAME_TABLE, SQLCOM_BACKUP_TABLE, SQLCOM_RESTORE_TABLE + SQLCOM_RENAME_TABLE, SQLCOM_BACKUP_TABLE, SQLCOM_RESTORE_TABLE, + SQLCOM_RESET }; enum lex_states { STATE_START, STATE_CHAR, STATE_IDENT, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ca8a7b5fe14..83355d08925 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1674,6 +1674,7 @@ mysql_execute_command(void) break; } case SQLCOM_FLUSH: + case SQLCOM_RESET: if (check_access(thd,RELOAD_ACL,any_db) || check_db_used(thd, tables)) goto error; if (reload_acl_and_cache(thd, lex->type, tables)) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 76a11ebb8ff..2ab78a0e7a0 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -106,6 +106,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token SELECT_SYM %token MASTER_SYM %token REPAIR +%token RESET_SYM %token SLAVE %token START_SYM %token STOP_SYM @@ -491,7 +492,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %type <NONE> query verb_clause create change select drop insert replace insert2 insert_values update delete show describe load alter optimize flush - begin commit rollback slave master_def master_defs + reset begin commit rollback slave master_def master_defs repair restore backup analyze check rename field_list field_list_item field_spec kill select_item_list select_item values_list no_braces @@ -550,6 +551,7 @@ verb_clause: | rename | repair | replace + | reset | restore | revoke | rollback @@ -2231,6 +2233,17 @@ opt_table_list: /* empty */ {} | table_list {} +reset: + RESET_SYM {Lex->sql_command= SQLCOM_RESET; Lex->type=0; } reset_options + +reset_options: + reset_options ',' reset_option + | reset_option + +reset_option: + SLAVE { Lex->type|= REFRESH_SLAVE; } + | MASTER_SYM { Lex->type|= REFRESH_MASTER; } + /* kill threads */ kill: @@ -2482,6 +2495,7 @@ keyword: | RAID_TYPE {} | RELOAD {} | REPAIR {} + | RESET_SYM {} | RESTORE_SYM {} | ROLLBACK_SYM {} | ROWS_SYM {} |