Skip to content

Commit

Permalink
Add more test case
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hulk committed Sep 29, 2024
1 parent d26c906 commit 69a1f36
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/sqlparser_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11127,6 +11127,19 @@ fn test_alter_policy() {
// omit TO / USING / WITH CHECK clauses is allowed
verified_stmt("ALTER POLICY my_policy ON my_table");

// mixing RENAME and APPLY expressions
assert_eq!(
parse_sql_statements("ALTER POLICY old_policy ON my_table TO public RENAME TO new_policy")
.unwrap_err()
.to_string(),
"sql parser error: Expected: end of statement, found: RENAME"
);
assert_eq!(
parse_sql_statements("ALTER POLICY old_policy ON my_table RENAME TO new_policy TO public")
.unwrap_err()
.to_string(),
"sql parser error: Expected: end of statement, found: TO"
);
// missing TO in RENAME TO
assert_eq!(
parse_sql_statements("ALTER POLICY old_policy ON my_table RENAME")
Expand Down

0 comments on commit 69a1f36

Please sign in to comment.