MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / validatePkNotExists

Method validatePkNotExists

src/storage/table/node_table.cpp:424–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424void NodeTable::validatePkNotExists(const Transaction* transaction, ValueVector* pkVector) const {
425 offset_t dummyOffset = INVALID_OFFSET;
426 auto& selVector = pkVector->state->getSelVector();
427 DASSERT(selVector.getSelSize() == 1);
428 if (pkVector->isNull(selVector[0])) {
429 throw RuntimeException(ExceptionMessage::nullPKException());
430 }
431 if (lookupPK(transaction, pkVector, selVector[0], dummyOffset)) {
432 throw RuntimeException(
433 ExceptionMessage::duplicatePKException(pkVector->getAsValue(selVector[0])->toString()));
434 }
435}
436
437void NodeTable::initInsertState(main::ClientContext* context, TableInsertState& insertState) {
438 auto& nodeInsertState = insertState.cast<NodeTableInsertState>();

Callers

nothing calls this directly

Calls 4

getSelSizeMethod · 0.80
getAsValueMethod · 0.80
isNullMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected