diff --git a/src/dsql/DsqlRequests.cpp b/src/dsql/DsqlRequests.cpp index 438a83a23e3..56a63030b37 100644 --- a/src/dsql/DsqlRequests.cpp +++ b/src/dsql/DsqlRequests.cpp @@ -855,8 +855,10 @@ void DsqlDmlRequest::metadataToFormat(Firebird::IMessageMetadata* meta, const ds checkD(&st); desc.dsc_sub_type = meta->getSubType(&st, index); checkD(&st); - const auto textType = CSetId(meta->getCharSet(&st, index)); + TTypeId textType = CSetId(meta->getCharSet(&st, index)); checkD(&st); + if (desc.isText() && textType == ttype_dynamic) + textType = oldFormat->fmt_desc[param->par_parameter].getTextType(); desc.setTextType(textType); desc.dsc_address = (UCHAR*)(IPTR) meta->getOffset(&st, index); checkD(&st);