Skip to content

Commit e3d20a9

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 10c510a commit e3d20a9

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
@@ -394,6 +394,12 @@ void defineComputed(DsqlCompilerScratch* dsqlScratch, RelationSourceNode* relati
394394
const USHORT bpc = METD_get_charset_bpc(dsqlScratch->getTransaction(), field->charSetId.value);
395395
field->charLength = (field->length - adjust) / bpc;
396396
}
397+
else if (field->dtype == dtype_blob)
398+
{
399+
field->charSetId = desc.getCharSet();
400+
field->collationId = desc.getCollation();
401+
field->subType = desc.getBlobSubType();
402+
}
397403
else
398404
field->subType = desc.dsc_sub_type;
399405
}

0 commit comments

Comments
 (0)