* VirtualTupleTableSlots never provide system attributes (except those * handled generically, such as tableoid). We generally shouldn't get * here, but provide a user-friendly message if we do. */
| 140 | * here, but provide a user-friendly message if we do. |
| 141 | */ |
| 142 | static Datum |
| 143 | tts_virtual_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull) |
| 144 | { |
| 145 | /* |
| 146 | * GPDB: AppendOptimized relations do need to get sysattrs AND use virtual |
| 147 | * tuples to pass around data. It is assumed that the caller knows what is |
| 148 | * doing, if the attribute is gp_segment_id. Otherwise, error out. |
| 149 | */ |
| 150 | if (attnum == GpSegmentIdAttributeNumber) |
| 151 | { |
| 152 | *isnull = false; |
| 153 | |
| 154 | return Int32GetDatum(GpIdentity.segindex); |
| 155 | } |
| 156 | else if (attnum == GpForeignServerAttributeNumber) |
| 157 | { |
| 158 | *isnull = false; |
| 159 | |
| 160 | return ObjectIdGetDatum(GetForeignServerSegByRelid(slot->tts_tableOid)); |
| 161 | } |
| 162 | |
| 163 | elog(ERROR, "virtual tuple table slot does not have system attributes"); |
| 164 | |
| 165 | return 0; /* silence compiler warnings */ |
| 166 | } |
| 167 | |
| 168 | /* |
| 169 | * To materialize a virtual slot all the datums that aren't passed by value |
nothing calls this directly
no test coverage detected