diff --git a/src/jrd/why.cpp b/src/jrd/why.cpp index 874b58f37e..39c077f10e 100644 --- a/src/jrd/why.cpp +++ b/src/jrd/why.cpp @@ -316,14 +316,14 @@ namespace YValve db_path(*getDefaultMemoryPool()), db_prepare_buffer(*getDefaultMemoryPool()) { - toParent(attachments(), this); + toParent(attachments(), this); parent = this; } Attachment::~Attachment() { cleanup.call(&public_handle); - fromParent(attachments(), this); + fromParent(attachments(), this); } } @@ -479,7 +479,7 @@ namespace #ifndef SERVER_SHUTDOWN // appears this macro has now nothing with shutdown - int totalAttachmentCount() + int totalAttachmentCount() const { return attachments().getCount(); } @@ -669,7 +669,7 @@ namespace } } - bool fatal() + bool fatal() const { return vector[0] == isc_arg_gds && (vector[1] == isc_shutdown || @@ -4967,7 +4967,8 @@ ISC_STATUS API_ROUTINE GDS_START_MULTIPLE(ISC_STATUS * user_status, Transaction** ptr; USHORT n; for (n = 0, ptr = &transaction; n < count; - n++, ptr = &(*ptr)->next, vector++) { + n++, ptr = &(*ptr)->next, vector++) + { dbb = translate(vector->teb_database); if (CALL(PROC_START_TRANSACTION, dbb->implementation) (status, @@ -5684,9 +5685,13 @@ static ISC_STATUS get_transaction_info(ISC_STATUS* user_status, const TEXT* q = buffer + 3; *p++ = TDR_TRANSACTION_ID; - const USHORT length = - (USHORT)gds__vax_integer(reinterpret_cast(buffer + 1), 2); - *p++ = length; // Warning: USHORT coerced to char + USHORT length = (USHORT)gds__vax_integer(reinterpret_cast(buffer + 1), 2); + + // Prevent information out of sync. + if (length > MAX_UCHAR) + length = MAX_UCHAR; + + *p++ = length; memcpy(p, q, length); *ptr = p + length; } diff --git a/src/jrd/y_handle.h b/src/jrd/y_handle.h index ca10cb6d25..22faeddeb7 100644 --- a/src/jrd/y_handle.h +++ b/src/jrd/y_handle.h @@ -245,14 +245,13 @@ namespace YValve : Handle(hType(), pub, par), next(0), handle(h) { - toParent(parent->transactions, this); + toParent(parent->transactions, this); } Transaction(FB_API_HANDLE* pub, USHORT implementation) : Handle(hType(), pub, 0, implementation), next(0), handle(0) { - // toParent(parent->transactions, this); } ~Transaction() @@ -260,7 +259,7 @@ namespace YValve cleanup.call(public_handle); if (parent) { - fromParent(parent->transactions, this); + fromParent(parent->transactions, this); } } }; @@ -284,12 +283,12 @@ namespace YValve Request(StReq* h, FB_API_HANDLE* pub, Attachment* par) : Handle(hType(), pub, par), handle(h) { - toParent(parent->requests, this); + toParent(parent->requests, this); } ~Request() { - fromParent(parent->requests, this); + fromParent(parent->requests, this); } }; @@ -312,12 +311,12 @@ namespace YValve Blob(StBlb* h, FB_API_HANDLE* pub, Attachment* par) : Handle(hType(), pub, par), handle(h) { - toParent(parent->blobs, this); + toParent(parent->blobs, this); } ~Blob() { - fromParent(parent->blobs, this); + fromParent(parent->blobs, this); } }; @@ -341,7 +340,7 @@ namespace YValve Statement(StStm* h, FB_API_HANDLE* pub, Attachment* par) : Handle(hType(), pub, par), handle(h) { - toParent(parent->statements, this); + toParent(parent->statements, this); memset(&das, 0, sizeof das); } @@ -355,7 +354,7 @@ namespace YValve ~Statement() { - fromParent(parent->statements, this); + fromParent(parent->statements, this); } };