Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FB4] A proposal for fixing #7880 #7882

Open
wants to merge 1 commit into
base: v4.0-release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/dsql/DsqlCompilerScratch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ void DsqlCompilerScratch::putDtype(const TypeClause* field, bool useSubType)
return;
}

if (field->dimensions != 0)
{
fb_assert(field->dimensions > 0);
fb_assert(blr_dtypes[dtype_array] == blr_quad);
appendUChar(blr_dtypes[dtype_array]);
appendUChar(0);
return;
}

switch (field->dtype)
{
case dtype_cstring:
Expand Down
2 changes: 1 addition & 1 deletion src/dsql/ddl_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const USHORT blr_dtypes[] = {
blr_sql_time, // dtype_sql_time
blr_timestamp, // dtype_timestamp
blr_blob, // dtype_blob // ASF: CAST use blr_blob2 because blr_blob doesn't fit in UCHAR
blr_short, // dtype_array
blr_quad, // dtype_array
blr_int64, // dtype_int64
0, // DB_KEY
blr_bool, // dtype_boolean
Expand Down
15 changes: 12 additions & 3 deletions src/dsql/make.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,18 @@ void DsqlDescMaker::fromElement(dsc* desc, const TypeClause* field)

void DsqlDescMaker::fromField(dsc* desc, const TypeClause* field)
{
composeDesc(desc,
field->dtype, field->scale, field->subType, field->length,
field->charSetId.value, field->collationId, field->flags & FLD_nullable);
if (field->dimensions != 0)
{
composeDesc(desc,
dtype_array, /*scale*/0, /*subType*/0, sizeof(ISC_QUAD),
/*charSetId*/0, /*collationId*/0, field->flags & FLD_nullable);
}
else
{
composeDesc(desc,
field->dtype, field->scale, field->subType, field->length,
field->charSetId.value, field->collationId, field->flags & FLD_nullable);
}
}

void DsqlDescMaker::fromList(DsqlCompilerScratch* scratch, dsc* desc,
Expand Down