mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 15:23:02 +01:00
Fixed CORE-6086, thanks to Vlad
This commit is contained in:
parent
a7d953adca
commit
49754a89fd
@ -601,6 +601,7 @@ void DsqlCompilerScratch::clearCTEs()
|
|||||||
flags &= ~DsqlCompilerScratch::FLAG_RECURSIVE_CTE;
|
flags &= ~DsqlCompilerScratch::FLAG_RECURSIVE_CTE;
|
||||||
ctes.clear();
|
ctes.clear();
|
||||||
cteAliases.clear();
|
cteAliases.clear();
|
||||||
|
currCteAlias = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for unused CTEs and issue a warning about its presence. Also, make DSQL
|
// Look for unused CTEs and issue a warning about its presence. Also, make DSQL
|
||||||
|
@ -216,6 +216,7 @@ public:
|
|||||||
void addCTEAlias(const Firebird::string& alias)
|
void addCTEAlias(const Firebird::string& alias)
|
||||||
{
|
{
|
||||||
thread_db* tdbb = JRD_get_thread_data();
|
thread_db* tdbb = JRD_get_thread_data();
|
||||||
|
fb_assert(currCteAlias == NULL);
|
||||||
cteAliases.add(FB_NEW_POOL(*tdbb->getDefaultPool()) Firebird::string(*tdbb->getDefaultPool(), alias));
|
cteAliases.add(FB_NEW_POOL(*tdbb->getDefaultPool()) Firebird::string(*tdbb->getDefaultPool(), alias));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1232,13 +1232,14 @@ RseNode* PASS1_derived_table(DsqlCompilerScratch* dsqlScratch, SelectExprNode* i
|
|||||||
dsqlScratch->recursiveCtx = context;
|
dsqlScratch->recursiveCtx = context;
|
||||||
dsqlScratch->context = &temp;
|
dsqlScratch->context = &temp;
|
||||||
|
|
||||||
const string* const* saveCteAlias = dsqlScratch->currCteAlias;
|
const string* const saveCteAlias =
|
||||||
|
dsqlScratch->currCteAlias ? *dsqlScratch->currCteAlias : NULL;
|
||||||
dsqlScratch->resetCTEAlias(alias);
|
dsqlScratch->resetCTEAlias(alias);
|
||||||
|
|
||||||
rse = PASS1_rse(dsqlScratch, input, updateLock);
|
rse = PASS1_rse(dsqlScratch, input, updateLock);
|
||||||
|
|
||||||
if (saveCteAlias)
|
if (saveCteAlias)
|
||||||
dsqlScratch->resetCTEAlias(**saveCteAlias);
|
dsqlScratch->resetCTEAlias(*saveCteAlias);
|
||||||
dsqlScratch->recursiveCtx = saveRecursiveCtx;
|
dsqlScratch->recursiveCtx = saveRecursiveCtx;
|
||||||
|
|
||||||
// Finish off by cleaning up contexts and put them into derivedContext
|
// Finish off by cleaning up contexts and put them into derivedContext
|
||||||
|
Loading…
Reference in New Issue
Block a user