From a731f0f72a1d5096bf632a9df351e5ff67b4400d Mon Sep 17 00:00:00 2001 From: asfernandes Date: Sun, 13 Jun 2010 14:57:51 +0000 Subject: [PATCH] Backport fix for CORE-2893 - Expression in a subquery may be treated as invariant and produce incorrect results --- src/jrd/cmp.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/jrd/cmp.cpp b/src/jrd/cmp.cpp index 2d2f600101..cb7e717054 100644 --- a/src/jrd/cmp.cpp +++ b/src/jrd/cmp.cpp @@ -3986,6 +3986,11 @@ jrd_nod* CMP_pass1(thread_db* tdbb, CompilerScratch* csb, jrd_nod* node) //case nod_count2: case nod_total: ignore_dbkey(tdbb, csb, (RecordSelExpr*) node->nod_arg[e_stat_rse], view); + node->nod_arg[e_stat_rse] = CMP_pass1(tdbb, csb, node->nod_arg[e_stat_rse]); + csb->csb_current_nodes.push(node->nod_arg[e_stat_rse]); + node->nod_arg[e_stat_value] = CMP_pass1(tdbb, csb, node->nod_arg[e_stat_value]); + node->nod_arg[e_stat_default] = CMP_pass1(tdbb, csb, node->nod_arg[e_stat_default]); + csb->csb_current_nodes.pop(); break; case nod_aggregate: