Skip to content

Commit 69a1f36

Browse files
committed
Add more test case
1 parent d26c906 commit 69a1f36

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/sqlparser_common.rs

+13
Original file line numberDiff line numberDiff line change
@@ -11127,6 +11127,19 @@ fn test_alter_policy() {
1112711127
// omit TO / USING / WITH CHECK clauses is allowed
1112811128
verified_stmt("ALTER POLICY my_policy ON my_table");
1112911129

11130+
// mixing RENAME and APPLY expressions
11131+
assert_eq!(
11132+
parse_sql_statements("ALTER POLICY old_policy ON my_table TO public RENAME TO new_policy")
11133+
.unwrap_err()
11134+
.to_string(),
11135+
"sql parser error: Expected: end of statement, found: RENAME"
11136+
);
11137+
assert_eq!(
11138+
parse_sql_statements("ALTER POLICY old_policy ON my_table RENAME TO new_policy TO public")
11139+
.unwrap_err()
11140+
.to_string(),
11141+
"sql parser error: Expected: end of statement, found: TO"
11142+
);
1113011143
// missing TO in RENAME TO
1113111144
assert_eq!(
1113211145
parse_sql_statements("ALTER POLICY old_policy ON my_table RENAME")

0 commit comments

Comments
 (0)