| 251 | |
| 252 | |
| 253 | void 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 | |
| 290 | void jrd_rel::RelPagesSnapshot::clear() |
| 291 | { |
no test coverage detected