Skip to content

Commit eba3aef

Browse files
Cover sequence-option numeric error propagation
1 parent e4872b5 commit eba3aef

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎tests/sqlparser_common.rs‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20919,3 +20919,35 @@ fn parse_sequence_options_in_any_order() {
2091920919
);
2092020920
}
2092120921
}
20922+
20923+
#[test]
20924+
fn sequence_options_reject_non_numeric_values() {
20925+
let dialects = all_dialects();
20926+
for (sql, expected) in [
20927+
(
20928+
"CREATE SEQUENCE s MINVALUE x",
20929+
"Expected: a concrete value, found: x",
20930+
),
20931+
(
20932+
"CREATE SEQUENCE s MAXVALUE x",
20933+
"Expected: a concrete value, found: x",
20934+
),
20935+
(
20936+
"CREATE SEQUENCE s START WITH x",
20937+
"Expected: a concrete value, found: x",
20938+
),
20939+
(
20940+
"CREATE SEQUENCE s CACHE x",
20941+
"Expected: a concrete value, found: x",
20942+
),
20943+
(
20944+
"CREATE TABLE t (id INT GENERATED BY DEFAULT AS IDENTITY (MINVALUE x))",
20945+
"Expected: a concrete value, found: x",
20946+
),
20947+
] {
20948+
assert_eq!(
20949+
dialects.parse_sql_statements(sql).unwrap_err(),
20950+
ParserError::ParserError(expected.to_string()),
20951+
);
20952+
}
20953+
}

0 commit comments

Comments
 (0)