diff --git a/src/common/cvt.cpp b/src/common/cvt.cpp index e814891d9d..84cbdcd83d 100644 --- a/src/common/cvt.cpp +++ b/src/common/cvt.cpp @@ -549,7 +549,7 @@ void CVT_string_to_datetime(const dsc* desc, unsigned int position_day = 2; bool have_english_month = false; char date_sep = '\0'; - VaryStr<100> buffer; // arbitrarily large + VaryStr buffer; // arbitrarily large const char* p = NULL; const USHORT length = CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer), 0, cb->err); @@ -1186,7 +1186,7 @@ bool CVT_get_boolean(const dsc* desc, ErrorFunction err) case dtype_cstring: case dtype_text: { - VaryStr<100> buffer; // arbitrarily large + VaryStr buffer; // arbitrarily large const char* p = NULL; int len = CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer), 0, err); @@ -1282,7 +1282,7 @@ double CVT_get_double(const dsc* desc, DecimalStatus decSt, ErrorFunction err, b case dtype_cstring: case dtype_text: { - VaryStr<50> buffer; // must hold ascii of largest double + VaryStr buffer; // must hold ascii of largest double const char* p; const USHORT length = @@ -2160,7 +2160,7 @@ void CVT_conversion_error(const dsc* desc, ErrorFunction err) try { const char* p; - VaryStr<128> s; + VaryStr s; const USHORT length = CVT_make_string(desc, ttype_ascii, &p, &s, sizeof(s), 0, localError); message.assign(p, length); diff --git a/src/dsql/BoolNodes.cpp b/src/dsql/BoolNodes.cpp index 2e6900934a..113ed1ee34 100644 --- a/src/dsql/BoolNodes.cpp +++ b/src/dsql/BoolNodes.cpp @@ -52,11 +52,6 @@ namespace Jrd { // Bug 10061, bsriram - 19-Apr-1999 static const int MAX_MEMBER_LIST = 1500; -static const int TEMP_LENGTH = 128; - - -//-------------------- - //-------------------- @@ -888,7 +883,7 @@ bool ComparativeBoolNode::stringBoolean(thread_db* tdbb, jrd_req* request, dsc* case blr_like: case blr_similar: { - VaryStr temp3; + VaryStr temp3; const UCHAR* escape_str = NULL; USHORT escape_length = 0; @@ -1100,7 +1095,7 @@ bool ComparativeBoolNode::stringFunction(thread_db* tdbb, jrd_req* request, // Handle LIKE and SIMILAR if (blrOp == blr_like || blrOp == blr_similar) { - VaryStr temp3; + VaryStr temp3; const UCHAR* escape_str = NULL; USHORT escape_length = 0; // ensure 3rd argument (escape char) is in operation text type diff --git a/src/dsql/ExprNodes.cpp b/src/dsql/ExprNodes.cpp index aa7984ac55..f4944608c4 100644 --- a/src/dsql/ExprNodes.cpp +++ b/src/dsql/ExprNodes.cpp @@ -10510,7 +10510,7 @@ dsc* StrCaseNode::execute(thread_db* tdbb, jrd_req* request) const else { UCHAR* ptr; - VaryStr<32> temp; + VaryStr temp; USHORT ttype; dsc desc; @@ -10740,7 +10740,7 @@ dsc* StrLenNode::execute(thread_db* tdbb, jrd_req* request) const return &impure->vlu_desc; } - VaryStr<32> temp; + VaryStr temp; USHORT ttype; UCHAR* p; @@ -11575,7 +11575,7 @@ dsc* SubstringNode::perform(thread_db* tdbb, impure_value* impure, const dsc* va // - The types that can cause an error() issued inside the low level MOV/CVT // routines because the "temp" is not enough are blob and array but at this time // they aren't accepted, so they will cause error() to be called anyway. - VaryStr<32> temp; + VaryStr temp; USHORT ttype; desc.dsc_length = MOV_get_string_ptr(tdbb, valueDsc, &ttype, &desc.dsc_address, &temp, sizeof(temp)); diff --git a/src/dsql/StmtNodes.cpp b/src/dsql/StmtNodes.cpp index 28fc273dba..cc412b0fc6 100644 --- a/src/dsql/StmtNodes.cpp +++ b/src/dsql/StmtNodes.cpp @@ -9902,7 +9902,7 @@ static void validateExpressions(thread_db* tdbb, const Array& vali { // Validation error -- report result const char* value; - VaryStr<128> temp; + VaryStr temp; const dsc* desc = EVL_expr(tdbb, request, i->value); const USHORT length = (desc && !(request->req_flags & req_null)) ? diff --git a/src/jrd/constants.h b/src/jrd/constants.h index a67b0eedf3..8e0268cc77 100644 --- a/src/jrd/constants.h +++ b/src/jrd/constants.h @@ -57,6 +57,8 @@ const ULONG MAX_VARY_COLUMN_SIZE = MAX_COLUMN_SIZE - sizeof(USHORT); const ULONG MAX_STR_SIZE = 65535; +const int TEMP_STR_LENGTH = 128; + // Metadata constants // When changing these constants, change MaxIdentifierByteLength and MaxIdentifierCharLength in diff --git a/src/jrd/evl.cpp b/src/jrd/evl.cpp index 89b30f1e6b..7639270eef 100644 --- a/src/jrd/evl.cpp +++ b/src/jrd/evl.cpp @@ -480,7 +480,7 @@ void EVL_make_value(thread_db* tdbb, const dsc* desc, impure_value* value, Memor break; } - VaryStr<128> temp; + VaryStr temp; UCHAR* address; USHORT ttype; @@ -550,7 +550,7 @@ void EVL_validate(thread_db* tdbb, const Item& item, const ItemInfo* itemInfo, d err = true; const char* value = NULL_STRING_MARK; - VaryStr<128> temp; + VaryStr temp; MapFieldInfo::ValueType fieldInfo; if (!err && itemInfo->fullDomain && diff --git a/src/qli/eval.cpp b/src/qli/eval.cpp index 1ac43b8720..6c0f84c94a 100644 --- a/src/qli/eval.cpp +++ b/src/qli/eval.cpp @@ -39,6 +39,7 @@ #include "../common/classes/UserBlob.h" #include "../common/classes/VaryStr.h" #include "../common/gdsassert.h" +#include "../jrd/constants.h" static SLONG execute_any(qli_nod*); @@ -57,7 +58,6 @@ static int sleuth_merge(const UCHAR*, const UCHAR*, const UCHAR* const, UCHAR* c static bool string_boolean(qli_nod*); static bool string_function(qli_nod*, SSHORT, const TEXT*, SSHORT, const TEXT*); -const int TEMP_LENGTH = 128; const USHORT SLEUTH_insensitive = 1; //#define COND_UPPER(c) ((flags & SLEUTH_insensitive) ? UPPER(c) : c) inline UCHAR cond_upper(const UCHAR c, const USHORT flags) @@ -959,15 +959,15 @@ static bool sleuth( qli_nod* node, const dsc* desc1, const dsc* desc2, const dsc // Get operator definition string (control string) - Firebird::VaryStr temp1; + Firebird::VaryStr temp1; const TEXT* p1; - SSHORT l1 = MOVQ_get_string(desc3, &p1, &temp1, TEMP_LENGTH); + SSHORT l1 = MOVQ_get_string(desc3, &p1, &temp1, TEMP_STR_LENGTH); // Get address and length of search string - Firebird::VaryStr temp2; + Firebird::VaryStr temp2; const TEXT* p2; - SSHORT l2 = MOVQ_get_string(desc2, &p2, &temp2, TEMP_LENGTH); + SSHORT l2 = MOVQ_get_string(desc2, &p2, &temp2, TEMP_STR_LENGTH); // Merge search and control strings @@ -978,7 +978,7 @@ static bool sleuth( qli_nod* node, const dsc* desc1, const dsc* desc2, const dsc if (desc1->dsc_dtype != dtype_blob) { - l1 = MOVQ_get_string(desc1, &p1, &temp1, TEMP_LENGTH); + l1 = MOVQ_get_string(desc1, &p1, &temp1, TEMP_STR_LENGTH); return sleuth_check(0, (const UCHAR*) p1, (const UCHAR*) (p1 + l1), control, control + l2); } @@ -1309,16 +1309,16 @@ static bool string_boolean( qli_nod* node) // Get address and length of strings const TEXT* p2; - Firebird::VaryStr temp2; - SSHORT l2 = MOVQ_get_string(desc2, &p2, &temp2, TEMP_LENGTH); + Firebird::VaryStr temp2; + SSHORT l2 = MOVQ_get_string(desc2, &p2, &temp2, TEMP_STR_LENGTH); // If source is not a blob, do a simple search if (desc1->dsc_dtype != dtype_blob) { - Firebird::VaryStr temp1; + Firebird::VaryStr temp1; const TEXT* p1; - SSHORT l1 = MOVQ_get_string(desc1, &p1, &temp1, TEMP_LENGTH); + SSHORT l1 = MOVQ_get_string(desc1, &p1, &temp1, TEMP_STR_LENGTH); return string_function(node, l1, p1, l2, p2); }