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

Method getTempPageSpaceID

src/jrd/pag.cpp:2590–2620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2588}
2589
2590USHORT PageManager::getTempPageSpaceID(thread_db* tdbb)
2591{
2592 fb_assert(tempPageSpaceID != 0);
2593 if (!tempFileCreated)
2594 {
2595 Firebird::MutexLockGuard guard(initTmpMtx, FB_FUNCTION);
2596 if (!tempFileCreated)
2597 {
2598 FbLocalStatus status;
2599 PathName tempDir(dbb->dbb_config->getTempPageSpaceDirectory());
2600 PathName file_name = TempFile::create(&status, SCRATCH, tempDir);
2601
2602 if (!status.isSuccess())
2603 {
2604 string error;
2605 error.printf("Database: %s\n\tError creating file in TempTableDirectory \"%s\"",
2606 dbb->dbb_filename.c_str(), tempDir.c_str());
2607 iscLogStatus(error.c_str(), &status);
2608
2609 file_name = TempFile::create(SCRATCH);
2610 }
2611
2612 PageSpace* pageSpaceTemp = dbb->dbb_page_manager.findPageSpace(tempPageSpaceID);
2613 pageSpaceTemp->file = PIO_create(tdbb, file_name, true, true);
2614 PAG_format_pip(tdbb, *pageSpaceTemp);
2615
2616 tempFileCreated = true;
2617 }
2618 }
2619 return tempPageSpaceID;
2620}
2621
2622ULONG PAG_page_count(thread_db* tdbb)
2623{

Callers 4

getPagesInternalMethod · 0.80
create2Method · 0.80
moveMethod · 0.80
delete_blobMethod · 0.80

Calls 8

createFunction · 0.85
iscLogStatusFunction · 0.85
PIO_createFunction · 0.85
PAG_format_pipFunction · 0.85
findPageSpaceMethod · 0.80
isSuccessMethod · 0.45
printfMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected