diff --git a/doc/sql.extensions/README.builtin_functions.txt b/doc/sql.extensions/README.builtin_functions.txt index 4a72465e7f..7829f2bbcc 100644 --- a/doc/sql.extensions/README.builtin_functions.txt +++ b/doc/sql.extensions/README.builtin_functions.txt @@ -434,7 +434,8 @@ FIRST_DAY --------- Function: - Returns the first day of the year/month/week of a given date/timestamp value. + Returns a date/timestamp with the first day of the year/month/week of a given + date/timestamp value. Format: FIRST_DAY( OF { YEAR | MONTH | WEEK } FROM ) @@ -515,7 +516,8 @@ LAST_DAY -------- Function: - Returns the last day of the year/month/week of a given date/timestamp value. + Returns a date/timestamp with the last day of the year/month/week of a given + date/timestamp value. Format: LAST_DAY( OF { YEAR | MONTH | WEEK } FROM ) diff --git a/src/common/classes/BatchCompletionState.h b/src/common/classes/BatchCompletionState.h index 3035589830..f37e1c0fdd 100644 --- a/src/common/classes/BatchCompletionState.h +++ b/src/common/classes/BatchCompletionState.h @@ -35,7 +35,7 @@ namespace Firebird { }; class BatchCompletionState FB_FINAL : - public DisposeIface > + public DisposeIface > { public: BatchCompletionState(bool storeCounts, ULONG lim) diff --git a/src/common/classes/alloc.cpp b/src/common/classes/alloc.cpp index 68392398b0..63250ae8dc 100644 --- a/src/common/classes/alloc.cpp +++ b/src/common/classes/alloc.cpp @@ -1631,16 +1631,19 @@ public: #ifndef WIN_NT unsigned oldCount = 0; - for(;;) + + for (;;) { unsigned newCount = 0; FailedBlock* oldList = failedList; + if (oldList) { fb_assert(oldList->prev); oldList->prev = &oldList; failedList = NULL; } + while (oldList) { ++newCount; @@ -1648,8 +1651,10 @@ public: SemiDoubleLink::pop(oldList); releaseRaw(true, fb, fb->blockSize, false); } + if (newCount == oldCount) break; + oldCount = newCount; } #endif // WIN_NT diff --git a/src/common/utils.cpp b/src/common/utils.cpp index 5a2dda5203..62d13afcad 100644 --- a/src/common/utils.cpp +++ b/src/common/utils.cpp @@ -1637,10 +1637,10 @@ bool isBpbSegmented(unsigned parLength, const unsigned char* par) (Firebird::Arg::Gds(isc_random) << "Malformed BPB").raise(); if (!bpb.find(isc_bpb_type)) - { return true; - } + int type = bpb.getInt(); + return type & isc_bpb_type_stream ? false : true; } diff --git a/src/dsql/ExprNodes.cpp b/src/dsql/ExprNodes.cpp index 14a9d3edc1..66afd14c6e 100644 --- a/src/dsql/ExprNodes.cpp +++ b/src/dsql/ExprNodes.cpp @@ -478,12 +478,12 @@ const UCHAR DSC_ZTYPE_OTHER = 4; const UCHAR DSC_ZTYPE_BAD = 5; const UCHAR decimalDescTable[5][5] = { -/* DSC_ZTYPE_FLT64 DSC_ZTYPE_FLT128 DSC_ZTYPE_FIXED DSC_ZTYPE_INT DSC_ZTYPE_OTHER */ +/* DSC_ZTYPE_FLT64 DSC_ZTYPE_FLT128 DSC_ZTYPE_FIXED DSC_ZTYPE_INT DSC_ZTYPE_OTHER */ /* DSC_ZTYPE_FLT64 */ {DSC_ZTYPE_FLT64, DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128}, /* DSC_ZTYPE_FLT128 */ {DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128}, -/* DSC_ZTYPE_FIXED */ {DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FIXED, DSC_ZTYPE_FIXED, DSC_ZTYPE_FLT128}, -/* DSC_ZTYPE_INT */ {DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FIXED, DSC_ZTYPE_BAD, DSC_ZTYPE_BAD}, -/* DSC_ZTYPE_OTHER */ {DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_BAD, DSC_ZTYPE_BAD} +/* DSC_ZTYPE_FIXED */ {DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FIXED, DSC_ZTYPE_FIXED, DSC_ZTYPE_FLT128}, +/* DSC_ZTYPE_INT */ {DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FIXED, DSC_ZTYPE_BAD, DSC_ZTYPE_BAD}, +/* DSC_ZTYPE_OTHER */ {DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_FLT128, DSC_ZTYPE_BAD, DSC_ZTYPE_BAD} }; UCHAR getFType(const dsc& desc) diff --git a/src/isql/isql.epp b/src/isql/isql.epp index 34a810efcd..ff91618902 100644 --- a/src/isql/isql.epp +++ b/src/isql/isql.epp @@ -3172,9 +3172,8 @@ static processing_state bulk_insert_hack(const char* command) dfixvalue = (FB_DEC_FIXED*) datap; if (isqlGlob.dfix) - { isqlGlob.dfix->fromString(fbStatus, get_numeric_value(lastPos).c_str(), scale, dfixvalue); - } + if ((!isqlGlob.dfix) || (fbStatus->getState() & Firebird::IStatus::STATE_ERRORS)) { STDERROUT("Input parsing problem"); diff --git a/src/remote/client/interface.cpp b/src/remote/client/interface.cpp index 3bb5ba0a94..c38a25e5e7 100644 --- a/src/remote/client/interface.cpp +++ b/src/remote/client/interface.cpp @@ -2361,7 +2361,7 @@ void Batch::addBlob(CheckStatusWrapper* status, unsigned length, const void* inB RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION); // Policy check - switch(blobPolicy) + switch (blobPolicy) { case IBatch::BLOB_ID_ENGINE: genBlobId(blobId); @@ -2404,7 +2404,7 @@ void Batch::appendBlobData(CheckStatusWrapper* status, unsigned length, const vo } // Policy check - switch(blobPolicy) + switch (blobPolicy) { case IBatch::BLOB_ID_USER: case IBatch::BLOB_ID_ENGINE: diff --git a/src/remote/protocol.cpp b/src/remote/protocol.cpp index ee226ba00c..9332a790a2 100644 --- a/src/remote/protocol.cpp +++ b/src/remote/protocol.cpp @@ -1101,7 +1101,6 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p) return P_TRUE(xdrs, p); } - ///case op_insert: default: #ifdef DEV_BUILD @@ -2432,4 +2431,3 @@ private: return TRUE; } - diff --git a/src/yvalve/why.cpp b/src/yvalve/why.cpp index 607513fc67..69e8b3db11 100644 --- a/src/yvalve/why.cpp +++ b/src/yvalve/why.cpp @@ -5931,6 +5931,7 @@ YBatch* YAttachment::createBatch(CheckStatusWrapper* status, ITransaction* trans //------------------------------------- + YService::YService(IProvider* aProvider, IService* aNext, bool utf8) : YHelper(aNext), provider(aProvider),