LucaCappelletti94 commented on code in PR #2761:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2761#discussion_r4424534822


##########
src/parser/mod.rs:
##########
@@ -18780,6 +18798,10 @@ impl<'a> Parser<'a> {
                 Some(GrantObjects::Procedures(
                     self.parse_comma_separated(Parser::parse_function_desc)?,
                 ))
+            } else if self.parse_keyword(Keyword::ROUTINE) {

Review Comment:
   `ROUTINE` is now only read as the object type when the next token is not 
`TO`, `FROM`, `,` or `.`, which is how PostgreSQL itself tells a table named 
`routine` from a routine.
   
   Tables named `function`, `procedure` and `sequence` already failed this way 
on main, and so did `schema`, `database`, `view` and the other object-type 
keywords. The same check now guards all of them, so `GRANT SELECT ON function 
TO r` and the rest parse as tables and `ON TABLE function` round-trips.



-- 
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