Skip to content

Commit 8887b4a

Browse files
fix TBLPROPERTIES parsing
1 parent e876c0c commit 8887b4a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/parser/mod.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8920,16 +8920,17 @@ impl<'a> Parser<'a> {
89208920
let name = self.parse_identifier()?;
89218921
AlterTableOperation::ValidateConstraint { name }
89228922
} else {
8923-
let maybe_options = self.maybe_parse_options(Keyword::SET)?;
8924-
if let Some(options) = maybe_options {
8925-
AlterTableOperation::SetStorageParameters {
8926-
storage_parameters: options,
8923+
let mut options =
8924+
self.parse_options_with_keywords(&[Keyword::SET, Keyword::TBLPROPERTIES])?;
8925+
if !options.is_empty() {
8926+
AlterTableOperation::SetTblProperties {
8927+
table_properties: options,
89278928
}
89288929
} else {
8929-
let options: Vec<SqlOption> = self.parse_options(Keyword::TBLPROPERTIES)?;
8930+
options = self.parse_options(Keyword::SET)?;
89308931
if !options.is_empty() {
8931-
AlterTableOperation::SetTblProperties {
8932-
table_properties: options,
8932+
AlterTableOperation::SetStorageParameters {
8933+
storage_parameters: options,
89338934
}
89348935
} else {
89358936
return self.expected(

0 commit comments

Comments
 (0)