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

Function pair

src/gpre/sql.cpp:5548–5594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5546//
5547
5548static void pair( gpre_nod* expr, gpre_nod* field_expr)
5549{
5550 if (field_expr->nod_type != nod_field)
5551 return;
5552
5553 switch (expr->nod_type)
5554 {
5555 case nod_value:
5556 {
5557 ref* ref1 = (ref*) field_expr->nod_arg[0];
5558 ref* ref2 = (ref*) expr->nod_arg[0];
5559
5560 // We're done if we've already determined the type of this reference
5561 // (if, for instance, it's a parameter to a udf or PROCEDURE)
5562
5563 if (ref2->ref_field)
5564 return;
5565
5566 ref2->ref_field = ref1->ref_field;
5567 if (ref1->ref_field->fld_array)
5568 {
5569 ref2->ref_context = ref1->ref_context;
5570 ref2->ref_friend = ref1;
5571 EXP_post_array(ref1);
5572 EXP_post_array(ref2);
5573 }
5574 }
5575 return;
5576
5577 case nod_map_ref:
5578 {
5579 mel* element = (mel*) expr->nod_arg[0];
5580 pair(element->mel_expr, field_expr);
5581 }
5582 return;
5583
5584 case nod_field:
5585 case nod_literal:
5586 return;
5587 }
5588
5589 gpre_nod** ptr = expr->nod_arg;
5590 const gpre_nod* const* const end_ptr = ptr + expr->nod_count;
5591
5592 for (; ptr < end_ptr; ptr++)
5593 pair(*ptr, field_expr);
5594}
5595
5596
5597//____________________________________________________________

Callers 3

act_insertFunction · 0.70
act_updateFunction · 0.70
act_upsertFunction · 0.70

Calls 1

EXP_post_arrayFunction · 0.85

Tested by

no test coverage detected