mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 21:23:03 +01:00
Backport fixes from HEAD related to CORE-1658 - thanks to Vlad for finding the issue
This commit is contained in:
parent
bb95d4a775
commit
99068285d0
@ -1398,21 +1398,7 @@ USHORT EVL_group(thread_db* tdbb, RecordSource* rsb, jrd_nod *const node, USHORT
|
||||
// if we found the last record last time, we're all done
|
||||
|
||||
if (state == 2)
|
||||
{
|
||||
for (ptr = map->nod_arg, end = ptr + map->nod_count; ptr < end; ptr++)
|
||||
{
|
||||
const jrd_nod* from = (*ptr)->nod_arg[e_asgn_from];
|
||||
impure_value_ex* impure = (impure_value_ex*) ((SCHAR *) request + from->nod_impure);
|
||||
|
||||
if ((from->nod_type == nod_agg_list || from->nod_type == nod_agg_list_distinct) &&
|
||||
impure->vlu_blob)
|
||||
{
|
||||
BLB_close(tdbb, impure->vlu_blob);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@ -1756,6 +1742,18 @@ USHORT EVL_group(thread_db* tdbb, RecordSource* rsb, jrd_nod *const node, USHORT
|
||||
|
||||
break_out:
|
||||
|
||||
for (ptr = map->nod_arg, end = ptr + map->nod_count; ptr < end; ptr++)
|
||||
{
|
||||
const jrd_nod* from = (*ptr)->nod_arg[e_asgn_from];
|
||||
impure_value_ex* impure = (impure_value_ex*) ((SCHAR *) request + from->nod_impure);
|
||||
|
||||
if ((from->nod_type == nod_agg_list) && impure->vlu_blob)
|
||||
{
|
||||
BLB_close(tdbb, impure->vlu_blob);
|
||||
impure->vlu_blob = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finish up any residual computations and get out */
|
||||
|
||||
delete vtemp.vlu_string;
|
||||
@ -3079,6 +3077,12 @@ static void compute_agg_distinct(thread_db* tdbb, jrd_nod* node)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (node->nod_type == nod_agg_list_distinct && impure->vlu_blob)
|
||||
{
|
||||
BLB_close(tdbb, impure->vlu_blob);
|
||||
impure->vlu_blob = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user