mvzink commented on code in PR #1986: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1986#discussion_r2271878827
########## src/parser/mod.rs: ########## @@ -1248,6 +1248,12 @@ impl<'a> Parser<'a> { debug!("parsing expr"); let mut expr = self.parse_prefix()?; + // We would have exited early in `parse_prefix` before checking for `COLLATE`, and there's + // no infix operator handling for `COLLATE`, so we must return now. + if self.in_column_definition_state() && self.peek_keyword(Keyword::COLLATE) { + return Ok(expr); + } Review Comment: Fair enough; that's a more localized fix at least. The other part (avoiding the special case in `parse_prefix`) is necessary either way though. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org