mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 12:43:03 +01:00
Misc.
This commit is contained in:
parent
d02b6714f8
commit
e31eefb8d9
@ -173,6 +173,7 @@ typedef int (*FB_SHUTDOWN_CALLBACK)(const int reason, const int mask, void* arg)
|
||||
struct FB_DEC16_t {
|
||||
ISC_UINT64 fb_data[1];
|
||||
};
|
||||
|
||||
struct FB_DEC34_t {
|
||||
ISC_UINT64 fb_data[2];
|
||||
};
|
||||
|
@ -316,6 +316,7 @@ template <typename DSC>
|
||||
bool areParamsDouble(int argsCount, DSC** args)
|
||||
{
|
||||
bool decSeen = false;
|
||||
|
||||
for (int i = 0; i < argsCount; ++i)
|
||||
{
|
||||
if (args[i]->isApprox())
|
||||
@ -323,6 +324,7 @@ bool areParamsDouble(int argsCount, DSC** args)
|
||||
if (args[i]->isDecFloat())
|
||||
decSeen = true;
|
||||
}
|
||||
|
||||
return !decSeen;
|
||||
}
|
||||
|
||||
@ -2885,7 +2887,8 @@ dsc* evlQuantize(thread_db* tdbb, const SysFunction* function, const NestValueAr
|
||||
impure->vlu_misc.vlu_dec64 = v1.quantize(decSt, v2);
|
||||
impure->vlu_desc.makeDecimal64(&impure->vlu_misc.vlu_dec64);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
Decimal128 v1 = MOV_get_dec128(tdbb, value[0]);
|
||||
Decimal128 v2 = MOV_get_dec128(tdbb, value[1]);
|
||||
|
||||
@ -2930,7 +2933,8 @@ dsc* evlCompare(thread_db* tdbb, const SysFunction* function, const NestValueArr
|
||||
fb_assert(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
Decimal128 v1 = MOV_get_dec128(tdbb, value[0]);
|
||||
Decimal128 v2 = MOV_get_dec128(tdbb, value[1]);
|
||||
|
||||
@ -2973,7 +2977,8 @@ dsc* evlNormDec(thread_db* tdbb, const SysFunction* function, const NestValueArr
|
||||
impure->vlu_misc.vlu_dec64 = v.normalize(decSt);
|
||||
impure->vlu_desc.makeDecimal64(&impure->vlu_misc.vlu_dec64);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
Decimal128 v = MOV_get_dec128(tdbb, value);
|
||||
|
||||
impure->vlu_misc.vlu_dec128 = v.normalize(decSt);
|
||||
|
@ -265,7 +265,7 @@ UCHAR CVT_get_numeric(const UCHAR* string, const USHORT length, SSHORT* scale, v
|
||||
((value < 0) && (sign != -1)))) // MAX_SINT64+1 wrapped around
|
||||
{
|
||||
// convert to double
|
||||
*(double *) ptr = CVT_get_double(&desc, 0, ERR_post, &over);
|
||||
*(double*) ptr = CVT_get_double(&desc, 0, ERR_post, &over);
|
||||
if (!over)
|
||||
return dtype_double;
|
||||
}
|
||||
@ -273,7 +273,7 @@ UCHAR CVT_get_numeric(const UCHAR* string, const USHORT length, SSHORT* scale, v
|
||||
if (over)
|
||||
{
|
||||
thread_db* tdbb = JRD_get_thread_data();
|
||||
*(Decimal128 *) ptr = CVT_get_dec128(&desc, tdbb->getAttachment()->att_dec_status, ERR_post);
|
||||
*(Decimal128*) ptr = CVT_get_dec128(&desc, tdbb->getAttachment()->att_dec_status, ERR_post);
|
||||
return dtype_dec128;
|
||||
}
|
||||
|
||||
|
@ -772,7 +772,7 @@ void FUN_evaluate(thread_db* tdbb, const Function* function, const NestValueArra
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(value->vlu_desc.dsc_dtype)
|
||||
switch (value->vlu_desc.dsc_dtype)
|
||||
{
|
||||
case dtype_double:
|
||||
if (isinf(value->vlu_misc.vlu_double))
|
||||
@ -819,13 +819,13 @@ void FUN_evaluate(thread_db* tdbb, const Function* function, const NestValueArra
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
request->req_flags &= ~req_null;
|
||||
}
|
||||
|
||||
while (array_stack.hasData())
|
||||
{
|
||||
delete[] array_stack.pop();
|
||||
}
|
||||
|
||||
blob_stack.close();
|
||||
|
||||
} // try
|
||||
|
@ -420,12 +420,7 @@ Decimal64 MOV_get_dec64(Jrd::thread_db* tdbb, const dsc* desc)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* M O V _ g e t _ d o u b l e
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Convert something arbitrary to a double precision number
|
||||
* M O V _ g e t _ d e c 6 4
|
||||
*
|
||||
**************************************/
|
||||
|
||||
@ -437,12 +432,7 @@ Decimal128 MOV_get_dec128(Jrd::thread_db* tdbb, const dsc* desc)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* M O V _ g e t _ d o u b l e
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Convert something arbitrary to a double precision number
|
||||
* M O V _ g e t _ d e c 1 2 8
|
||||
*
|
||||
**************************************/
|
||||
|
||||
|
@ -809,7 +809,7 @@ void Sort::diddleKey(UCHAR* record, bool direction)
|
||||
case SKD_dec64:
|
||||
if (direction)
|
||||
{
|
||||
((Decimal64*)p)->makeKey(lwp);
|
||||
((Decimal64*) p)->makeKey(lwp);
|
||||
*p ^= 1 << 7;
|
||||
}
|
||||
else
|
||||
@ -821,8 +821,9 @@ void Sort::diddleKey(UCHAR* record, bool direction)
|
||||
*pp++ ^= -1;
|
||||
} while (--n);
|
||||
}
|
||||
|
||||
*p ^= 1 << 7;
|
||||
((Decimal64*)p)->grabKey(lwp);
|
||||
((Decimal64*) p)->grabKey(lwp);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -830,7 +831,7 @@ void Sort::diddleKey(UCHAR* record, bool direction)
|
||||
fb_assert(false); // diddleKey for Dec64/128 not tested on bigendians!
|
||||
if (direction)
|
||||
{
|
||||
((Decimal128*)p)->makeKey(lwp);
|
||||
((Decimal128*) p)->makeKey(lwp);
|
||||
*p ^= 1 << 7;
|
||||
}
|
||||
else
|
||||
@ -842,8 +843,9 @@ void Sort::diddleKey(UCHAR* record, bool direction)
|
||||
*pp++ ^= -1;
|
||||
} while (--n);
|
||||
}
|
||||
|
||||
*p ^= 1 << 7;
|
||||
((Decimal128*)p)->grabKey(lwp);
|
||||
((Decimal128*) p)->grabKey(lwp);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1083,7 +1085,7 @@ void Sort::diddleKey(UCHAR* record, bool direction)
|
||||
case SKD_dec64:
|
||||
if (direction)
|
||||
{
|
||||
((Decimal64*)p)->makeKey(lwp);
|
||||
((Decimal64*) p)->makeKey(lwp);
|
||||
p[3] ^= 1 << 7;
|
||||
}
|
||||
else
|
||||
@ -1095,15 +1097,16 @@ void Sort::diddleKey(UCHAR* record, bool direction)
|
||||
*pp++ ^= -1;
|
||||
} while (--n);
|
||||
}
|
||||
|
||||
p[3] ^= 1 << 7;
|
||||
((Decimal64*)p)->grabKey(lwp);
|
||||
((Decimal64*) p)->grabKey(lwp);
|
||||
}
|
||||
break;
|
||||
|
||||
case SKD_dec128:
|
||||
if (direction)
|
||||
{
|
||||
((Decimal128*)p)->makeKey(lwp);
|
||||
((Decimal128*) p)->makeKey(lwp);
|
||||
p[3] ^= 1 << 7;
|
||||
}
|
||||
else
|
||||
@ -1115,8 +1118,9 @@ void Sort::diddleKey(UCHAR* record, bool direction)
|
||||
*pp++ ^= -1;
|
||||
} while (--n);
|
||||
}
|
||||
|
||||
p[3] ^= 1 << 7;
|
||||
((Decimal128*)p)->grabKey(lwp);
|
||||
((Decimal128*) p)->grabKey(lwp);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -164,6 +164,7 @@ public:
|
||||
ULONG skd_vary_offset; // Offset to varying/cstring length
|
||||
|
||||
USHORT getSkdLength() const { return skd_length; }
|
||||
|
||||
void setSkdLength(UCHAR dtype, USHORT v)
|
||||
{
|
||||
skd_dtype = dtype;
|
||||
@ -178,6 +179,7 @@ public:
|
||||
}
|
||||
|
||||
ULONG getSkdOffset() const { return skd_offset; }
|
||||
|
||||
void setSkdOffset(const sort_key_def* prev = nullptr, dsc* desc = nullptr)
|
||||
{
|
||||
skd_offset = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user