MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / EVL_bitmap

Function EVL_bitmap

src/jrd/evl.cpp:202–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201
202RecordBitmap** EVL_bitmap(thread_db* tdbb, const InversionNode* node, RecordBitmap* bitmap_and)
203{
204/**************************************
205 *
206 * E V L _ b i t m a p
207 *
208 **************************************
209 *
210 * Functional description
211 * Evaluate bitmap valued expression.
212 *
213 **************************************/
214
215 SET_TDBB(tdbb);
216
217 DEV_BLKCHK(node, type_nod);
218
219 JRD_reschedule(tdbb);
220
221 switch (node->type)
222 {
223 case InversionNode::TYPE_AND:
224 {
225 RecordBitmap** bitmap = EVL_bitmap(tdbb, node->node1, bitmap_and);
226 if (!(*bitmap) || !(*bitmap)->getFirst())
227 return bitmap;
228
229 return EVL_bitmap(tdbb, node->node2, *bitmap);
230 }
231
232 case InversionNode::TYPE_OR:
233 return RecordBitmap::bit_or(
234 EVL_bitmap(tdbb, node->node1, bitmap_and),
235 EVL_bitmap(tdbb, node->node2, bitmap_and));
236
237 case InversionNode::TYPE_IN:
238 {
239 RecordBitmap** inv_bitmap = EVL_bitmap(tdbb, node->node1, bitmap_and);
240 BTR_evaluate(tdbb, node->node2->retrieval, inv_bitmap, bitmap_and);
241 return inv_bitmap;
242 }
243
244 case InversionNode::TYPE_DBKEY:
245 {
246 Request* request = tdbb->getRequest();
247 impure_inversion* impure = request->getImpure<impure_inversion>(node->impure);
248 RecordBitmap::reset(impure->inv_bitmap);
249 const dsc* const desc = EVL_expr(tdbb, request, node->value);
250
251 if (!(tdbb->getRequest()->req_flags & req_null) &&
252 (desc->isText() || desc->isDbKey()))
253 {
254 UCHAR* ptr = NULL;
255 const int length = MOV_get_string(tdbb, desc, &ptr, NULL, 0);
256
257 if (length == sizeof(RecordNumber::Packed))
258 {
259 const USHORT id = node->id;

Callers 2

setupBitmapsMethod · 0.85
internalOpenMethod · 0.85

Calls 15

SET_TDBBFunction · 0.85
JRD_rescheduleFunction · 0.85
BTR_evaluateFunction · 0.85
EVL_exprFunction · 0.85
MOV_get_stringFunction · 0.85
isTextMethod · 0.80
isDbKeyMethod · 0.80
resetFunction · 0.50
getFirstMethod · 0.45
getRequestMethod · 0.45
bid_decodeMethod · 0.45
decrementMethod · 0.45

Tested by

no test coverage detected