Skip to content

Commit 572c733

Browse files
committed
Fixed bug CORE-6531 : COMPUTED BY column looses charset and collate of source field <F> when <F> is either of type BLOB or VARCHAR casted to BLOB.
Note: existing computed by columns should be recreated (or altered to the same expression) to fix wrong data at system catalog.
1 parent 94bae71 commit 572c733

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/dsql/DdlNodes.epp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,12 @@ void defineComputed(DsqlCompilerScratch* dsqlScratch, RelationSourceNode* relati
399399
const USHORT bpc = METD_get_charset_bpc(dsqlScratch->getTransaction(), field->charSetId.value);
400400
field->charLength = (field->length - adjust) / bpc;
401401
}
402+
else if (field->dtype == dtype_blob)
403+
{
404+
field->charSetId = desc.getCharSet();
405+
field->collationId = desc.getCollation();
406+
field->subType = desc.getBlobSubType();
407+
}
402408
else
403409
field->subType = desc.dsc_sub_type;
404410
}

0 commit comments

Comments
 (0)