Firebird allows a creation of UDF with BLOB SCALAR_ARRAY argument
Example of (incorrect) UDF:
DECLARE EXTERNAL FUNCTION UDF_DUMMY2_BSA__BLOB
BLOB BY SCALAR_ARRAY
RETURNS BLOB BY DESCRIPTOR
ENTRY_POINT 'IB_UDF_abs' MODULE_NAME 'ib_udf';
FB4 executes this query without any problems.
As I understand, Firebird and InterBase don't support array with blobs and this SQL should not be executed.
A proposal for correct behavior:
SQL> DECLARE EXTERNAL FUNCTION UDF_DUMMY2_BSA__BLOB2 CON> BLOB BY SCALAR_ARRAY CON> RETURNS BLOB BY DESCRIPTOR CON> ENTRY_POINT 'IB_UDF_abs' MODULE_NAME 'ib_udf'; Statement failed, SQLSTATE = 42000 CREATE FUNCTION UDF_DUMMY2_BSA__BLOB2 failed -SQL error code = -607 -Invalid command -BY SCALAR_ARRAY can't be used with BLOB datatype SQL>
Also.
I offer to move the check of usage BY SCALAR_ARRAY with return parameter from CreateAlterFunctionNode::executeAlter (execute stage): https://github.com/FirebirdSQL/firebird/blob/255fc240991b45e8d36064225cc51076112f14f5/src/dsql/DdlNodes.epp#L1955-L1965
in CreateAlterFunctionNode::dsqlPass (prepare stage) https://github.com/FirebirdSQL/firebird/blob/255fc240991b45e8d36064225cc51076112f14f5/src/dsql/DdlNodes.epp#L1630