@@ -40,8 +40,9 @@ use sqlparser::parser::{Parser, ParserError, ParserOptions};
40
40
use sqlparser::tokenizer::Tokenizer;
41
41
use sqlparser::tokenizer::{Location, Span};
42
42
use test_utils::{
43
- all_dialects, all_dialects_where, alter_table_op, assert_eq_vec, call, expr_from_projection,
44
- join, number, only, table, table_alias, table_from_name, TestedDialects,
43
+ all_dialects, all_dialects_where, all_dialects_with_options, alter_table_op, assert_eq_vec,
44
+ call, expr_from_projection, join, number, only, table, table_alias, table_from_name,
45
+ TestedDialects,
45
46
};
46
47
47
48
#[macro_use]
@@ -16115,3 +16116,20 @@ fn test_select_exclude() {
16115
16116
ParserError::ParserError("Expected: end of statement, found: EXCLUDE".to_string())
16116
16117
);
16117
16118
}
16119
+
16120
+ #[test]
16121
+ fn test_no_semicolon_required_between_statements() {
16122
+ let sql = r#"
16123
+ SELECT * FROM tbl1
16124
+ SELECT * FROM tbl2
16125
+ "#;
16126
+
16127
+ let dialects = all_dialects_with_options(ParserOptions {
16128
+ trailing_commas: false,
16129
+ unescape: true,
16130
+ require_semicolon_stmt_delimiter: false,
16131
+ });
16132
+ let stmts = dialects.parse_sql_statements(sql).unwrap();
16133
+ assert_eq!(stmts.len(), 2);
16134
+ assert!(stmts.iter().all(|s| matches!(s, Statement::Query { .. })));
16135
+ }
0 commit comments