mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 22:43:03 +01:00
Misc.
This commit is contained in:
parent
4c8c96def4
commit
52f1b15e0c
@ -198,12 +198,12 @@
|
||||
# Disk space preallocation
|
||||
#
|
||||
# Sets the amount of preallocated disk space in bytes. Disk space
|
||||
# preallocation allow to reduce physical file fragmentation and to make
|
||||
# database work in out of disk space condition. When preallocation enabled,
|
||||
# engine allocate 1/16nth of already allocated disk space at a time but
|
||||
# preallocation allows to reduce physical file fragmentation and to make
|
||||
# database work in out of disk space condition. With preallocation enabled,
|
||||
# engine allocates 1/16nth of already allocated disk space at a time but
|
||||
# not less than 128KB and no more than DatabaseGrowthIncrement (128MB by
|
||||
# default). To disable preallocation set DatabaseGrowthIncrement to zero.
|
||||
# Shadow database files are not preallocated
|
||||
# Shadow database files are not preallocated.
|
||||
#
|
||||
# Type: integer
|
||||
#
|
||||
|
@ -125,7 +125,7 @@ const ConfigImpl::ConfigEntry ConfigImpl::entries[] =
|
||||
{TYPE_BOOLEAN, "Redirection", (ConfigValue) false},
|
||||
{TYPE_BOOLEAN, "OldColumnNaming", (ConfigValue) false}, // if true use old style concatenation
|
||||
{TYPE_STRING, "Authentication", (ConfigValue) AmMixed}, // use native, trusted or mixed
|
||||
{TYPE_INTEGER, "DatabaseGrowthIncrement", (ConfigValue) 128*1048576} // bytes
|
||||
{TYPE_INTEGER, "DatabaseGrowthIncrement", (ConfigValue) 128 * 1048576} // bytes
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -3314,14 +3314,20 @@ static dsql_nod* nullify_returning(dsql_nod* input, bool proc_flag)
|
||||
|
||||
dsql_nod* returning = NULL;
|
||||
|
||||
if (input->nod_type == nod_store)
|
||||
returning = input->nod_arg[e_sto_return];
|
||||
else if (input->nod_type == nod_modify)
|
||||
returning = input->nod_arg[e_mod_return];
|
||||
else if (input->nod_type == nod_erase)
|
||||
returning = input->nod_arg[e_era_return];
|
||||
else
|
||||
fb_assert(false);
|
||||
switch (input->nod_type)
|
||||
{
|
||||
case nod_store:
|
||||
returning = input->nod_arg[e_sto_return];
|
||||
break;
|
||||
case nod_modify:
|
||||
returning = input->nod_arg[e_mod_return];
|
||||
break;
|
||||
case nod_erase:
|
||||
returning = input->nod_arg[e_era_return];
|
||||
break;
|
||||
default:
|
||||
fb_assert(false);
|
||||
}
|
||||
|
||||
if (proc_flag || !returning)
|
||||
return input;
|
||||
|
@ -93,7 +93,7 @@ public:
|
||||
~GlobalRWLock();
|
||||
|
||||
// As usual,
|
||||
// wait = 0 - try to lock a thing intantly (doesn't send ASTs)
|
||||
// wait = 0 - try to lock a thing instantly (doesn't send ASTs)
|
||||
// wait < 0 - timeout in seconds (doesn't deadlock)
|
||||
// wait > 0 - infinite wait (may deadlock)
|
||||
//
|
||||
|
@ -87,6 +87,7 @@ static void grant(Global*, const UCHAR**);
|
||||
static bool grantor_can_grant(Global*, const TEXT*, const TEXT*, const Firebird::MetaName&,
|
||||
const Firebird::MetaName&, bool);
|
||||
static bool grantor_can_grant_role(thread_db*, Global*, const Firebird::MetaName&, const Firebird::MetaName&);
|
||||
static const char* privilege_name(char symbol);
|
||||
static void revoke_permission(Global*, const UCHAR**);
|
||||
static void store_privilege(Global*, const Firebird::MetaName&, const Firebird::MetaName&, const Firebird::MetaName&,
|
||||
const TEXT*, SSHORT, SSHORT, int);
|
||||
|
@ -903,10 +903,10 @@ const USHORT TDBB_sweeper = 1; // Thread sweeper or garbage collector
|
||||
const USHORT TDBB_no_cache_unwind = 2; // Don't unwind page buffer cache
|
||||
const USHORT TDBB_prc_being_dropped = 4; // Dropping a procedure
|
||||
const USHORT TDBB_backup_write_locked = 8; // BackupManager has write lock on LCK_backup_database
|
||||
const USHORT TDBB_stack_trace_done = 32; // PSQL stack trace is added into status-vector
|
||||
const USHORT TDBB_shutdown_manager = 64; // Server shutdown thread
|
||||
const USHORT TDBB_deferred = 128; // deferred work performed now
|
||||
const USHORT TDBB_sys_error = 256; // error shouldn't be handled by the looper
|
||||
const USHORT TDBB_stack_trace_done = 16; // PSQL stack trace is added into status-vector
|
||||
const USHORT TDBB_shutdown_manager = 32; // Server shutdown thread
|
||||
const USHORT TDBB_deferred = 64; // deferred work performed now
|
||||
const USHORT TDBB_sys_error = 128; // error shouldn't be handled by the looper
|
||||
|
||||
// duplicate context of firebird string to store in jrd_nod::nod_arg
|
||||
inline char* stringDup(MemoryPool& p, const Firebird::string& s)
|
||||
|
@ -253,6 +253,11 @@ void PIO_extend(jrd_file* main_file, const ULONG extPages, const USHORT pageSize
|
||||
* Extend file by extPages pages of pageSize size.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200)) // || defined __GNUC__
|
||||
const DWORD INVALID_SET_FILE_POINTER = 0xFFFFFFFF;
|
||||
#endif
|
||||
|
||||
ULONG leftPages = extPages;
|
||||
for (jrd_file* file = main_file; file && leftPages; file = file->fil_next)
|
||||
{
|
||||
|
@ -813,7 +813,7 @@ PAG PAG_allocate(WIN * window)
|
||||
fb_assert(new_page);
|
||||
}
|
||||
if (!(dbb->dbb_flags & DBB_no_reserve)) {
|
||||
// At this point we sure database have at least pageNum + 1 pages
|
||||
// At this point we ensure database has at least pageNum + 1 pages
|
||||
// allocated. To avoid file growth by one page when next page will
|
||||
// be allocated extend file up to pageNum + 2 pages now
|
||||
pageSpace->extend(tdbb, pageNum + 2);
|
||||
@ -2209,7 +2209,7 @@ ULONG PageSpace::actAlloc(const USHORT pageSize)
|
||||
// Traverse the linked list of files and add up the
|
||||
// number of pages in each file
|
||||
ULONG tot_pages = 0;
|
||||
for (jrd_file* f = file; f != NULL; f = f->fil_next) {
|
||||
for (const jrd_file* f = file; f != NULL; f = f->fil_next) {
|
||||
tot_pages += PIO_get_number_of_pages(f, pageSize);
|
||||
}
|
||||
|
||||
@ -2224,7 +2224,7 @@ ULONG PageSpace::maxAlloc(const USHORT pageSize)
|
||||
* Compute last physically allocated page of database.
|
||||
*
|
||||
**************************************/
|
||||
jrd_file* f = file;
|
||||
const jrd_file* f = file;
|
||||
while (f->fil_next) {
|
||||
f = f->fil_next;
|
||||
}
|
||||
@ -2248,7 +2248,7 @@ bool PageSpace::extend(thread_db* tdbb, const ULONG pageNum)
|
||||
* extend can't be less than hardcoded value MIN_EXTEND_BYTES and more than
|
||||
* configured value "MaxDatabaseFileGrowth" (both values in bytes).
|
||||
*
|
||||
* If "MaxDatabaseFileGrowth" less than MIN_EXTEND_BYTES don't extend file(s)
|
||||
* If "MaxDatabaseFileGrowth" is less than MIN_EXTEND_BYTES don't extend file(s)
|
||||
*
|
||||
**************************************/
|
||||
const int MIN_EXTEND_BYTES = 128 * 1024; // 128KB
|
||||
|
Loading…
Reference in New Issue
Block a user