mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-15 00:09:02 +00:00
Use Option<Expr>
for Min and Max vals in Seq Opts, fix alter col seq display (#1106)
This commit is contained in:
parent
1b6b6aa65f
commit
f5e27366f3
3 changed files with 21 additions and 38 deletions
|
@ -8805,24 +8805,21 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
//[ MINVALUE minvalue | NO MINVALUE ]
|
||||
if self.parse_keyword(Keyword::MINVALUE) {
|
||||
sequence_options.push(SequenceOptions::MinValue(MinMaxValue::Some(Expr::Value(
|
||||
sequence_options.push(SequenceOptions::MinValue(Some(Expr::Value(
|
||||
self.parse_number_value()?,
|
||||
))));
|
||||
} else if self.parse_keywords(&[Keyword::NO, Keyword::MINVALUE]) {
|
||||
sequence_options.push(SequenceOptions::MinValue(MinMaxValue::None));
|
||||
} else {
|
||||
sequence_options.push(SequenceOptions::MinValue(MinMaxValue::Empty));
|
||||
sequence_options.push(SequenceOptions::MinValue(None));
|
||||
}
|
||||
//[ MAXVALUE maxvalue | NO MAXVALUE ]
|
||||
if self.parse_keywords(&[Keyword::MAXVALUE]) {
|
||||
sequence_options.push(SequenceOptions::MaxValue(MinMaxValue::Some(Expr::Value(
|
||||
sequence_options.push(SequenceOptions::MaxValue(Some(Expr::Value(
|
||||
self.parse_number_value()?,
|
||||
))));
|
||||
} else if self.parse_keywords(&[Keyword::NO, Keyword::MAXVALUE]) {
|
||||
sequence_options.push(SequenceOptions::MaxValue(MinMaxValue::None));
|
||||
} else {
|
||||
sequence_options.push(SequenceOptions::MaxValue(MinMaxValue::Empty));
|
||||
sequence_options.push(SequenceOptions::MaxValue(None));
|
||||
}
|
||||
|
||||
//[ START [ WITH ] start ]
|
||||
if self.parse_keywords(&[Keyword::START]) {
|
||||
if self.parse_keywords(&[Keyword::WITH]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue