Skip to content

Commit d76a9c9

Browse files
fix TBLPROPERTIES parsing
1 parent 7df32ea commit d76a9c9

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
@@ -8938,16 +8938,17 @@ impl<'a> Parser<'a> {
89388938
let name = self.parse_identifier()?;
89398939
AlterTableOperation::ValidateConstraint { name }
89408940
} else {
8941-
let maybe_options = self.maybe_parse_options(Keyword::SET)?;
8942-
if let Some(options) = maybe_options {
8943-
AlterTableOperation::SetStorageParameters {
8944-
storage_parameters: options,
8941+
let mut options =
8942+
self.parse_options_with_keywords(&[Keyword::SET, Keyword::TBLPROPERTIES])?;
8943+
if !options.is_empty() {
8944+
AlterTableOperation::SetTblProperties {
8945+
table_properties: options,
89458946
}
89468947
} else {
8947-
let options: Vec<SqlOption> = self.parse_options(Keyword::TBLPROPERTIES)?;
8948+
options = self.parse_options(Keyword::SET)?;
89488949
if !options.is_empty() {
8949-
AlterTableOperation::SetTblProperties {
8950-
table_properties: options,
8950+
AlterTableOperation::SetStorageParameters {
8951+
storage_parameters: options,
89518952
}
89528953
} else {
89538954
return self.expected(

0 commit comments

Comments
 (0)