mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 20:43:02 +01:00
The ability to retrieve the total number of pages in the database, the (#7888)
number of pages in use, and the number of free pages via the GET_CONTEXT. Co-authored-by: Daniil <daniil@localhost.localdomain>
This commit is contained in:
parent
12f5664e4b
commit
cf4d9d98f2
@ -142,6 +142,12 @@ Usage:
|
|||||||
|
|
|
|
||||||
DECFLOAT_TRAPS | Exceptional conditions in operations with DECFLOAT
|
DECFLOAT_TRAPS | Exceptional conditions in operations with DECFLOAT
|
||||||
| values that cause a trap.
|
| values that cause a trap.
|
||||||
|
|
|
||||||
|
PAGES_ALLOCATED | Current value of allocated pages in the database.
|
||||||
|
|
|
||||||
|
PAGES_USED | Current value of allocated pages in the database.
|
||||||
|
|
|
||||||
|
PAGES_FREE | Current value of free pages in the database.
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
To prevent DoS attacks against Firebird Server you are not allowed to have
|
To prevent DoS attacks against Firebird Server you are not allowed to have
|
||||||
|
@ -432,6 +432,12 @@ static const char
|
|||||||
FALSE_VALUE[] = "FALSE",
|
FALSE_VALUE[] = "FALSE",
|
||||||
TRUE_VALUE[] = "TRUE";
|
TRUE_VALUE[] = "TRUE";
|
||||||
|
|
||||||
|
// Get pages
|
||||||
|
const char
|
||||||
|
PAGES_ALLOCATED[] = "PAGES_ALLOCATED",
|
||||||
|
PAGES_USED[] = "PAGES_USED",
|
||||||
|
PAGES_FREE[] = "PAGES_FREE";
|
||||||
|
|
||||||
|
|
||||||
double fbcot(double value) noexcept
|
double fbcot(double value) noexcept
|
||||||
{
|
{
|
||||||
@ -4583,6 +4589,18 @@ dsc* evlGetContext(thread_db* tdbb, const SysFunction*, const NestValueArray& ar
|
|||||||
GuidToString(guidBuffer, &dbb->dbb_guid);
|
GuidToString(guidBuffer, &dbb->dbb_guid);
|
||||||
resultStr = string(guidBuffer);
|
resultStr = string(guidBuffer);
|
||||||
}
|
}
|
||||||
|
else if (nameStr == PAGES_ALLOCATED)
|
||||||
|
{
|
||||||
|
resultStr.printf("%" ULONGFORMAT, PageSpace::actAlloc(dbb));
|
||||||
|
}
|
||||||
|
else if (nameStr == PAGES_USED)
|
||||||
|
{
|
||||||
|
resultStr.printf("%" ULONGFORMAT, PageSpace::usedPages(dbb));
|
||||||
|
}
|
||||||
|
else if (nameStr == PAGES_FREE)
|
||||||
|
{
|
||||||
|
resultStr.printf("%" ULONGFORMAT, PageSpace::maxAlloc(dbb) - PageSpace::usedPages(dbb));
|
||||||
|
}
|
||||||
else if (nameStr == DATABASE_FILE_ID)
|
else if (nameStr == DATABASE_FILE_ID)
|
||||||
{
|
{
|
||||||
resultStr = dbb->getUniqueFileId();
|
resultStr = dbb->getUniqueFileId();
|
||||||
|
Loading…
Reference in New Issue
Block a user