mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 02:03:04 +01:00
Fix #8304 - Wrong results using minvalue/maxvalue in join condition.
This commit is contained in:
parent
b0c365a8d4
commit
6d82b1f229
@ -5369,19 +5369,22 @@ dsc* evlMakeDbkey(Jrd::thread_db* tdbb, const SysFunction* function, const NestV
|
|||||||
|
|
||||||
|
|
||||||
dsc* evlMaxMinValue(thread_db* tdbb, const SysFunction* function, const NestValueArray& args,
|
dsc* evlMaxMinValue(thread_db* tdbb, const SysFunction* function, const NestValueArray& args,
|
||||||
impure_value*)
|
impure_value* impure)
|
||||||
{
|
{
|
||||||
fb_assert(args.getCount() >= 1);
|
fb_assert(args.getCount() >= 1);
|
||||||
fb_assert(function->misc != NULL);
|
fb_assert(function->misc != NULL);
|
||||||
|
|
||||||
jrd_req* request = tdbb->getRequest();
|
const auto request = tdbb->getRequest();
|
||||||
dsc* result = NULL;
|
HalfStaticArray<const dsc*, 2> argTypes(args.getCount());
|
||||||
|
dsc* result = nullptr;
|
||||||
|
|
||||||
for (FB_SIZE_T i = 0; i < args.getCount(); ++i)
|
for (FB_SIZE_T i = 0; i < args.getCount(); ++i)
|
||||||
{
|
{
|
||||||
dsc* value = EVL_expr(tdbb, request, args[i]);
|
const auto value = EVL_expr(tdbb, request, args[i]);
|
||||||
if (request->req_flags & req_null) // return NULL if value is NULL
|
if (request->req_flags & req_null) // return NULL if value is NULL
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
|
argTypes.add(value);
|
||||||
|
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
result = value;
|
result = value;
|
||||||
@ -5405,7 +5408,12 @@ dsc* evlMaxMinValue(thread_db* tdbb, const SysFunction* function, const NestValu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
DataTypeUtil(tdbb).makeFromList(&impure->vlu_desc, function->name, argTypes.getCount(), argTypes.begin());
|
||||||
|
impure->vlu_desc.dsc_address = (UCHAR*) &impure->vlu_misc;
|
||||||
|
|
||||||
|
MOV_move(tdbb, result, &impure->vlu_desc);
|
||||||
|
|
||||||
|
return &impure->vlu_desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user