MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / erase

Method erase

src/dsql/StmtNodes.cpp:2660–2822  ·  view source on GitHub ↗

Perform erase operation.

Source from the content-addressed store, hash-verified

2658
2659// Perform erase operation.
2660const StmtNode* EraseNode::erase(thread_db* tdbb, Request* request, WhichTrigger whichTrig) const
2661{
2662 impure_state* impure = request->getImpure<impure_state>(impureOffset);
2663
2664 jrd_tra* transaction = request->req_transaction;
2665 record_param* rpb = &request->req_rpb[stream];
2666 jrd_rel* relation = rpb->rpb_relation;
2667
2668 switch (request->req_operation)
2669 {
2670 case Request::req_evaluate:
2671 {
2672 impure->sta_state = 0;
2673
2674 if (!(marks & MARK_AVOID_COUNTERS))
2675 request->req_records_affected.bumpModified(false);
2676
2677 if (!statement)
2678 break;
2679
2680 const Format* format = MET_current(tdbb, rpb->rpb_relation);
2681 Record* record = VIO_record(tdbb, rpb, format, tdbb->getDefaultPool());
2682
2683 rpb->rpb_address = record->getData();
2684 rpb->rpb_length = format->fmt_length;
2685 rpb->rpb_format_number = format->fmt_version;
2686
2687 return statement;
2688 }
2689
2690 case Request::req_return:
2691 if (impure->sta_state == 1)
2692 {
2693 impure->sta_state = 0;
2694 rpb->rpb_number.setValid(false);
2695 return parentStmt;
2696 }
2697 break;
2698
2699 default:
2700 return parentStmt;
2701 }
2702
2703 request->req_operation = Request::req_return;
2704 RLCK_reserve_relation(tdbb, transaction, relation, true);
2705
2706 if (rpb->rpb_runtime_flags & RPB_just_deleted)
2707 return parentStmt;
2708
2709 if (rpb->rpb_number.isBof() || (!relation->rel_view_rse && !rpb->rpb_number.isValid()))
2710 ERR_post(Arg::Gds(isc_no_cur_rec));
2711
2712 if (forNode && forNode->isWriteLockMode(request))
2713 {
2714 forceWriteLock(tdbb, rpb, transaction);
2715 return parentStmt;
2716 }
2717

Callers 15

INET_connectFunction · 0.45
gbakFunction · 0.45
authenticateMethod · 0.45
getLoginMethod · 0.45
authenticateMethod · 0.45
setCursorMethod · 0.45
removeStatementMethod · 0.45
shrinkMethod · 0.45
prepareSwitchFunction · 0.45
expandPatternMethod · 0.45

Calls 15

VIO_recordFunction · 0.85
RLCK_reserve_relationFunction · 0.85
GdsClass · 0.85
forceWriteLockFunction · 0.85
VIO_refetch_recordFunction · 0.85
preModifyEraseTriggersFunction · 0.85
EXT_eraseFunction · 0.85
VIO_eraseFunction · 0.85
restartRequestFunction · 0.85
REPL_eraseFunction · 0.85
EXE_execute_triggersFunction · 0.85
IDX_eraseFunction · 0.85

Tested by

no test coverage detected