Skip to content

Commit

Permalink
Postfixes for #7482:
Browse files Browse the repository at this point in the history
- Fix wrong implementation of nullable flag
  • Loading branch information
asfernandes committed Mar 3, 2023
1 parent 829e324 commit 041a303
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/jrd/SysFunction.cpp
Expand Up @@ -1244,7 +1244,6 @@ bool makeBlobAppendBlob(dsc* result, const dsc* arg, bid* blob_id = nullptr)
if (arg->isBlob())
{
result->makeBlob(arg->getBlobSubType(), arg->getTextType(), ptr);
result->setNullable(true);
return true;
}

Expand All @@ -1264,7 +1263,6 @@ bool makeBlobAppendBlob(dsc* result, const dsc* arg, bid* blob_id = nullptr)
result->makeBlob(isc_blob_text, ttype_ascii, ptr);
}

result->setNullable(true);
return true;
}

Expand All @@ -1274,21 +1272,28 @@ void makeBlobAppend(DataTypeUtilBase* dataTypeUtil, const SysFunction* function,
{
fb_assert(argsCount >= function->minArgCount);

result->makeBlob(isc_blob_untyped, ttype_binary);
result->setNullable(true);

if (argsCount > 0)
{
const dsc** ppArg = args;
const dsc** const end = args + argsCount;
for (int i = 0; i < argsCount; ++i)
{
if (makeBlobAppendBlob(result, args[i]))
break;
}

for (; ppArg < end; ppArg++)
result->setNullable(true);

This comment has been minimized.

Copy link
@aafemt

aafemt Mar 4, 2023

Contributor

It was already done several lines up.

This comment has been minimized.

Copy link
@asfernandes

asfernandes Mar 4, 2023

Author Member

makeBlobAppendBlob calls dsc make functions, that clears the flag.


for (int i = 0; i < argsCount; ++i)
{
if (makeBlobAppendBlob(result, *ppArg))
return;
if (!args[i]->isNullable())
{
result->setNullable(false);
break;
}
}
}

// All args are NULL's
result->makeBlob(isc_blob_untyped, ttype_binary);
result->setNullable(true);
}


Expand Down

0 comments on commit 041a303

Please sign in to comment.