Skip to content

Commit

Permalink
fix alter database collation
Browse files Browse the repository at this point in the history
  • Loading branch information
chdsbd committed Nov 7, 2023
1 parent a4b5d41 commit 05c26ce
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions parser/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@ pub enum Stmt {
ViewStmt(Value),
LoadStmt(Value),
CreatedbStmt(Value),
AlterDatabaseRefreshCollStmt(Value),
AlterDatabaseStmt(Value),
AlterDatabaseSetStmt(Value),
DropdbStmt(Value),
Expand Down
9 changes: 9 additions & 0 deletions parser/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,15 @@ ALTER DATABASE name RESET ALL;
assert_debug_snapshot!(res);
}

#[test]
fn test_alter_database_collation() {
let sql = r#"
ALTER DATABASE pipelines REFRESH COLLATION VERSION;
"#;
let res = parse_sql_query(sql);
assert_debug_snapshot!(res);
}

#[test]
fn test_drop_database_stmt() {
let sql = r#"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
source: parser/src/parse.rs
expression: res
---
Ok(
[
RawStmt {
stmt: AlterDatabaseRefreshCollStmt(
Object({
"dbname": String(
"pipelines",
),
}),
),
stmt_location: 0,
stmt_len: Some(
51,
),
},
],
)

0 comments on commit 05c26ce

Please sign in to comment.