diff options
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 113 |
1 files changed, 76 insertions, 37 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 62090873178..3109aadca38 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -749,7 +749,10 @@ change: LEX *lex = Lex; lex->sql_command = SQLCOM_CHANGE_MASTER; bzero((char*) &lex->mi, sizeof(lex->mi)); - } master_defs; + } + master_defs + {} + ; master_defs: master_def @@ -830,7 +833,7 @@ create: lex->create_info.table_charset=thd->db_charset?thd->db_charset:default_charset_info; } create2 - + {} | CREATE opt_unique_or_fulltext INDEX ident key_alg ON table_ident { LEX *lex=Lex; @@ -1382,8 +1385,9 @@ alter: lex->alter_keys_onoff=LEAVE_AS_IS; lex->simple_alter=1; } - alter_list; - + alter_list + {} + ; | ALTER DATABASE ident opt_db_default_character_set { LEX *lex=Lex; @@ -1549,7 +1553,9 @@ repair: lex->sql_command = SQLCOM_REPAIR; lex->check_opt.init(); } - table_list opt_mi_repair_type; + table_list opt_mi_repair_type + {} + ; opt_mi_repair_type: /* empty */ { Lex->check_opt.flags = T_MEDIUM; } @@ -1571,7 +1577,9 @@ analyze: lex->sql_command = SQLCOM_ANALYZE; lex->check_opt.init(); } - table_list opt_mi_check_type; + table_list opt_mi_check_type + {} + ; check: CHECK_SYM table_or_tables @@ -1580,7 +1588,9 @@ check: lex->sql_command = SQLCOM_CHECK; lex->check_opt.init(); } - table_list opt_mi_check_type; + table_list opt_mi_check_type + {} + ; opt_mi_check_type: /* empty */ { Lex->check_opt.flags = T_MEDIUM; } @@ -1604,14 +1614,18 @@ optimize: lex->sql_command = SQLCOM_OPTIMIZE; lex->check_opt.init(); } - table_list opt_mi_check_type; + table_list opt_mi_check_type + {} + ; rename: RENAME table_or_tables { Lex->sql_command=SQLCOM_RENAME_TABLE; } - table_to_table_list; + table_to_table_list + {} + ; table_to_table_list: table_to_table @@ -1642,7 +1656,7 @@ select_init: { LEX *lex= Lex; SELECT_LEX_NODE * sel= lex->current_select; - if (sel->set_braces(true)) + if (sel->set_braces(1)) { send_error(lex->thd, ER_SYNTAX_ERROR); YYABORT; @@ -1656,7 +1670,7 @@ select_init2: select_part2 { LEX *lex= Lex; - if (lex->current_select->set_braces(false)) + if (lex->current_select->set_braces(0)) { send_error(lex->thd, ER_SYNTAX_ERROR); YYABORT; @@ -2482,7 +2496,7 @@ join_table: select_derived: { LEX *lex= Lex; - lex->derived_tables= true; + lex->derived_tables= 1; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE || mysql_new_select(lex, 1)) YYABORT; @@ -2618,7 +2632,7 @@ olap_opt: | WITH CUBE_SYM { LEX *lex=Lex; - lex->olap = true; + lex->olap= 1; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) { net_printf(lex->thd, ER_WRONG_USAGE, "WITH CUBE", @@ -2632,7 +2646,7 @@ olap_opt: | WITH ROLLUP_SYM { LEX *lex= Lex; - lex->olap= true; + lex->olap= 1; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) { net_printf(lex->thd, ER_WRONG_USAGE, "WITH ROLLUP", @@ -2699,6 +2713,7 @@ limit_clause: } } limit_options + {} ; limit_options: @@ -2753,7 +2768,7 @@ procedure_clause: lex->proc_list.elements=0; lex->proc_list.first=0; lex->proc_list.next= (byte**) &lex->proc_list.first; - if (add_proc_to_list(new Item_field(NULL,NULL,$2.str))) + if (add_proc_to_list(lex->thd, new Item_field(NULL,NULL,$2.str))) YYABORT; Lex->safe_to_cache_query=0; } @@ -2771,10 +2786,11 @@ procedure_list2: procedure_item: remember_name expr { - if (add_proc_to_list($2)) + LEX *lex= Lex; + if (add_proc_to_list(lex->thd, $2)) YYABORT; if (!$2->name) - $2->set_name($1,(uint) ((char*) Lex->tok_end - $1)); + $2->set_name($1,(uint) ((char*) lex->tok_end - $1)); } ; @@ -2842,7 +2858,10 @@ do: DO_SYM if (!(lex->insert_list = new List_item)) YYABORT; } - values; + values + {} + ; + /* Drop : delete tables or index */ @@ -2928,6 +2947,8 @@ replace: Select->set_lock_for_tables($3); } insert_field_spec + {} + {} ; insert_lock_option: @@ -3122,13 +3143,15 @@ single_multi: YYABORT; } where_clause opt_order_clause - delete_limit_clause + delete_limit_clause {} | table_wild_list { mysql_init_multi_delete(Lex); } FROM join_table_list where_clause | FROM table_wild_list { mysql_init_multi_delete(Lex); } - USING join_table_list where_clause; + USING join_table_list where_clause + {} + ; table_wild_list: table_wild_one {} @@ -3184,7 +3207,9 @@ show: SHOW lex->wild=0; bzero((char*) &lex->create_info,sizeof(lex->create_info)); } - show_param; + show_param + {} + ; show_param: DATABASES wild @@ -3354,13 +3379,13 @@ describe: if (!Select->add_table_to_list($2, NULL,0)) YYABORT; } - opt_describe_column + opt_describe_column {} | describe_command { Lex->describe=1; } select { LEX *lex=Lex; lex->select_lex.options|= SELECT_DESCRIBE; - }; - + } + ; describe_command: DESC @@ -3381,14 +3406,16 @@ flush: LEX *lex=Lex; lex->sql_command= SQLCOM_FLUSH; lex->type=0; } - flush_options; + flush_options + {} + ; flush_options: flush_options ',' flush_option | flush_option; flush_option: - table_or_tables { Lex->type|= REFRESH_TABLES; } opt_table_list + table_or_tables { Lex->type|= REFRESH_TABLES; } opt_table_list {} | TABLES WITH READ_SYM LOCK_SYM { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; } | QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE_FREE; } | HOSTS_SYM { Lex->type|= REFRESH_HOSTS; } @@ -3409,7 +3436,10 @@ reset: { LEX *lex=Lex; lex->sql_command= SQLCOM_RESET; lex->type=0; - } reset_options; + } reset_options + {} + ; + reset_options: reset_options ',' reset_option | reset_option; @@ -3840,7 +3870,9 @@ set: lex->option_type=OPT_DEFAULT; lex->var_list.empty(); } - option_value_list; + option_value_list + {} + ; opt_option: /* empty */ {} @@ -3964,7 +3996,9 @@ lock: { Lex->sql_command=SQLCOM_LOCK_TABLES; } - table_lock_list; + table_lock_list + {} + ; table_or_tables: TABLE_SYM @@ -4074,7 +4108,9 @@ revoke: lex->ssl_cipher= lex->x509_subject= lex->x509_issuer= 0; bzero((char*) &lex->mqh, sizeof(lex->mqh)); } - grant_privileges ON opt_table FROM user_list; + grant_privileges ON opt_table FROM user_list + {} + ; grant: GRANT @@ -4090,7 +4126,9 @@ grant: bzero(&(lex->mqh),sizeof(lex->mqh)); } grant_privileges ON opt_table TO_SYM user_list - require_clause grant_options; + require_clause grant_options + {} + ; grant_privileges: grant_privilege_list {} @@ -4103,10 +4141,10 @@ grant_privilege_list: | grant_privilege_list ',' grant_privilege; grant_privilege: - SELECT_SYM { Lex->which_columns = SELECT_ACL;} opt_column_list - | INSERT { Lex->which_columns = INSERT_ACL;} opt_column_list - | UPDATE_SYM { Lex->which_columns = UPDATE_ACL; } opt_column_list - | REFERENCES { Lex->which_columns = REFERENCES_ACL;} opt_column_list + SELECT_SYM { Lex->which_columns = SELECT_ACL;} opt_column_list {} + | INSERT { Lex->which_columns = INSERT_ACL;} opt_column_list {} + | UPDATE_SYM { Lex->which_columns = UPDATE_ACL; } opt_column_list {} + | REFERENCES { Lex->which_columns = REFERENCES_ACL;} opt_column_list {} | DELETE_SYM { Lex->grant |= DELETE_ACL;} | USAGE {} | INDEX { Lex->grant |= INDEX_ACL;} @@ -4333,7 +4371,8 @@ grant_option: ; begin: - BEGIN_SYM { Lex->sql_command = SQLCOM_BEGIN;} opt_work; + BEGIN_SYM { Lex->sql_command = SQLCOM_BEGIN;} opt_work {} + ; opt_work: /* empty */ {} @@ -4376,7 +4415,7 @@ union_list: YYABORT; lex->current_select->linkage=UNION_TYPE; } - select_init + select_init {} ; union_opt: |