diff --git a/src/dsql/metd.epp b/src/dsql/metd.epp index f35526568e..4a60e86bef 100644 --- a/src/dsql/metd.epp +++ b/src/dsql/metd.epp @@ -843,10 +843,14 @@ dsql_udf* METD_get_function(jrd_tra* transaction, DsqlCompilerScratch* dsqlScrat if (MET_dsql_cache_use(tdbb, SYM_udf, metaName.identifier, metaName.package)) userFunc->udf_flags |= UDF_dropped; - - return userFunc; } + if (userFunc && (userFunc->udf_flags & UDF_dropped)) + userFunc = nullptr; + + if (userFunc) + return userFunc; + // Now see if it is in the database USHORT return_arg = 0; @@ -1204,10 +1208,14 @@ dsql_prc* METD_get_procedure(jrd_tra* transaction, DsqlCompilerScratch* dsqlScra if (MET_dsql_cache_use(tdbb, SYM_procedure, metaName.identifier, metaName.package)) procedure->prc_flags |= PRC_dropped; - - return procedure; } + if (procedure && (procedure->prc_flags & PRC_dropped)) + procedure = nullptr; + + if (procedure) + return procedure; + // now see if it is in the database while (!procedure)