8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 21:23:04 +01:00
stability of implicit cursor could be broken, if cursor's select expression is based
on view with sub-query in select list, or
on table with sub-query in computed field.
This commit is contained in:
Vlad Khorsun 2023-08-19 13:34:51 +03:00
parent 25b76bb26c
commit a5131e63ee
3 changed files with 9 additions and 2 deletions

View File

@ -11068,6 +11068,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;

View File

@ -103,6 +103,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

View File

@ -4234,8 +4234,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);
}