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

Function DeleteCollectionIndexRecordCore

pg_documentdb/src/metadata/index.c:906–930  ·  view source on GitHub ↗

* DeleteCollectionIndexRecordCore deletes the record inserted for given index from * ApiCatalogSchema.collection_indexes using SPI. Delete all indexes of the collection * if indexId is NULL. The delete is done as a commutative write */

Source from the content-addressed store, hash-verified

904 * if indexId is NULL. The delete is done as a commutative write
905 */
906static void
907DeleteCollectionIndexRecordCore(uint64 collectionId, int *indexId)
908{
909 StringInfo cmdStr = makeStringInfo();
910 appendStringInfo(cmdStr,
911 "DELETE FROM %s.collection_indexes WHERE "
912 "collection_id = " UINT64_FORMAT,
913 ApiCatalogSchemaName, collectionId);
914
915 if (indexId != NULL)
916 {
917 appendStringInfo(cmdStr,
918 " AND index_id = %d", *indexId);
919 }
920
921 bool isNull = true;
922 int nargs = 0;
923 Oid *argTypes = NULL;
924 Datum *argValues = NULL;
925 char *argNulls = NULL;
926 RunQueryWithCommutativeWrites(cmdStr->data, nargs, argTypes, argValues, argNulls,
927 SPI_OK_DELETE, &isNull);
928
929 Assert(isNull);
930}
931
932
933static IndexDetails *

Callers 2

Calls 1

Tested by

no test coverage detected