exec-ddl
CREATE FUNCTION one() RETURNS INT LANGUAGE SQL AS 'SELECT 1';
----

# Do not attempt to hoist UDFs.
norm format=show-scalars
SELECT one()
----
values
 ├── columns: one:2
 ├── cardinality: [1 - 1]
 ├── volatile
 ├── key: ()
 ├── fd: ()-->(2)
 └── tuple
      └── udf: one
           └── body
                └── values
                     ├── columns: "?column?":1!null
                     ├── cardinality: [1 - 1]
                     ├── key: ()
                     ├── fd: ()-->(1)
                     └── tuple
                          └── const: 1

exec-ddl
CREATE FUNCTION strict_fn(i INT, t TEXT, b BOOl) RETURNS INT STRICT IMMUTABLE LANGUAGE SQL AS 'SELECT i'
----

# Strict UDFs should be folded to NULL in the presence of a constant NULL
# argument.
norm format=show-scalars
SELECT strict_fn(1, 'foo', NULL)
----
values
 ├── columns: strict_fn:5
 ├── cardinality: [1 - 1]
 ├── key: ()
 ├── fd: ()-->(5)
 └── tuple
      └── null

# The CASE expression used to check for NULL arguments in strict UDFs should be
# folded in the presence of all non-NULL arguments.
norm format=show-scalars
SELECT strict_fn(1, 'foo', true)
----
values
 ├── columns: strict_fn:5!null
 ├── cardinality: [1 - 1]
 ├── key: ()
 ├── fd: ()-->(5)
 └── tuple
      └── const: 1
