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

Function related

src/jrd/cch.cpp:4585–4629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4583
4584
4585static SSHORT related(BufferDesc* low, const BufferDesc* high, SSHORT limit, const ULONG mark)
4586{
4587/**************************************
4588 *
4589 * r e l a t e d
4590 *
4591 **************************************
4592 *
4593 * Functional description
4594 * See if there are precedence relationships linking two buffers.
4595 * Since precedence graphs can become very complex, limit search for
4596 * precedence relationship by visiting a presribed limit of higher
4597 * precedence blocks.
4598 *
4599 **************************************/
4600 const struct que* base = &low->bdb_higher;
4601
4602 for (const struct que* que_inst = base->que_forward; que_inst != base; que_inst = que_inst->que_forward)
4603 {
4604 if (!--limit)
4605 return PRE_UNKNOWN;
4606
4607 const Precedence* precedence = BLOCK(que_inst, Precedence, pre_higher);
4608 if (!(precedence->pre_flags & PRE_cleared))
4609 {
4610 if (precedence->pre_hi->bdb_prec_walk_mark == mark)
4611 continue;
4612
4613 if (precedence->pre_hi == high)
4614 return PRE_EXISTS;
4615
4616 if (QUE_NOT_EMPTY(precedence->pre_hi->bdb_higher))
4617 {
4618 limit = related(precedence->pre_hi, high, limit, mark);
4619 if (limit == PRE_EXISTS || limit == PRE_UNKNOWN)
4620 return limit;
4621 }
4622 else
4623 precedence->pre_hi->bdb_prec_walk_mark = mark;
4624 }
4625 }
4626
4627 low->bdb_prec_walk_mark = mark;
4628 return limit;
4629}
4630
4631
4632#ifdef NOT_USED_OR_REPLACED

Callers 1

check_precedenceFunction · 0.85

Calls 1

QUE_NOT_EMPTYFunction · 0.85

Tested by

no test coverage detected