* slot_getsysattr - fetch a system attribute of the slot's current tuple. * * If the slot type does not contain system attributes, this will throw an * error. Hence before calling this function, callers should make sure that * the slot type is the one that supports system attributes. */
| 401 | * the slot type is the one that supports system attributes. |
| 402 | */ |
| 403 | static inline Datum |
| 404 | slot_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull) |
| 405 | { |
| 406 | AssertArg(attnum < 0); /* caller error */ |
| 407 | |
| 408 | if (attnum == TableOidAttributeNumber) |
| 409 | { |
| 410 | *isnull = false; |
| 411 | return ObjectIdGetDatum(slot->tts_tableOid); |
| 412 | } |
| 413 | else if (attnum == SelfItemPointerAttributeNumber) |
| 414 | { |
| 415 | *isnull = false; |
| 416 | return PointerGetDatum(&slot->tts_tid); |
| 417 | } |
| 418 | |
| 419 | /* Fetch the system attribute from the underlying tuple. */ |
| 420 | return slot->tts_ops->getsysattr(slot, attnum, isnull); |
| 421 | } |
| 422 | |
| 423 | /* |
| 424 | * ExecClearTuple - clear the slot's contents |
no test coverage detected