[CP] [CP] Support set names with variables

This commit is contained in:
wjhh2008
2024-03-28 09:46:01 +00:00
committed by ob-robot
parent cb545cb059
commit 72302550bb
9 changed files with 187 additions and 83 deletions

View File

@ -484,7 +484,6 @@ END_P SET_VAR DELIMITER
%type <node> zone_action upgrade_action
%type <node> opt_index_name opt_key_or_index opt_index_options opt_primary opt_all
%type <node> charset_key database_key charset_name charset_name_or_default collation_name databases_or_schemas trans_param_name trans_param_value
%type <node> set_names_stmt set_charset_stmt
%type <node> charset_introducer complex_string_literal literal number_literal now_or_signed_literal signed_literal
%type <node> create_tablegroup_stmt drop_tablegroup_stmt alter_tablegroup_stmt default_tablegroup
%type <node> set_transaction_stmt transaction_characteristics transaction_access_mode isolation_level
@ -663,8 +662,6 @@ stmt:
| create_resource_stmt { $$ = $1; check_question_mark($$, result); }
| alter_resource_stmt { $$ = $1; check_question_mark($$, result); }
| drop_resource_stmt { $$ = $1; check_question_mark($$, result); }
| set_names_stmt { $$ = $1; check_question_mark($$, result); }
| set_charset_stmt { $$ = $1; check_question_mark($$, result); }
| create_tablegroup_stmt { $$ = $1; check_question_mark($$, result); }
| drop_tablegroup_stmt { $$ = $1; check_question_mark($$, result); }
| alter_tablegroup_stmt { $$ = $1; check_question_mark($$, result); }
@ -8183,7 +8180,7 @@ UNDEFINED { $$ = NULL; }
| TEMPTABLE { $$ = NULL; }
opt_definer:
DEFINER COMP_EQ user
DEFINER COMP_EQ user_with_host_name
{
(void)($3);
$$ = NULL;
@ -15020,6 +15017,15 @@ USER_VARIABLE to_or_eq expr
malloc_non_terminal_node($$, result->malloc_pool_, T_VAR_VAL, 2, $1, $3);
$$->value_ = 2;
}
| NAMES charset_name_or_default opt_collation
{
malloc_non_terminal_node($$, result->malloc_pool_, T_SET_NAMES, 2, $2, $3);
}
| charset_key charset_name_or_default
{
(void)($1);
malloc_non_terminal_node($$, result->malloc_pool_, T_SET_CHARSET, 1, $2);
};
;
sys_var_and_val:
@ -18815,23 +18821,6 @@ extension:
//}
;
////////////////////////////////////////////////////////////////
/* SET NAMES 'charset_name' [COLLATE 'collation_name'] */
set_names_stmt:
SET NAMES charset_name_or_default opt_collation
{
malloc_non_terminal_node($$, result->malloc_pool_, T_SET_NAMES, 2, $3, $4);
};
////////////////////////////////////////////////////////////////
/* SET CHARACTER SET charset_name */
set_charset_stmt:
SET charset_key charset_name_or_default
{
(void)($2);
malloc_non_terminal_node($$, result->malloc_pool_, T_SET_CHARSET, 1, $3);
};
//////////////////////////////
set_transaction_stmt:
SET TRANSACTION transaction_characteristics