mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 12:03:02 +01:00
Fixed CORE-3302: Distinct aggregates return wrong (duplicated) data.
This commit is contained in:
parent
0eed04c9e2
commit
f225c66bd8
@ -3933,7 +3933,7 @@ static void init_agg_distinct(thread_db* tdbb, const jrd_nod* node)
|
||||
SORT_fini(asb_impure->iasb_sort_handle);
|
||||
|
||||
asb_impure->iasb_sort_handle =
|
||||
SORT_init(tdbb->getDatabase(), &request->req_sorts, ROUNDUP_LONG(asb->asb_length),
|
||||
SORT_init(tdbb->getDatabase(), &request->req_sorts, asb->asb_length,
|
||||
(asb->asb_intl ? 2 : 1), 1, sort_key, reject_duplicate, 0);
|
||||
}
|
||||
|
||||
|
@ -4151,6 +4151,8 @@ static RecordSource* gen_aggregate(thread_db* tdbb, OptimizerBlk* opt, jrd_nod*
|
||||
else
|
||||
asb->asb_length += sort_key->skd_length;
|
||||
|
||||
asb->asb_length = ROUNDUP(asb->asb_length, sizeof(SLONG));
|
||||
|
||||
sort_key->skd_flags = SKD_ascending;
|
||||
asb->nod_impure = CMP_impure(csb, sizeof(impure_agg_sort));
|
||||
asb->asb_desc = *desc;
|
||||
|
Loading…
Reference in New Issue
Block a user