8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 12:03:02 +01:00

Fixed CORE-2822: Error "no current row for fetch operation" when subquery includes a non-trivial derived table.

This commit is contained in:
dimitr 2010-01-22 14:05:46 +00:00
parent 4c4f0ae7c2
commit ccac0eac72

View File

@ -250,13 +250,11 @@ bool OPT_computable(CompilerScratch* csb, const jrd_nod* node, SSHORT stream,
for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end && result; ptr++) for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end && result; ptr++)
{ {
if ((*ptr)->nod_type != nod_rse) if (!OPT_computable(csb, (*ptr), stream, idx_use, allowOnlyCurrentStream))
{ {
if (!OPT_computable(csb, (*ptr), stream, idx_use, allowOnlyCurrentStream)) {
result = false; result = false;
} }
} }
}
// Check value expression, if any // Check value expression, if any
if (result && value && !OPT_computable(csb, value, stream, idx_use, allowOnlyCurrentStream)) { if (result && value && !OPT_computable(csb, value, stream, idx_use, allowOnlyCurrentStream)) {
@ -1136,10 +1134,8 @@ void OptimizerRetrieval::findDependentFromStreams(const jrd_nod* node,
const jrd_nod* const* end; const jrd_nod* const* end;
for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++)
{ {
if ((*ptr)->nod_type != nod_rse) {
findDependentFromStreams(*ptr, streamList); findDependentFromStreams(*ptr, streamList);
} }
}
// Check value expression, if any // Check value expression, if any
if (value) { if (value) {