Skip to content

Commit

Permalink
Fixed CORE-2258 - Internal error when select upper(<blob>) from union
Browse files Browse the repository at this point in the history
  • Loading branch information
asfernandes committed Dec 25, 2008
1 parent 80a6227 commit 2e3ced2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/jrd/cmp.cpp
Expand Up @@ -6080,10 +6080,10 @@ static void process_map(thread_db* tdbb, CompilerScratch* csb, jrd_nod* map,
*desc = desc2;
}
else if (max == dtype_blob) {
desc->dsc_dtype = dtype_quad;
desc->dsc_dtype = dtype_blob;
desc->dsc_length = sizeof(ISC_QUAD);
desc->dsc_scale = 0;
desc->dsc_sub_type = 0;
desc->dsc_sub_type = DataTypeUtil::getResultBlobSubType(desc, &desc2);
desc->dsc_flags = 0;
}
else if (min <= dtype_any_text) { // either field a text field?
Expand Down
16 changes: 8 additions & 8 deletions src/jrd/evl.cpp
Expand Up @@ -3130,7 +3130,7 @@ static dsc* concatenate(thread_db* tdbb,
}
else
{
fb_assert(desc.dsc_dtype == dtype_blob);
fb_assert(desc.isBlob());

desc.dsc_address = (UCHAR*)&impure->vlu_misc.vlu_bid;

Expand Down Expand Up @@ -3913,7 +3913,7 @@ static dsc* low_up_case(thread_db* tdbb, const dsc* value, impure_value* impure,

TextType* textType = INTL_texttype_lookup(tdbb, value->getTextType());

if (value->dsc_dtype == dtype_blob)
if (value->isBlob())
{
EVL_make_value(tdbb, value, impure);

Expand Down Expand Up @@ -4517,7 +4517,7 @@ static bool sleuth(thread_db* tdbb, jrd_nod* node, const dsc* desc1, const dsc*
/* Choose interpretation for the operation */

USHORT ttype;
if (desc1->dsc_dtype == dtype_blob || desc1->dsc_dtype == dtype_quad)
if (desc1->isBlob())
{
if (desc1->dsc_sub_type == isc_blob_text)
ttype = desc1->dsc_blob_ttype(); /* Load blob character set and collation */
Expand Down Expand Up @@ -4549,7 +4549,7 @@ static bool sleuth(thread_db* tdbb, jrd_nod* node, const dsc* desc1, const dsc*
and never Multibyte (see note in EVL_mb_sleuthCheck) */
bool ret_val;
MoveBuffer data_str;
if (desc1->dsc_dtype != dtype_blob && desc1->dsc_dtype != dtype_quad)
if (!desc1->isBlob())
{
/* Source is not a blob, do a simple search */

Expand Down Expand Up @@ -4607,7 +4607,7 @@ static bool string_boolean(thread_db* tdbb, jrd_nod* node, dsc* desc1,

DEV_BLKCHK(node, type_nod);

if (desc1->dsc_dtype != dtype_blob && desc1->dsc_dtype != dtype_quad)
if (!desc1->isBlob())
{
/* Source is not a blob, do a simple search */

Expand Down Expand Up @@ -4998,7 +4998,7 @@ static dsc* string_length(thread_db* tdbb, jrd_nod* node, impure_value* impure)

ULONG length;

if (value->dsc_dtype == dtype_blob || value->dsc_dtype == dtype_quad)
if (value->isBlob())
{
blb* blob = BLB_open(tdbb, tdbb->getRequest()->req_transaction,
reinterpret_cast<bid*>(value->dsc_address));
Expand Down Expand Up @@ -5168,7 +5168,7 @@ static dsc* trim(thread_db* tdbb, jrd_nod* node, impure_value* impure)
UCHAR* valueAddress;
ULONG valueLength;

if (value->dsc_dtype == dtype_blob)
if (value->isBlob())
{
// Source string is a blob, things get interesting.
blb* blob = BLB_open(tdbb, tdbb->getRequest()->req_transaction,
Expand Down Expand Up @@ -5216,7 +5216,7 @@ static dsc* trim(thread_db* tdbb, jrd_nod* node, impure_value* impure)
}
}

if (value->dsc_dtype == dtype_blob)
if (value->isBlob())
{
// We have valueCanonical already allocated.
// Use it to get the substring that will be written to the new blob.
Expand Down

0 comments on commit 2e3ced2

Please sign in to comment.