Skip to content

Commit

Permalink
refactor: fix error message. (#16578)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun authored Oct 10, 2024
1 parent 034ec72 commit 3c011dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/query/ast/src/ast/quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::parser::Dialect;
// In ANSI SQL, it does not need to quote an identifier if the identifier matches
// the following regular expression: [A-Za-z_][A-Za-z0-9_$]*.
//
// There're also two known special cases in Databend which do not requires quoting:
// There are also two known special cases in Databend which do not require quoting:
// - "~" is a valid stage name
// - '$' is a valid character in some system functions
pub fn ident_needs_quote(ident: &str) -> bool {
Expand Down
6 changes: 3 additions & 3 deletions src/query/ast/src/parser/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2249,9 +2249,9 @@ pub fn statement_body(i: Input) -> IResult<Statement> {
rule!(
#show_users : "`SHOW USERS`"
| #describe_user: "`DESCRIBE USER <user_name>`"
| #create_user : "`CREATE [OR REPLACE] USER [IF NOT EXISTS] '<username>'@'hostname' IDENTIFIED [WITH <auth_type>] [BY <password>] [WITH <user_option>, ...]`"
| #alter_user : "`ALTER USER ('<username>'@'hostname' | USER()) [IDENTIFIED [WITH <auth_type>] [BY <password>]] [WITH <user_option>, ...]`"
| #drop_user : "`DROP USER [IF EXISTS] '<username>'@'hostname'`"
| #create_user : "`CREATE [OR REPLACE] USER [IF NOT EXISTS] '<username>' IDENTIFIED [WITH <auth_type>] [BY <password>] [WITH <user_option>, ...]`"
| #alter_user : "`ALTER USER ('<username>' | USER()) [IDENTIFIED [WITH <auth_type>] [BY <password>]] [WITH <user_option>, ...]`"
| #drop_user : "`DROP USER [IF EXISTS] '<username>'`"
| #show_roles : "`SHOW ROLES`"
| #create_role : "`CREATE ROLE [IF NOT EXISTS] <role_name>`"
| #drop_role : "`DROP ROLE [IF EXISTS] <role_name>`"
Expand Down
2 changes: 1 addition & 1 deletion src/query/ast/tests/it/testdata/stmt-error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ error:
1 | create user 'test-e'@'localhost' identified by 'password';
| ------ ^^^^^^^^^^^ unexpected `'localhost'`, expecting `'%'` or `IDENTIFIED`
| |
| while parsing `CREATE [OR REPLACE] USER [IF NOT EXISTS] '<username>'@'hostname' IDENTIFIED [WITH <auth_type>] [BY <password>] [WITH <user_option>, ...]`
| while parsing `CREATE [OR REPLACE] USER [IF NOT EXISTS] '<username>' IDENTIFIED [WITH <auth_type>] [BY <password>] [WITH <user_option>, ...]`


---------- Input ----------
Expand Down

0 comments on commit 3c011dc

Please sign in to comment.