* 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 */
| 904 | * if indexId is NULL. The delete is done as a commutative write |
| 905 | */ |
| 906 | static void |
| 907 | DeleteCollectionIndexRecordCore(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 | |
| 933 | static IndexDetails * |
no test coverage detected