diff --git a/src/dsql/ExprNodes.cpp b/src/dsql/ExprNodes.cpp index e49b3a62e7f..7a7f76bffb5 100644 --- a/src/dsql/ExprNodes.cpp +++ b/src/dsql/ExprNodes.cpp @@ -10956,6 +10956,12 @@ DmlNode* SubQueryNode::parse(thread_db* tdbb, MemoryPool& pool, CompilerScratch* if (csb->csb_currentDMLNode) node->ownSavepoint = false; + + if (!csb->csb_currentForNode && !csb->csb_currentDMLNode && + (csb->csb_g_flags & csb_computed_field)) + { + node->ownSavepoint = false; + } } return node; diff --git a/src/jrd/exe.h b/src/jrd/exe.h index 26adac8ab1a..d3c9198ebbb 100644 --- a/src/jrd/exe.h +++ b/src/jrd/exe.h @@ -617,6 +617,7 @@ const int csb_validation = 64; // we're in a validation expression (RDB hack) const int csb_reuse_context = 128; // allow context reusage const int csb_subroutine = 256; // sub routine const int csb_reload = 512; // request's BLR should be loaded and parsed again +const int csb_computed_field = 1024; // computed field expression // CompilerScratch.csb_rpt[].csb_flags's values. const int csb_active = 1; // stream is active diff --git a/src/jrd/met.epp b/src/jrd/met.epp index 5156569bd11..4ce77862a35 100644 --- a/src/jrd/met.epp +++ b/src/jrd/met.epp @@ -4091,8 +4091,8 @@ void MET_scan_relation(thread_db* tdbb, jrd_rel* relation) DmlNode* nod = dependencies ? MET_get_dependencies(tdbb, relation, p, length, csb, NULL, NULL, NULL, - field->fld_name, obj_computed, 0, depTrans) : - PAR_blr(tdbb, relation, p, length, csb, NULL, NULL, false, 0); + field->fld_name, obj_computed, csb_computed_field, depTrans) : + PAR_blr(tdbb, relation, p, length, csb, NULL, NULL, false, csb_computed_field); field->fld_computation = static_cast(nod); }