Skip to content

Commit

Permalink
Merge pull request #7714 from FirebirdSQL/work/gh-7713
Browse files Browse the repository at this point in the history
Fixed bug #7713
  • Loading branch information
hvlad authored Aug 25, 2023
2 parents d14874c + 47ddf38 commit 1f28042
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/dsql/ExprNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9463,6 +9463,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;
Expand Down
1 change: 1 addition & 0 deletions src/jrd/exe.h
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,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
Expand Down
4 changes: 2 additions & 2 deletions src/jrd/met.epp
Original file line number Diff line number Diff line change
Expand Up @@ -4012,8 +4012,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<ValueExprNode*>(nod);
}
Expand Down

0 comments on commit 1f28042

Please sign in to comment.