MCPcopy Create free account
hub / github.com/apache/cloudberry / SPI_getvalue

Function SPI_getvalue

src/backend/executor/spi.c:1247–1277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1245}
1246
1247char *
1248SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
1249{
1250 Datum val;
1251 bool isnull;
1252 Oid typoid,
1253 foutoid;
1254 bool typisvarlena;
1255
1256 SPI_result = 0;
1257
1258 if (fnumber > tupdesc->natts || fnumber == 0 ||
1259 fnumber <= FirstLowInvalidHeapAttributeNumber)
1260 {
1261 SPI_result = SPI_ERROR_NOATTRIBUTE;
1262 return NULL;
1263 }
1264
1265 val = heap_getattr(tuple, fnumber, tupdesc, &isnull);
1266 if (isnull)
1267 return NULL;
1268
1269 if (fnumber > 0)
1270 typoid = TupleDescAttr(tupdesc, fnumber - 1)->atttypid;
1271 else
1272 typoid = (SystemAttributeDefinition(fnumber))->atttypid;
1273
1274 getTypeOutputInfo(typoid, &foutoid, &typisvarlena);
1275
1276 return OidOutputFunctionCall(foutoid, val);
1277}
1278
1279Datum
1280SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull)

Callers 15

lo_manageFunction · 0.85
check_foreign_keyFunction · 0.85
crosstabFunction · 0.85
load_categories_hashFunction · 0.85
get_crosstab_tuplestoreFunction · 0.85
get_sql_insertFunction · 0.85
get_sql_updateFunction · 0.85
xpath_tableFunction · 0.85
make_ruledefFunction · 0.85
make_viewdefFunction · 0.85

Calls 4

heap_getattrFunction · 0.85
getTypeOutputInfoFunction · 0.85
OidOutputFunctionCallFunction · 0.85

Tested by

no test coverage detected