mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-02-02 10:00:38 +01:00
Misc
This commit is contained in:
parent
5f12fc864b
commit
75c0d0f353
@ -69,11 +69,6 @@ Dependencies = $(AllObjects:.o=.d)
|
||||
|
||||
all : fbtrace
|
||||
|
||||
# In the following the rpath variable probably wants to be different
|
||||
# if it's going to be installed in fb specific path.
|
||||
# Also the dynamic link process used in fb, will fall over if it finds
|
||||
# links etc in the intl directory MOD 28-July-2002
|
||||
|
||||
fbtrace: $(FBTRACE)
|
||||
|
||||
$(FBTRACE): $(FBTRACE_Objects)
|
||||
|
@ -35,7 +35,7 @@ password are set using some other method):
|
||||
(Alex Peshkov, peshkoff@mail.ru, 2008)
|
||||
|
||||
Nbackup performs two logical groups of operations - locking/unlocking database
|
||||
and backup/restore it. It's doesn't make sense duplicating locking/unlocking in
|
||||
and backup/restore it. It doesn't make sense duplicating locking/unlocking in
|
||||
services, cause that functionality is present remotely in much better (from any
|
||||
point of view) in SQL language interface (ALTER DATABASE). But backup and restore
|
||||
must be run on localhost and the only way to access them is nbackup utility.
|
||||
|
@ -94,7 +94,7 @@ inline void put(BurpGlobals* tdgbl, const UCHAR c)
|
||||
|
||||
inline void put(BurpGlobals* tdgbl, const att_type c)
|
||||
{
|
||||
if (--(tdgbl->io_cnt) >= 0)
|
||||
if (--tdgbl->io_cnt >= 0)
|
||||
*(tdgbl->io_ptr)++ = UCHAR(c);
|
||||
else
|
||||
MVOL_write(UCHAR(c), &tdgbl->io_cnt, &tdgbl->io_ptr);
|
||||
@ -624,12 +624,12 @@ int copy( const TEXT* from, TEXT* to, ULONG size_len)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
const ULONG l = (ULONG) MISC_symbol_length(from, size_len);
|
||||
const ULONG len = (ULONG) MISC_symbol_length(from, size_len);
|
||||
|
||||
memcpy(to, from, l);
|
||||
to[l] = '\0';
|
||||
memcpy(to, from, len);
|
||||
to[len] = '\0';
|
||||
|
||||
return (int) l;
|
||||
return (int) len;
|
||||
}
|
||||
|
||||
|
||||
@ -2130,7 +2130,7 @@ int put_message( att_type attribute, att_type attribute2, const TEXT* text, cons
|
||||
* CVC: As v6 time, put_text handles embedded blanks, too!
|
||||
* The only difference is that put_text's length is SSHORT, so
|
||||
* in theory put_message can handle much longer input and it's
|
||||
* used for exception & trigger's messages (plus update/delete
|
||||
* used for exception and trigger's messages (plus update/delete
|
||||
* rules for FKs and constraint types, where it's irrelevant
|
||||
* which function of the two you use).
|
||||
* CVC: Responsability for FKs and constraint types transferred to put_text.
|
||||
|
@ -903,7 +903,6 @@ int gbak(Firebird::UtilSvc* uSvc)
|
||||
break;
|
||||
|
||||
case IN_SW_BURP_NOD:
|
||||
//tdgbl->gbl_sw_nodbtriggers = true;
|
||||
dpb.insertByte(isc_dpb_no_db_triggers, 1);
|
||||
break;
|
||||
|
||||
|
@ -184,7 +184,6 @@ Version 6: IB6, FB1, FB1.5.
|
||||
|
||||
Version 7: FB2.0.
|
||||
RDB$DESCRIPTION in roles and generators.
|
||||
RDB$FILE_NAME in character_sets and collations
|
||||
RDB$BASE_COLLATION_NAME and RDB$SPECIFIC_ATTRIBUTES in collations
|
||||
|
||||
Version 8: FB2.1.
|
||||
@ -833,7 +832,6 @@ public:
|
||||
bool gbl_sw_ignore_limbo;
|
||||
bool gbl_sw_meta;
|
||||
bool gbl_sw_novalidity;
|
||||
//bool gbl_sw_nodbtriggers; // Currently useless, as the dpb is filled immediately.
|
||||
USHORT gbl_sw_page_size;
|
||||
bool gbl_sw_compress;
|
||||
bool gbl_sw_version;
|
||||
|
@ -2946,7 +2946,7 @@ bool get_exception(BurpGlobals* tdgbl)
|
||||
default:
|
||||
if (msg_seen && (tdgbl->RESTORE_format == 7 || tdgbl->RESTORE_format == 8))
|
||||
{
|
||||
// we have a corrup backup
|
||||
// we have a corrupt backup
|
||||
if (!failed_attrib)
|
||||
{
|
||||
failed_attrib = attribute;
|
||||
@ -6214,8 +6214,10 @@ USHORT get_text2(BurpGlobals* tdgbl, TEXT* text, ULONG length)
|
||||
const USHORT len = (USHORT) gds__vax_integer(lenstr, sizeof(lenstr));
|
||||
|
||||
if (length <= len)
|
||||
{
|
||||
BURP_error_redirect (NULL, 46);
|
||||
// msg 46 string truncated
|
||||
}
|
||||
|
||||
if (len)
|
||||
text = (TEXT*) get_block(tdgbl, (UCHAR*) text, len);
|
||||
@ -6650,7 +6652,6 @@ bool get_trigger_message(BurpGlobals* tdgbl)
|
||||
if (tdgbl->RESTORE_ods < DB_VERSION_DDL11)
|
||||
message[78] = 0;
|
||||
|
||||
|
||||
isc_tr_handle local_trans = tdgbl->global_trans ? tdgbl->global_trans : gds_trans;
|
||||
|
||||
STORE (TRANSACTION_HANDLE local_trans
|
||||
|
@ -574,6 +574,7 @@ void* MemoryPool::tree_alloc(size_t size)
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
|
||||
if (size == sizeof(FreeBlocksTree::NodeList)) {
|
||||
if (!spareNodes.getCount())
|
||||
Firebird::BadAlloc::raise();
|
||||
@ -693,20 +694,25 @@ void* MemoryPool::allocate_nothrow(size_t size
|
||||
MEM_ALIGN(sizeof(MemoryExtent)) +
|
||||
MEM_ALIGN(sizeof(MemoryBlock)) +
|
||||
MEM_ALIGN(sizeof(FreeBlocksTree::ItemList)));
|
||||
|
||||
const int blockLength = EXTENT_SIZE -
|
||||
MEM_ALIGN(sizeof(MemoryExtent)) -
|
||||
MEM_ALIGN(sizeof(MemoryBlock)) -
|
||||
MEM_ALIGN(sizeof(FreeBlocksTree::ItemList)) -
|
||||
MEM_ALIGN(sizeof(MemoryBlock));
|
||||
|
||||
blk->mbk_flags = MBK_LAST;
|
||||
blk->mbk_type = 0;
|
||||
blk->mbk_small.mbk_length = blockLength;
|
||||
blk->mbk_small.mbk_prev_length = hdr->mbk_small.mbk_length;
|
||||
blk->mbk_prev_fragment = NULL;
|
||||
|
||||
FreeMemoryBlock* freeBlock = blockToPtr<FreeMemoryBlock*>(blk);
|
||||
freeBlock->fbk_next_fragment = NULL;
|
||||
|
||||
BlockInfo temp = {blockLength, freeBlock};
|
||||
freeBlocks.add(temp);
|
||||
|
||||
updateSpare();
|
||||
}
|
||||
|
||||
@ -866,7 +872,8 @@ bool MemoryPool::verify_pool(bool fast_checks_only)
|
||||
bool foundPending = false;
|
||||
for (PendingFreeBlock* tmp = pendingFree; tmp; tmp = tmp->next)
|
||||
{
|
||||
if (tmp == (PendingFreeBlock *)((char*)blk + MEM_ALIGN(sizeof(MemoryBlock)))) {
|
||||
if (tmp == (PendingFreeBlock*)((char*) blk + MEM_ALIGN(sizeof(MemoryBlock))))
|
||||
{
|
||||
mem_assert(!foundPending); // Block may be in pending list only one time
|
||||
foundPending = true;
|
||||
}
|
||||
@ -1173,12 +1180,14 @@ MemoryPool* MemoryPool::createPool(MemoryPool* parent, MemoryStats &stats)
|
||||
hdr->mbk_type = TYPE_LEAFPAGE;
|
||||
hdr->mbk_small.mbk_length = MEM_ALIGN(sizeof(FreeBlocksTree::ItemList));
|
||||
hdr->mbk_small.mbk_prev_length = poolBlk->mbk_small.mbk_length;
|
||||
|
||||
MemoryBlock* blk = (MemoryBlock*)(mem +
|
||||
MEM_ALIGN(sizeof(MemoryExtent)) +
|
||||
MEM_ALIGN(sizeof(MemoryBlock)) +
|
||||
MEM_ALIGN(sizeof(MemoryPool)) +
|
||||
MEM_ALIGN(sizeof(MemoryBlock)) +
|
||||
MEM_ALIGN(sizeof(FreeBlocksTree::ItemList)));
|
||||
|
||||
const int blockLength = EXTENT_SIZE -
|
||||
MEM_ALIGN(sizeof(MemoryExtent)) -
|
||||
MEM_ALIGN(sizeof(MemoryBlock)) -
|
||||
@ -1186,13 +1195,16 @@ MemoryPool* MemoryPool::createPool(MemoryPool* parent, MemoryStats &stats)
|
||||
MEM_ALIGN(sizeof(MemoryBlock)) -
|
||||
MEM_ALIGN(sizeof(FreeBlocksTree::ItemList)) -
|
||||
MEM_ALIGN(sizeof(MemoryBlock));
|
||||
|
||||
blk->mbk_flags = MBK_LAST;
|
||||
blk->mbk_type = 0;
|
||||
blk->mbk_small.mbk_length = blockLength;
|
||||
blk->mbk_small.mbk_prev_length = hdr->mbk_small.mbk_length;
|
||||
blk->mbk_prev_fragment = NULL;
|
||||
|
||||
FreeMemoryBlock* freeBlock = blockToPtr<FreeMemoryBlock*>(blk);
|
||||
freeBlock->fbk_next_fragment = NULL;
|
||||
|
||||
BlockInfo temp = {blockLength, freeBlock};
|
||||
pool->freeBlocks.add(temp);
|
||||
pool->updateSpare();
|
||||
@ -1233,7 +1245,8 @@ void MemoryPool::deletePool(MemoryPool* pool)
|
||||
|
||||
// Deallocate all large blocks redirected to OS
|
||||
MemoryBlock* large = pool->os_redirected;
|
||||
while (large) {
|
||||
while (large)
|
||||
{
|
||||
MemoryBlock* next = block_list_large(large)->mrl_next;
|
||||
size_t ext_size = large->mbk_large_length;
|
||||
external_free(large, ext_size, true);
|
||||
@ -1830,10 +1843,10 @@ void AutoStorage::ProbeStack() const
|
||||
// 1. One and only one stack is used for all kind of variables.
|
||||
// 2. Objects don't grow > 64K.
|
||||
//
|
||||
char ProbeVar = '\0';
|
||||
const char *MyStack = &ProbeVar;
|
||||
const char *ThisLocation = (const char *)this;
|
||||
ptrdiff_t distance = ThisLocation - MyStack;
|
||||
char probeVar = '\0';
|
||||
const char* myStack = &probeVar;
|
||||
const char* thisLocation = (const char*) this;
|
||||
ptrdiff_t distance = thisLocation - myStack;
|
||||
if (distance < 0) {
|
||||
distance = -distance;
|
||||
}
|
||||
|
@ -4833,6 +4833,7 @@ static Database* init(thread_db* tdbb,
|
||||
dbb->dbb_decrypt = (Database::crypt_routine) crypt_lib.lookupSymbol(decrypt_entrypoint);
|
||||
}
|
||||
#endif
|
||||
|
||||
return dbb;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "../../jrd/trace/TraceManager.h"
|
||||
#include "../../jrd/trace/TraceObjects.h"
|
||||
#include "../../jrd/os/path_utils.h"
|
||||
|
||||
#include "../config/ScanDir.h"
|
||||
|
||||
#ifdef WIN_NT
|
||||
|
Loading…
Reference in New Issue
Block a user