| 603 | } |
| 604 | |
| 605 | void ComparativeBoolNode::pass2Boolean(thread_db* tdbb, CompilerScratch* csb, std::function<void ()> process) |
| 606 | { |
| 607 | if (nodFlags & FLAG_INVARIANT) |
| 608 | csb->csb_invariants.push(&impureOffset); |
| 609 | |
| 610 | process(); |
| 611 | |
| 612 | RecordKeyNode* keyNode; |
| 613 | |
| 614 | if (arg3) |
| 615 | { |
| 616 | if ((keyNode = nodeAs<RecordKeyNode>(arg3)) && keyNode->aggregate) |
| 617 | ERR_post(Arg::Gds(isc_bad_dbkey)); |
| 618 | |
| 619 | dsc descriptor_c; |
| 620 | arg1->getDesc(tdbb, csb, &descriptor_c); |
| 621 | |
| 622 | if (DTYPE_IS_DATE(descriptor_c.dsc_dtype)) |
| 623 | { |
| 624 | arg1->nodFlags |= FLAG_DATE; |
| 625 | arg2->nodFlags |= FLAG_DATE; |
| 626 | } |
| 627 | } |
| 628 | |
| 629 | if (((keyNode = nodeAs<RecordKeyNode>(arg1)) && keyNode->aggregate) || |
| 630 | ((keyNode = nodeAs<RecordKeyNode>(arg2)) && keyNode->aggregate)) |
| 631 | { |
| 632 | ERR_post(Arg::Gds(isc_bad_dbkey)); |
| 633 | } |
| 634 | |
| 635 | dsc descriptor_a, descriptor_b; |
| 636 | arg1->getDesc(tdbb, csb, &descriptor_a); |
| 637 | arg2->getDesc(tdbb, csb, &descriptor_b); |
| 638 | |
| 639 | if (DTYPE_IS_DATE(descriptor_a.dsc_dtype)) |
| 640 | arg2->nodFlags |= FLAG_DATE; |
| 641 | else if (DTYPE_IS_DATE(descriptor_b.dsc_dtype)) |
| 642 | arg1->nodFlags |= FLAG_DATE; |
| 643 | |
| 644 | if (nodFlags & FLAG_INVARIANT) |
| 645 | impureOffset = csb->allocImpure<impure_value>(); |
| 646 | // Do not use FLAG_PATTERN_MATCHER_CACHE for blr_starting as it has very fast compilation. |
| 647 | else if (blrOp == blr_containing || blrOp == blr_like || blrOp == blr_similar) |
| 648 | { |
| 649 | impureOffset = csb->allocImpure<impure_value>(); |
| 650 | nodFlags |= FLAG_PATTERN_MATCHER_CACHE; |
| 651 | } |
| 652 | } |
| 653 | |
| 654 | bool ComparativeBoolNode::execute(thread_db* tdbb, Request* request) const |
| 655 | { |
nothing calls this directly
no test coverage detected