You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
parse_drop silently discards TEMPORARY and PERSISTENT for most object types #2779
parse_drop consumes TEMPORARY (MySQL, Generic, DuckDB) and PERSISTENT (DuckDB) before it reads the object type. Only Statement::Drop and DROP SECRET keep these flags. Every other branch drops them, so the statement parses without error but loses the keyword when printed:
Input
Dialect
Output
DROP TEMPORARY FUNCTION f
Generic
DROP FUNCTION f
DROP TEMPORARY TRIGGER tr ON t
Generic
DROP TRIGGER tr ON t
DROP TEMPORARY PROCEDURE p
Generic
DROP PROCEDURE p
DROP PERSISTENT TABLE t
DuckDB
DROP TABLE t
The same applies to POLICY, CONNECTOR, DOMAIN, EXTENSION and OPERATOR.
In most cases the input isn't valid SQL anyway, so it should fail instead of being accepted. DROP TEMPORARY FUNCTION is real syntax in Spark/Databricks and Hive, so there the parser drops meaningful information.
Expected
Reject TEMPORARY/PERSISTENT for object types that don't support them, and keep the flag where a dialect does support it, e.g. DROP TEMPORARY FUNCTION.
Activity