Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/pgt_statement_splitter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ mod tests {
}
}

#[test]
fn ts_with_timezone() {
Tester::from("alter table foo add column bar timestamp with time zone;").expect_statements(
vec!["alter table foo add column bar timestamp with time zone;"],
);
}

#[test]
fn failing_lexer() {
let input = "select 1443ddwwd33djwdkjw13331333333333";
Expand Down
2 changes: 2 additions & 0 deletions crates/pgt_statement_splitter/src/parser/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ pub(crate) fn unknown(p: &mut Parser, exclude: &[SyntaxKind]) {
SyntaxKind::Ordinality,
// WITH CHECK should not start a new statement
SyntaxKind::Check,
// TIMESTAMP WITH TIME ZONE should not start a new statement
SyntaxKind::Time,
]
.iter()
.all(|x| Some(x) != next.as_ref())
Expand Down