Skip to content

Commit 40e1b3c

Browse files
committed
Fixed bug CORE-2032 : Stored procedure recursively called by calculated field fails after reconnect
1 parent 816c621 commit 40e1b3c

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/dsql/ExprNodes.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5647,7 +5647,8 @@ ValueExprNode* FieldNode::pass1(thread_db* tdbb, CompilerScratch* csb)
56475647
jrd_rel* relation = tail->csb_relation;
56485648
jrd_fld* field;
56495649

5650-
if (!relation || !(field = MET_get_field(relation, fieldId)))
5650+
if (!relation || !(field = MET_get_field(relation, fieldId)) ||
5651+
(field->fld_flags & FLD_parse_computed))
56515652
{
56525653
if (relation && (relation->rel_flags & REL_being_scanned))
56535654
csb->csb_g_flags |= csb_reload;

src/jrd/Relation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ inline jrd_rel::GCShared::~GCShared()
474474

475475
// Field block, one for each field in a scanned relation
476476

477+
const USHORT FLD_parse_computed = 0x0001; // computed expression is being parsed
478+
477479
class jrd_fld : public pool_alloc<type_fld>
478480
{
479481
public:
@@ -487,6 +489,7 @@ class jrd_fld : public pool_alloc<type_fld>
487489
Firebird::MetaName fld_name; // Field name
488490
Firebird::MetaName fld_security_name; // security class name for field
489491
Firebird::MetaName fld_generator_name; // identity generator name
492+
USHORT fld_flags;
490493

491494
public:
492495
explicit jrd_fld(MemoryPool& p)

src/jrd/met.epp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4000,6 +4000,8 @@ void MET_scan_relation(thread_db* tdbb, jrd_rel* relation)
40004000

40014001
case RSR_computed_blr:
40024002
{
4003+
AutoSetRestoreFlag<USHORT> flag(&field->fld_flags, FLD_parse_computed, true);
4004+
40034005
DmlNode* nod = dependencies ?
40044006
MET_get_dependencies(tdbb, relation, p, length, csb, NULL, NULL, NULL,
40054007
field->fld_name, obj_computed, 0, depTrans) :

0 commit comments

Comments
 (0)