mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +00:00
Extend exception handling (#1884)
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
This commit is contained in:
parent
185a490218
commit
204d3b484d
8 changed files with 178 additions and 67 deletions
|
@ -261,10 +261,10 @@ fn parse_at_at_identifier() {
|
|||
|
||||
#[test]
|
||||
fn parse_begin() {
|
||||
let sql = r#"BEGIN SELECT 1; EXCEPTION WHEN ERROR THEN SELECT 2; END"#;
|
||||
let sql = r#"BEGIN SELECT 1; EXCEPTION WHEN ERROR THEN SELECT 2; RAISE USING MESSAGE = FORMAT('ERR: %s', 'Bad'); END"#;
|
||||
let Statement::StartTransaction {
|
||||
statements,
|
||||
exception_statements,
|
||||
exception,
|
||||
has_end_keyword,
|
||||
..
|
||||
} = bigquery().verified_stmt(sql)
|
||||
|
@ -272,7 +272,10 @@ fn parse_begin() {
|
|||
unreachable!();
|
||||
};
|
||||
assert_eq!(1, statements.len());
|
||||
assert_eq!(1, exception_statements.unwrap().len());
|
||||
assert!(exception.is_some());
|
||||
|
||||
let exception = exception.unwrap();
|
||||
assert_eq!(1, exception.len());
|
||||
assert!(has_end_keyword);
|
||||
|
||||
bigquery().verified_stmt(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue