mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 04:43:03 +01:00
Fixed the underlying issue that made CORE-4255 possible.
This commit is contained in:
parent
2f00756b93
commit
d0d26c6622
@ -258,19 +258,34 @@ RecordBitmap** EVL_bitmap(thread_db* tdbb, const InversionNode* node, RecordBitm
|
|||||||
RecordBitmap::reset(impure->inv_bitmap);
|
RecordBitmap::reset(impure->inv_bitmap);
|
||||||
const dsc* desc = EVL_expr(tdbb, request, node->value);
|
const dsc* desc = EVL_expr(tdbb, request, node->value);
|
||||||
|
|
||||||
if (!(tdbb->getRequest()->req_flags & req_null) &&
|
if (!(tdbb->getRequest()->req_flags & req_null))
|
||||||
desc->dsc_length == sizeof(RecordNumber::Packed))
|
|
||||||
{
|
{
|
||||||
const USHORT id = node->id;
|
UCHAR* ptr = NULL;
|
||||||
Aligner<RecordNumber::Packed> alignedNumbers(desc->dsc_address, desc->dsc_length);
|
USHORT length = 0;
|
||||||
const RecordNumber::Packed* numbers = alignedNumbers;
|
|
||||||
RecordNumber rel_dbkey;
|
if (desc->dsc_dtype == dtype_dbkey)
|
||||||
rel_dbkey.bid_decode(&numbers[id]);
|
{
|
||||||
// Decrement the value in order to switch back to the zero based numbering
|
ptr = desc->dsc_address;
|
||||||
// (from the user point of view the DB_KEY numbering starts from one)
|
length = desc->dsc_length;
|
||||||
rel_dbkey.decrement();
|
}
|
||||||
if (!bitmap_and || bitmap_and->test(rel_dbkey.getValue()))
|
else if (desc->isText())
|
||||||
RBM_SET(tdbb->getDefaultPool(), &impure->inv_bitmap, rel_dbkey.getValue());
|
{
|
||||||
|
length = MOV_get_string(desc, &ptr, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (length == sizeof(RecordNumber::Packed))
|
||||||
|
{
|
||||||
|
const USHORT id = node->id;
|
||||||
|
Aligner<RecordNumber::Packed> alignedNumbers(ptr, length);
|
||||||
|
const RecordNumber::Packed* numbers = alignedNumbers;
|
||||||
|
RecordNumber rel_dbkey;
|
||||||
|
rel_dbkey.bid_decode(&numbers[id]);
|
||||||
|
// Decrement the value in order to switch back to the zero based numbering
|
||||||
|
// (from the user point of view the DB_KEY numbering starts from one)
|
||||||
|
rel_dbkey.decrement();
|
||||||
|
if (!bitmap_and || bitmap_and->test(rel_dbkey.getValue()))
|
||||||
|
RBM_SET(tdbb->getDefaultPool(), &impure->inv_bitmap, rel_dbkey.getValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return &impure->inv_bitmap;
|
return &impure->inv_bitmap;
|
||||||
|
Loading…
Reference in New Issue
Block a user