diff --git a/src/dsql/ExprNodes.cpp b/src/dsql/ExprNodes.cpp index 7fec7f0391..ab90bee97a 100644 --- a/src/dsql/ExprNodes.cpp +++ b/src/dsql/ExprNodes.cpp @@ -12891,10 +12891,11 @@ void UdfCallNode::make(DsqlCompilerScratch* /*dsqlScratch*/, dsc* desc) // pointer. desc->setNullable(true); - if (desc->dsc_dtype <= dtype_any_text) - desc->dsc_ttype() = dsqlFunction->udf_character_set_id; - else + if (!desc->isText()) desc->dsc_ttype() = dsqlFunction->udf_sub_type; + + if (desc->isText() || (desc->isBlob() && desc->getBlobSubType() == isc_blob_text)) + desc->setTextType(dsqlFunction->udf_character_set_id); } void UdfCallNode::getDesc(thread_db* /*tdbb*/, CompilerScratch* /*csb*/, dsc* desc)