LucaCappelletti94 opened a new pull request, #2741:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2741

   `GRANT SELECT ON t TO PUBLIC, reader` and `REVOKE EXECUTE ON FUNCTION f() 
FROM PUBLIC, anon` failed to parse with `Expected: end of statement, found: 
reader`, while the same lists with `PUBLIC` last parsed. PostgreSQL's grantee 
list is a comma-separated list of role specifications, any of which may be 
`PUBLIC` (https://www.postgresql.org/docs/current/sql-grant.html), and 
PostgreSQL 18 accepts both statements.
   
   `parse_grantees` gives an entry that names no grantee type the type of the 
entry before it, so that `TO GROUP a, b` reads both as groups. `PUBLIC` is 
parsed as one of those types, so the entry after it was read as `PUBLIC` again 
and its name was left unconsumed. `PUBLIC` names a single grantee, so it no 
longer carries over and the next entry gets no type. MsSql reads `PUBLIC` as an 
ordinary name and is unaffected.
   
   This PR applies to all dialects except MsSql


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