diff --git a/common/ast/src/ast/statement.rs b/common/ast/src/ast/statement.rs index f0613c805d5c..e2f24823cae7 100644 --- a/common/ast/src/ast/statement.rs +++ b/common/ast/src/ast/statement.rs @@ -990,7 +990,7 @@ impl<'a> Display for Statement<'a> { if *if_not_exists { write!(f, " IF NOT EXISTS")?; } - write!(f, " {role}")?; + write!(f, " '{role}'")?; } Statement::DropRole { if_exists, @@ -1000,7 +1000,7 @@ impl<'a> Display for Statement<'a> { if *if_exists { write!(f, " IF EXISTS")?; } - write!(f, " {role}")?; + write!(f, " '{role}'")?; } Statement::CreateUDF { if_not_exists, diff --git a/common/ast/tests/it/testdata/statement.txt b/common/ast/tests/it/testdata/statement.txt index 88e266ac5343..1d4c8956d209 100644 --- a/common/ast/tests/it/testdata/statement.txt +++ b/common/ast/tests/it/testdata/statement.txt @@ -3153,7 +3153,7 @@ AlterUser { ---------- Input ---------- create role 'test' ---------- Output --------- -CREATE ROLE test +CREATE ROLE 'test' ---------- AST ------------ CreateRole { if_not_exists: false, @@ -3164,7 +3164,7 @@ CreateRole { ---------- Input ---------- drop role if exists 'test' ---------- Output --------- -DROP ROLE IF EXISTS test +DROP ROLE IF EXISTS 'test' ---------- AST ------------ DropRole { if_exists: true,