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

Method fillPagesSnapshot

src/jrd/Relation.cpp:253–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251
252
253void jrd_rel::fillPagesSnapshot(RelPagesSnapshot& snapshot, const bool attachmentOnly)
254{
255 if (rel_pages_inst)
256 {
257 for (FB_SIZE_T i = 0; i < rel_pages_inst->getCount(); i++)
258 {
259 RelationPages* relPages = (*rel_pages_inst)[i];
260
261 if (!attachmentOnly)
262 {
263 snapshot.add(relPages);
264 relPages->addRef();
265 }
266 else if ((rel_flags & REL_temp_conn) &&
267 PAG_attachment_id(snapshot.spt_tdbb) == relPages->rel_instance_id)
268 {
269 snapshot.add(relPages);
270 relPages->addRef();
271 }
272 else if (rel_flags & REL_temp_tran)
273 {
274 const jrd_tra* tran = snapshot.spt_tdbb->getAttachment()->att_transactions;
275 for (; tran; tran = tran->tra_next)
276 {
277 if (tran->tra_number == relPages->rel_instance_id)
278 {
279 snapshot.add(relPages);
280 relPages->addRef();
281 }
282 }
283 }
284 }
285 }
286 else
287 snapshot.add(&rel_pages_base);
288}
289
290void jrd_rel::RelPagesSnapshot::clear()
291{

Callers 1

check_foreign_keyFunction · 0.80

Calls 5

PAG_attachment_idFunction · 0.85
getCountMethod · 0.45
addMethod · 0.45
addRefMethod · 0.45
getAttachmentMethod · 0.45

Tested by

no test coverage detected