* ExecInitResultRelation * Open relation given by the passed-in RT index and fill its * ResultRelInfo node * * Here, we also save the ResultRelInfo in estate->es_result_relations array * such that it can be accessed later using the RT index. */
| 889 | * such that it can be accessed later using the RT index. |
| 890 | */ |
| 891 | void |
| 892 | ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo, |
| 893 | Index rti) |
| 894 | { |
| 895 | Relation resultRelationDesc; |
| 896 | |
| 897 | resultRelationDesc = ExecGetRangeTableRelation(estate, rti); |
| 898 | InitResultRelInfo(resultRelInfo, |
| 899 | resultRelationDesc, |
| 900 | rti, |
| 901 | NULL, |
| 902 | estate->es_instrument); |
| 903 | |
| 904 | if (estate->es_result_relations == NULL) |
| 905 | estate->es_result_relations = (ResultRelInfo **) |
| 906 | palloc0(estate->es_range_table_size * sizeof(ResultRelInfo *)); |
| 907 | estate->es_result_relations[rti - 1] = resultRelInfo; |
| 908 | |
| 909 | /* |
| 910 | * Saving in the list allows to avoid needlessly traversing the whole |
| 911 | * array when only a few of its entries are possibly non-NULL. |
| 912 | */ |
| 913 | estate->es_opened_result_relations = |
| 914 | lappend(estate->es_opened_result_relations, resultRelInfo); |
| 915 | } |
| 916 | |
| 917 | /* |
| 918 | * UpdateChangedParamSet |
no test coverage detected