8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 00:03:03 +01:00

Slightly changed the logic to make it easier to understand.

This commit is contained in:
dimitr 2012-03-22 07:55:12 +00:00
parent f683640e14
commit 0895718ad1

View File

@ -130,16 +130,15 @@ bool CVT2_get_binary_comparable_desc(dsc* result, const dsc* arg1, const dsc* ar
return false;
}
result->makeText(MAX(arg1->getStringLength(), arg2->getStringLength()), arg1->getTextType());
if (arg1->dsc_dtype == arg2->dsc_dtype)
{
result->dsc_dtype = arg1->dsc_dtype;
if (result->dsc_dtype == dtype_cstring)
result->dsc_length += sizeof(UCHAR);
else if (result->dsc_dtype == dtype_varying)
result->dsc_length += sizeof(USHORT);
*result = *arg1;
result->dsc_length = MAX(arg1->dsc_length, arg2->dsc_length);
}
else
{
result->makeText(MAX(arg1->getStringLength(), arg2->getStringLength()),
arg1->getTextType());
}
}
else if (arg1->dsc_dtype == arg2->dsc_dtype && arg1->dsc_scale == arg2->dsc_scale)