From d40d01bc4562cbc4e8aa43dd88ff16b1c7a2e0c8 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Fri, 16 Aug 2024 22:10:45 -0300 Subject: [PATCH] Fix #8213 - WHEN NOT MATCHED BY SOURCE - does not work with a direct table as source. --- src/dsql/StmtNodes.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dsql/StmtNodes.cpp b/src/dsql/StmtNodes.cpp index d722242311..50b861b73e 100644 --- a/src/dsql/StmtNodes.cpp +++ b/src/dsql/StmtNodes.cpp @@ -6734,6 +6734,9 @@ StmtNode* MergeNode::dsqlPass(DsqlCompilerScratch* dsqlScratch) auto relNode = FB_NEW_POOL(dsqlScratch->getPool()) RelationSourceNode(dsqlScratch->getPool()); relNode->dsqlContext = source->dsqlContext; + // Collect contexts that will be used for blr_derived_expr generation. + PASS1_expand_contexts(source->dsqlContext->ctx_main_derived_contexts, source->dsqlContext); + return FB_NEW_POOL(dsqlScratch->getPool()) DerivedFieldNode(dsqlScratch->getPool(), source->dsqlContext, MAKE_constant("1", CONSTANT_BOOLEAN)); };