sabir-akhadov-localstack commented on code in PR #2798:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2798#discussion_r4651146866


##########
src/parser/mod.rs:
##########
@@ -7415,13 +7415,21 @@ impl<'a> Parser<'a> {
             None
         };
         let default = if self.parse_keyword(Keyword::DEFAULT) {
-            Some(self.parse_expr()?)
+            Some(self.with_state(ColumnDefinition, |parser| 
parser.parse_expr())?)

Review Comment:
   `ColumnDefinition` state stops the expression at `COLLATE`, so `CREATE 
DOMAIN d AS text DEFAULT 'a' COLLATE "C"` now fails with `Expected: end of 
statement, found: COLLATE` (it parsed before). PG 16 accepts it and reads that 
`COLLATE` as the domain collation, so it could be accepted after the default 
and stored in `collation`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to