add 'WITH mysql_native_password' grammar

This commit is contained in:
jingtaoye35
2023-10-11 12:13:26 +00:00
committed by ob-robot
parent 212b6f89c1
commit 07082136a1
9 changed files with 166 additions and 50 deletions

View File

@ -427,7 +427,7 @@ END_P SET_VAR DELIMITER
%type <node> deallocate_prepare_stmt deallocate_or_drop
%type <ival> opt_scope opt_drop_behavior opt_integer scope_or_scope_alias global_or_session_alias
%type <ival> int_type_i float_type_i datetime_type_i date_year_type_i cast_datetime_type_i text_type_i blob_type_i
%type <node> create_user_stmt user_specification user_specification_list user password opt_host_name user_with_host_name
%type <node> create_user_stmt user_specification user_specification_list user password opt_host_name user_with_host_name opt_auth_plugin
%type <node> drop_user_stmt user_list
%type <node> set_password_stmt opt_for_user
%type <node> rename_user_stmt rename_info rename_list
@ -12570,27 +12570,42 @@ user_specification
}
;
opt_auth_plugin:
WITH STRING_VALUE
{
$$ = $2;
}
| WITH NAME_OB
{
$$ = $2;
}
|
{
$$ = NULL;
}
;
user_specification:
user opt_host_name
{
ParseNode *need_enc_node = NULL;
malloc_terminal_node(need_enc_node, result->malloc_pool_, T_BOOL);
need_enc_node->value_ = 0;
malloc_non_terminal_node($$, result->malloc_pool_, T_CREATE_USER_SPEC, 4, $1, NULL, need_enc_node, $2);
malloc_non_terminal_node($$, result->malloc_pool_, T_CREATE_USER_SPEC, 5, $1, NULL, need_enc_node, $2, NULL);
}
| user opt_host_name IDENTIFIED BY password
| user opt_host_name IDENTIFIED opt_auth_plugin BY password
{
ParseNode *need_enc_node = NULL;
malloc_terminal_node(need_enc_node, result->malloc_pool_, T_BOOL);
need_enc_node->value_ = 1;
malloc_non_terminal_node($$, result->malloc_pool_, T_CREATE_USER_SPEC, 4, $1, $5, need_enc_node, $2);
malloc_non_terminal_node($$, result->malloc_pool_, T_CREATE_USER_SPEC, 5, $1, $6, need_enc_node, $2, $4);
}
| user opt_host_name IDENTIFIED BY PASSWORD password
| user opt_host_name IDENTIFIED opt_auth_plugin BY PASSWORD password
{
ParseNode *need_enc_node = NULL;
malloc_terminal_node(need_enc_node, result->malloc_pool_, T_BOOL);
need_enc_node->value_ = 0;
malloc_non_terminal_node($$, result->malloc_pool_, T_CREATE_USER_SPEC, 4, $1, $6, need_enc_node, $2);
malloc_non_terminal_node($$, result->malloc_pool_, T_CREATE_USER_SPEC, 5, $1, $7, need_enc_node, $2, $4);
}
;
@ -12774,21 +12789,21 @@ SET PASSWORD opt_for_user COMP_EQ STRING_VALUE
ParseNode *need_enc_node = NULL;
malloc_terminal_node(need_enc_node, result->malloc_pool_, T_BOOL);
need_enc_node->value_ = 0;
malloc_non_terminal_node($$, result->malloc_pool_, T_SET_PASSWORD, 4, $3, $5, need_enc_node, NULL);
malloc_non_terminal_node($$, result->malloc_pool_, T_SET_PASSWORD, 5, $3, $5, need_enc_node, NULL, NULL);
}
| SET PASSWORD opt_for_user COMP_EQ PASSWORD '(' password ')'
{
ParseNode *need_enc_node = NULL;
malloc_terminal_node(need_enc_node, result->malloc_pool_, T_BOOL);
need_enc_node->value_ = 1;
malloc_non_terminal_node($$, result->malloc_pool_, T_SET_PASSWORD, 4, $3, $7, need_enc_node, NULL);
malloc_non_terminal_node($$, result->malloc_pool_, T_SET_PASSWORD, 5, $3, $7, need_enc_node, NULL, NULL);
}
| ALTER USER user_with_host_name IDENTIFIED BY password
| ALTER USER user_with_host_name IDENTIFIED opt_auth_plugin BY password
{
ParseNode *need_enc_node = NULL;
malloc_terminal_node(need_enc_node, result->malloc_pool_, T_BOOL);
need_enc_node->value_ = 1;
malloc_non_terminal_node($$, result->malloc_pool_, T_SET_PASSWORD, 4, $3, $6, need_enc_node, NULL);
malloc_non_terminal_node($$, result->malloc_pool_, T_SET_PASSWORD, 5, $3, $7, need_enc_node, NULL, $5);
}
| ALTER USER user_with_host_name require_specification
{