Skip to content

Commit

Permalink
fix(query):user option DEFAULT_ROLE ignore ascii_case
Browse files Browse the repository at this point in the history
  • Loading branch information
TCeason committed Mar 31, 2024
1 parent 34ce8e3 commit 93651c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/query/ast/src/parser/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3732,7 +3732,7 @@ pub fn user_option(i: Input) -> IResult<UserOptionItem> {
);
let default_role_option = map(
rule! {
"DEFAULT_ROLE" ~ ^"=" ~ ^#role_name
DEFAULT_ROLE ~ ^"=" ~ ^#role_name
},
|(_, _, role)| UserOptionItem::DefaultRole(role),
);
Expand Down
2 changes: 2 additions & 0 deletions src/query/ast/src/parser/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,8 @@ pub enum TokenKind {
NOT,
#[token("NOTENANTSETTING", ignore(ascii_case))]
NOTENANTSETTING,
#[token("DEFAULT_ROLE", ignore(ascii_case))]
DEFAULT_ROLE,
#[token("NULL", ignore(ascii_case))]
NULL,
#[token("NULLABLE", ignore(ascii_case))]
Expand Down
2 changes: 1 addition & 1 deletion src/query/ast/tests/it/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ fn test_statement() {
r#"CREATE TABLE t(c1 int default 1);"#,
r#"create table abc as (select * from xyz limit 10)"#,
r#"ALTER USER u1 IDENTIFIED BY '123456';"#,
r#"ALTER USER u1 WITH DEFAULT_ROLE = role1;"#,
r#"ALTER USER u1 WITH default_role = role1;"#,
r#"ALTER USER u1 WITH DEFAULT_ROLE = role1, TENANTSETTING;"#,
r#"ALTER USER u1 WITH SET NETWORK POLICY = 'policy1';"#,
r#"ALTER USER u1 WITH UNSET NETWORK POLICY;"#,
Expand Down

0 comments on commit 93651c9

Please sign in to comment.