diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 355e520ab..667f771ba 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -2854,7 +2854,8 @@ impl<'a> Parser<'a> { fn parse_duckdb_struct_literal(&mut self) -> Result { self.expect_token(&Token::LBrace)?; - let fields = self.parse_comma_separated(Self::parse_duckdb_dictionary_field)?; + let fields = + self.parse_comma_separated0(Self::parse_duckdb_dictionary_field, Token::RBrace)?; self.expect_token(&Token::RBrace)?; diff --git a/tests/sqlparser_common.rs b/tests/sqlparser_common.rs index ebd6bef03..0058c9166 100644 --- a/tests/sqlparser_common.rs +++ b/tests/sqlparser_common.rs @@ -11288,6 +11288,8 @@ fn test_dictionary_syntax() { ); } + check("{}", Expr::Dictionary(vec![])); + check( "{'Alberta': 'Edmonton', 'Manitoba': 'Winnipeg'}", Expr::Dictionary(vec![