* ExecInitRangeTable * Set up executor's range-table-related data * * In addition to the range table proper, initialize arrays that are * indexed by rangetable index. */
| 805 | * indexed by rangetable index. |
| 806 | */ |
| 807 | void |
| 808 | ExecInitRangeTable(EState *estate, List *rangeTable) |
| 809 | { |
| 810 | /* Remember the range table List as-is */ |
| 811 | estate->es_range_table = rangeTable; |
| 812 | |
| 813 | /* Set size of associated arrays */ |
| 814 | estate->es_range_table_size = list_length(rangeTable); |
| 815 | |
| 816 | /* |
| 817 | * Allocate an array to store an open Relation corresponding to each |
| 818 | * rangetable entry, and initialize entries to NULL. Relations are opened |
| 819 | * and stored here as needed. |
| 820 | */ |
| 821 | estate->es_relations = (Relation *) |
| 822 | palloc0(estate->es_range_table_size * sizeof(Relation)); |
| 823 | |
| 824 | /* |
| 825 | * es_result_relations and es_rowmarks are also parallel to |
| 826 | * es_range_table, but are allocated only if needed. |
| 827 | */ |
| 828 | estate->es_result_relations = NULL; |
| 829 | estate->es_rowmarks = NULL; |
| 830 | } |
| 831 | |
| 832 | /* |
| 833 | * ExecGetRangeTableRelation |
no test coverage detected