Skip to content

Commit 7287114

Browse files
committed
Fix #8956 - Firebird 6.0: DECLARE VARIABLE does not accept arbitrary expressions within declared routines
1 parent 6202493 commit 7287114

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/dsql/StmtNodes.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,7 +2202,7 @@ DmlNode* DeclareVariableNode::parse(thread_db* tdbb, MemoryPool& pool, CompilerS
22022202

22032203
DeclareVariableNode* DeclareVariableNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
22042204
{
2205-
if (dsqlDef->defaultClause)
2205+
if (dsqlDef->defaultClause && !(dsqlScratch->flags & DsqlCompilerScratch::FLAG_SUB_ROUTINE))
22062206
dsqlDef->defaultClause->value = doDsqlPass(dsqlScratch, dsqlDef->defaultClause->value);
22072207

22082208
dsql_fld* field = dsqlDef->type;
@@ -5059,7 +5059,6 @@ ExecBlockNode* ExecBlockNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
50595059
if (newParam->defaultClause)
50605060
newParam->defaultClause->value = doDsqlPass(dsqlScratch, newParam->defaultClause->value);
50615061

5062-
50635062
{ // scope
50645063
ValueExprNode* temp = newParam->parameterExpr;
50655064

0 commit comments

Comments
 (0)