8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:03:03 +01:00

Revert "Revert "Merge branch 'B3_0_Release' of https://github.com/FirebirdSQL/firebird into B3_0_Release""

This reverts commit 1bb06d69f6.

Sorry for confusion
This commit is contained in:
hvlad 2016-03-18 00:41:43 +02:00
parent 1bb06d69f6
commit 6c4a899f0b
3 changed files with 6 additions and 3 deletions

View File

@ -3574,11 +3574,11 @@ void CreateAlterTriggerNode::compile(thread_db* /*tdbb*/, DsqlCompilerScratch* d
dsqlScratch->loopLevel = 0;
dsqlScratch->cursorNumber = 0;
dsqlScratch->scopeLevel++;
StmtNode* stmtNode = body->dsqlPass(dsqlScratch);
GEN_hidden_variables(dsqlScratch);
dsqlScratch->scopeLevel++;
// dimitr: I see no reason to deny EXIT command in triggers,
// hence I've added zero label at the beginning.
// My first suspicion regarding an obvious conflict

View File

@ -8036,7 +8036,7 @@ ValueExprNode* RecordKeyNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
for (DsqlContextStack::iterator stack(*dsqlScratch->context); stack.hasData(); ++stack)
{
dsql_ctx* context = stack.object();
if ((context->ctx_flags & CTX_system) ||
if ((context->ctx_flags & (CTX_system | CTX_returning)) == CTX_system ||
context->ctx_scope_level != dsqlScratch->scopeLevel)
{
continue;

View File

@ -135,7 +135,8 @@ namespace
oldContext(aOldContext),
oldAlias(oldContext->ctx_alias),
oldInternalAlias(oldContext->ctx_internal_alias),
autoFlags(&oldContext->ctx_flags, oldContext->ctx_flags | CTX_system | CTX_returning)
autoFlags(&oldContext->ctx_flags, oldContext->ctx_flags | CTX_system | CTX_returning),
autoScopeLevel(&aScratch->scopeLevel, aScratch->scopeLevel + 1)
{
// Clone the modify/old context and push with name "NEW" in a greater scope level.
@ -165,6 +166,7 @@ namespace
newContext->ctx_alias = newContext->ctx_internal_alias = NEW_CONTEXT_NAME;
newContext->ctx_flags |= CTX_returning;
newContext->ctx_scope_level = scratch->scopeLevel;
scratch->context->push(newContext);
}
@ -219,6 +221,7 @@ namespace
dsql_ctx* oldContext;
string oldAlias, oldInternalAlias;
AutoSetRestore<USHORT> autoFlags;
AutoSetRestore<USHORT> autoScopeLevel;
};
} // namespace