diff --git a/src/dsql/DsqlRequests.cpp b/src/dsql/DsqlRequests.cpp index 438a83a23e3..62b73241cba 100644 --- a/src/dsql/DsqlRequests.cpp +++ b/src/dsql/DsqlRequests.cpp @@ -855,8 +855,13 @@ 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) + { + const dsc& oldDesc = oldFormat->fmt_desc[param->par_parameter]; + textType = oldDesc.isText() ? oldDesc.getTextType() : TTypeId(ttype_none); + } desc.setTextType(textType); desc.dsc_address = (UCHAR*)(IPTR) meta->getOffset(&st, index); checkD(&st);