mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 23:23:04 +01:00
bugfix: More bugfixes for 'no current record for fetch operation' errors.
These were mostly related to queries where a MERGE was done and/or SP/VIEW/Aggregates/Unions were used together.
This commit is contained in:
parent
f4a1c5a98d
commit
d26fd757cb
@ -1633,8 +1633,10 @@ static bool computable(CSB csb,
|
||||
if ((n = (USHORT) node->nod_arg[e_fld_stream]) == stream) {
|
||||
return false;
|
||||
}
|
||||
if (idx_use &&
|
||||
!(csb->csb_rpt[n].csb_flags & (csb_made_river | csb_active)))
|
||||
// AB: cbs_made_river has been replaced by find_used_streams()
|
||||
//if (idx_use &&
|
||||
// !(csb->csb_rpt[n].csb_flags & (csb_made_river | csb_active)))
|
||||
if (idx_use && !(csb->csb_rpt[n].csb_flags & csb_active))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -1647,9 +1649,11 @@ static bool computable(CSB csb,
|
||||
if ((n = (USHORT) node->nod_arg[0]) == stream) {
|
||||
return false;
|
||||
}
|
||||
if (idx_use &&
|
||||
!(csb->csb_rpt[n].
|
||||
csb_flags & (csb_made_river | csb_active)))
|
||||
// AB: cbs_made_river has been replaced by find_used_streams()
|
||||
//if (idx_use &&
|
||||
// !(csb->csb_rpt[n].
|
||||
// csb_flags & (csb_made_river | csb_active)))
|
||||
if (idx_use && !(csb->csb_rpt[n].csb_flags & csb_active))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -4883,16 +4887,27 @@ static BOOLEAN gen_sort_merge(TDBB tdbb, OPT opt, LLS * org_rivers)
|
||||
river1->riv_rsb = merge_rsb;
|
||||
stream = river1->riv_streams;
|
||||
stack1 = NULL;
|
||||
LLS_PUSH(river1, &stack1);
|
||||
while (*org_rivers) {
|
||||
river2 = (RIV) LLS_POP(org_rivers);
|
||||
if (TEST_DEP_BIT(selected_rivers, river2->riv_number)) {
|
||||
MOVE_FAST(river2->riv_streams, stream, river2->riv_count);
|
||||
stream += river2->riv_count;
|
||||
}
|
||||
else
|
||||
LLS_PUSH(river2, &stack1);
|
||||
else {
|
||||
// AB: Be sure that the rivers 'order' will be kept.
|
||||
if (stack1) {
|
||||
RIV river3 = (RIV) LLS_POP(&stack1);
|
||||
LLS_PUSH(river2, &stack1);
|
||||
LLS_PUSH(river3, &stack1);
|
||||
}
|
||||
else {
|
||||
LLS_PUSH(river2, &stack1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// AB: Moved LLS_PUSH() from before the while (*org_rivers) loop to here, because
|
||||
// the merged rivers could be refering to other streams on the list.
|
||||
LLS_PUSH(river1, &stack1);
|
||||
|
||||
/* Pick up any boolean that may apply */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user