| 800 | } |
| 801 | |
| 802 | bool Retrieval::checkIndexExpression(const index_desc* idx, ValueExprNode* node) const |
| 803 | { |
| 804 | fb_assert(idx && idx->idx_expression); |
| 805 | |
| 806 | // The desired expression can be hidden inside a derived expression node, |
| 807 | // so try to recover it (see CORE-4118). |
| 808 | while (!idx->idx_expression->sameAs(node, true)) |
| 809 | { |
| 810 | const auto derivedExpr = nodeAs<DerivedExprNode>(node); |
| 811 | const auto cast = nodeAs<CastNode>(node); |
| 812 | |
| 813 | if (derivedExpr) |
| 814 | node = derivedExpr->arg; |
| 815 | else if (cast && cast->artificial) |
| 816 | node = cast->source; |
| 817 | else |
| 818 | return false; |
| 819 | } |
| 820 | |
| 821 | // Check the index for matching both the given stream and the given expression tree |
| 822 | |
| 823 | return idx->idx_expression->containsStream(0, true) && |
| 824 | node->containsStream(stream, true); |
| 825 | } |
| 826 | |
| 827 | void Retrieval::getInversionCandidates(InversionCandidateList& inversions, |
| 828 | IndexScratchList& fromIndexScratches, |
nothing calls this directly
no test coverage detected