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

Method erase

src/jrd/VirtualTable.cpp:49–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48
49void VirtualTable::erase(thread_db* tdbb, record_param* rpb)
50{
51 SET_TDBB(tdbb);
52
53 Database* dbb = tdbb->getDatabase();
54 fb_assert(dbb);
55
56 jrd_rel* relation = rpb->rpb_relation;
57 fb_assert(relation);
58
59 dsc desc;
60 lck_t lock_type;
61
62 if (relation->rel_id == rel_mon_attachments)
63 {
64 // Get attachment id
65 if (!EVL_field(relation, rpb->rpb_record, f_mon_att_id, &desc))
66 return;
67
68 // Ignore attempt to stop system attachment
69 dsc sysFlag;
70 if (EVL_field(relation, rpb->rpb_record, f_mon_att_sys_flag, &sysFlag) &&
71 MOV_get_long(tdbb, &sysFlag, 0) != 0)
72 {
73 return;
74 }
75
76 lock_type = LCK_attachment;
77 }
78 else if (relation->rel_id == rel_mon_statements)
79 {
80 // Get attachment id
81 if (!EVL_field(relation, rpb->rpb_record, f_mon_stmt_att_id, &desc))
82 return;
83 lock_type = LCK_cancel;
84 }
85 else
86 {
87 ERR_post(Arg::Gds(isc_read_only));
88 return;
89 }
90
91 const SINT64 id = MOV_get_int64(tdbb, &desc, 0);
92
93 // Post a blocking request
94 Lock temp_lock(tdbb, sizeof(SINT64), lock_type);
95 temp_lock.setKey(id);
96
97 ThreadStatusGuard temp_status(tdbb);
98
99 if (LCK_lock(tdbb, &temp_lock, LCK_EX, -1))
100 LCK_release(tdbb, &temp_lock);
101}
102
103
104void VirtualTable::modify(thread_db* /*tdbb*/, record_param* /*org_rpb*/, record_param* /*new_rpb*/)

Callers 10

prepareRecSourceMethod · 0.45
resizeMethod · 0.45
emplaceMethod · 0.45
removeMethod · 0.45
parseSwitchesMethod · 0.45
startMethod · 0.45
svc.cppFile · 0.45
houseKeepingMethod · 0.45
getMethod · 0.45
enumerateMethod · 0.45

Calls 10

SET_TDBBFunction · 0.85
EVL_fieldFunction · 0.85
MOV_get_longFunction · 0.85
GdsClass · 0.85
MOV_get_int64Function · 0.85
LCK_lockFunction · 0.85
LCK_releaseFunction · 0.85
getDatabaseMethod · 0.80
ERR_postFunction · 0.70
setKeyMethod · 0.45

Tested by

no test coverage detected