8
0
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:
dimitr 2011-01-07 11:24:43 +00:00
parent 0eed04c9e2
commit f225c66bd8
2 changed files with 3 additions and 1 deletions

View File

@ -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);
}

View File

@ -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;