diff --git a/src/dsql/DdlNodes.epp b/src/dsql/DdlNodes.epp index 5a3cd5eed3a..6b1a76f6180 100644 --- a/src/dsql/DdlNodes.epp +++ b/src/dsql/DdlNodes.epp @@ -6480,11 +6480,10 @@ void RelationNode::defineField(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch storeGlobalField(tdbb, transaction, fieldDefinition.fieldSource, field, computedSource, computedValue); } - else + else if (field->collate.hasData()) { // Resolve possible additional collation for domains. For plain types it is already resolved above. - if (field->collate.hasData()) - DDL_resolve_intl_type(dsqlScratch, field, field->collate); + DDL_resolve_intl_type(dsqlScratch, field, field->collate); } if ((relation->rel_flags & REL_external) && @@ -6541,7 +6540,8 @@ void RelationNode::defineField(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch } fieldDefinition.defaultValue = defaultValue; - fieldDefinition.collationId = field->collationId; + if (field->typeOfName.isEmpty() || field->collate.hasData()) + fieldDefinition.collationId = field->collationId; fieldDefinition.store(tdbb, transaction); // Define the field constraints. diff --git a/src/dsql/parse.y b/src/dsql/parse.y index c44adee3e88..cc51eea7dab 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -4281,13 +4281,7 @@ alter_domain_op($alterDomainNode) | TO symbol_column_name { setClause($alterDomainNode->renameTo, "DOMAIN NAME", *$2); } | TYPE non_array_type - { - //// FIXME: ALTER DOMAIN doesn't support collations, and altered domain's - //// collation is always lost. - dsql_fld* type = $2; - type->collate = ""; - setClause($alterDomainNode->type, "DOMAIN TYPE", type); - } + { setClause($alterDomainNode->type, "DOMAIN TYPE", $2);} ; %type alter_ops()