* ExecFindJunkAttributeInTlist * * Find a junk attribute given a subplan's targetlist (not necessarily * part of a JunkFilter). */
| 231 | * part of a JunkFilter). |
| 232 | */ |
| 233 | AttrNumber |
| 234 | ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName) |
| 235 | { |
| 236 | ListCell *t; |
| 237 | |
| 238 | foreach(t, targetlist) |
| 239 | { |
| 240 | TargetEntry *tle = lfirst(t); |
| 241 | |
| 242 | if (tle->resjunk && tle->resname && |
| 243 | (strcmp(tle->resname, attrName) == 0)) |
| 244 | { |
| 245 | /* We found it ! */ |
| 246 | return tle->resno; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | return InvalidAttrNumber; |
| 251 | } |
| 252 | |
| 253 | /* |
| 254 | * ExecFilterJunk |
no test coverage detected