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

   Using the `DEFAULT` variant of the `CREATE FUNCTION` default argument syntax 
causes a parse error with unnamed arguments. The proposed fix skips the logic 
to disambiguate `argname argtype` from `argtype` when the `DEFAULT` keyword is 
detected. IIUC, this is safe because `argname` and `argtype` can only take on 
the name `DEFAULT` when quoted.
   
   e.g, in postgres this is allowed:
   
   > CREATE DOMAIN "DEFAULT" AS int;
   > CREATE FUNCTION add(INTEGER, "DEFAULT" "DEFAULT" DEFAULT 1) RETURNS 
INTEGER LANGUAGE SQL AS 'select $1 + $2;';
   
   But "DEFAULT" (the argname) and "DEFAULT" (the argtype) cannot appear 
unquoted
   
   Ref: https://github.com/apache/datafusion/pull/18450#discussion_r2501243160


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