MSSQL: Add support for EXEC output and default keywords (#1940)

This commit is contained in:
Yoav Cohen 2025-07-14 10:19:28 +02:00 committed by GitHub
parent 750a7aa054
commit 9b9ffe450c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 47 additions and 4 deletions

View file

@ -11393,6 +11393,8 @@ fn parse_execute_stored_procedure() {
immediate: false,
using: vec![],
into: vec![],
output: false,
default: false,
};
assert_eq!(
// Microsoft SQL Server does not use parentheses around arguments for EXECUTE
@ -11407,6 +11409,18 @@ fn parse_execute_stored_procedure() {
),
expected
);
match ms_and_generic().verified_stmt("EXECUTE dbo.proc1 @ReturnVal = @X OUTPUT") {
Statement::Execute { output, .. } => {
assert!(output);
}
_ => unreachable!(),
}
match ms_and_generic().verified_stmt("EXECUTE dbo.proc1 DEFAULT") {
Statement::Execute { default, .. } => {
assert!(default);
}
_ => unreachable!(),
}
}
#[test]
@ -11425,6 +11439,8 @@ fn parse_execute_immediate() {
into: vec![Ident::new("a")],
name: None,
has_parentheses: false,
output: false,
default: false,
};
let stmt = dialects.verified_stmt("EXECUTE IMMEDIATE 'SELECT 1' INTO a USING 1 AS b");