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

Method getList

src/jrd/UserManagement.cpp:580–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580RecordBuffer* UserManagement::getList(thread_db* tdbb, jrd_rel* relation)
581{
582 fb_assert(relation);
583 fb_assert(relation->rel_id == rel_sec_user_attributes || relation->rel_id == rel_sec_users);
584
585 RecordBuffer* recordBuffer = getData(relation);
586 if (recordBuffer)
587 {
588 return recordBuffer;
589 }
590
591 try
592 {
593 openAllManagers();
594
595 bool flagSuccess = false;
596 LocalStatus st1, st2;
597 CheckStatusWrapper statusWrapper1(&st1);
598 CheckStatusWrapper statusWrapper2(&st2);
599 CheckStatusWrapper* currentWrapper(&statusWrapper1);
600 int errcode1, errcode2;
601 int* ec(&errcode1);
602
603 AutoSaveRestore<CoercionArray> restoreBindings(&att->att_bindings);
604
605 threadDbb = tdbb;
606 MemoryPool* const pool = threadDbb->getTransaction()->tra_pool;
607 allocBuffer(threadDbb, *pool, rel_sec_users);
608 allocBuffer(threadDbb, *pool, rel_sec_user_attributes);
609
610 for (FillSnapshot fillSnapshot(this); fillSnapshot.pos < managers.getCount(); ++fillSnapshot.pos)
611 {
612 Auth::UserData u;
613 u.op = Auth::DIS_OPER;
614
615 *ec = managers[fillSnapshot.pos].second->execute(currentWrapper, &u, &fillSnapshot);
616 if (*ec)
617 {
618 currentWrapper = &statusWrapper2;
619 ec = &errcode2;
620 }
621 else
622 flagSuccess = true;
623 }
624
625 if (!flagSuccess)
626 checkSecurityResult(errcode1, &st1, "Unknown", Auth::DIS_OPER);
627 }
628 catch (const Exception&)
629 {
630 clearSnapshot();
631 throw;
632 }
633
634 return getData(relation);
635}

Callers 2

getFormatMethod · 0.45
retrieveRecordMethod · 0.45

Calls 3

getTransactionMethod · 0.45
getCountMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected