* Return the map needed to convert given child result relation's tuples to * the rowtype of the query's main target ("root") relation. Note that a * NULL result is valid and means that no conversion is needed. */
| 1289 | * NULL result is valid and means that no conversion is needed. |
| 1290 | */ |
| 1291 | TupleConversionMap * |
| 1292 | ExecGetChildToRootMap(ResultRelInfo *resultRelInfo) |
| 1293 | { |
| 1294 | /* If we didn't already do so, compute the map for this child. */ |
| 1295 | if (!resultRelInfo->ri_ChildToRootMapValid) |
| 1296 | { |
| 1297 | ResultRelInfo *rootRelInfo = resultRelInfo->ri_RootResultRelInfo; |
| 1298 | |
| 1299 | if (rootRelInfo) |
| 1300 | resultRelInfo->ri_ChildToRootMap = |
| 1301 | convert_tuples_by_name(RelationGetDescr(resultRelInfo->ri_RelationDesc), |
| 1302 | RelationGetDescr(rootRelInfo->ri_RelationDesc)); |
| 1303 | else /* this isn't a child result rel */ |
| 1304 | resultRelInfo->ri_ChildToRootMap = NULL; |
| 1305 | |
| 1306 | resultRelInfo->ri_ChildToRootMapValid = true; |
| 1307 | } |
| 1308 | |
| 1309 | return resultRelInfo->ri_ChildToRootMap; |
| 1310 | } |
| 1311 | |
| 1312 | /* Return a bitmap representing columns being inserted */ |
| 1313 | Bitmapset * |
no test coverage detected