Skip to content

Commit b91485a

Browse files
committed
Add testcase for CREATE PROCEDURE with LANGUAGE clause
1 parent f496766 commit b91485a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/sqlparser_common.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15349,3 +15349,33 @@ fn check_enforced() {
1534915349
"CREATE TABLE t (a INT, b INT, c INT, CHECK (a > 0) NOT ENFORCED, CHECK (b > 0) ENFORCED, CHECK (c > 0))",
1535015350
);
1535115351
}
15352+
15353+
#[test]
15354+
fn parse_create_procedure_with_language() {
15355+
let sql = r#"CREATE PROCEDURE test_proc LANGUAGE sql AS BEGIN SELECT 1; END"#;
15356+
match verified_stmt(sql) {
15357+
Statement::CreateProcedure {
15358+
or_alter,
15359+
name,
15360+
params,
15361+
language,
15362+
..
15363+
} => {
15364+
assert_eq!(or_alter, false);
15365+
assert_eq!(name.to_string(), "test_proc");
15366+
assert_eq!(params, Some(vec![]));
15367+
assert_eq!(
15368+
language,
15369+
Some(Ident {
15370+
value: "sql".into(),
15371+
quote_style: None,
15372+
span: Span {
15373+
start: Location::empty(),
15374+
end: Location::empty()
15375+
}
15376+
})
15377+
);
15378+
}
15379+
_ => unreachable!(),
15380+
}
15381+
}

0 commit comments

Comments
 (0)