MCPcopy Create free account
hub / github.com/documentdb/documentdb / IndexNameGetIndexDetailsCore

Function IndexNameGetIndexDetailsCore

pg_documentdb/src/metadata/index.c:933–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

931
932
933static IndexDetails *
934IndexNameGetIndexDetailsCore(const char *cmdStr, uint64 collectionId, const
935 char *indexName)
936{
937 int argCount = 2;
938 Oid argTypes[2];
939 Datum argValues[2];
940
941 argTypes[0] = INT8OID;
942 argValues[0] = UInt64GetDatum(collectionId);
943
944 argTypes[1] = TEXTOID;
945 argValues[1] = CStringGetTextDatum(indexName);
946
947 /* all args are non-null */
948 char *argNulls = NULL;
949
950 bool readOnly = true;
951
952 int numValues = 3;
953 bool isNull[3];
954 Datum results[3];
955 ExtensionExecuteMultiValueQueryWithArgsViaSPI(cmdStr, argCount, argTypes,
956 argValues, argNulls, readOnly,
957 SPI_OK_SELECT, results, isNull,
958 numValues);
959 if (isNull[0])
960 {
961 return NULL;
962 }
963
964 IndexDetails *indexDetails = palloc0(sizeof(IndexDetails));
965 indexDetails->indexId = DatumGetInt32(results[0]);
966 indexDetails->indexSpec = *DatumGetIndexSpec(results[1]);
967 indexDetails->collectionId = collectionId;
968 indexDetails->isIndexBuildInProgress = DatumGetBool(results[2]);
969
970 return indexDetails;
971}
972
973
974/*

Callers 2

IndexNameGetIndexDetailsFunction · 0.85

Tested by

no test coverage detected