mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 05:23:03 +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;
|
||||
ctes.clear();
|
||||
cteAliases.clear();
|
||||
currCteAlias = NULL;
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
thread_db* tdbb = JRD_get_thread_data();
|
||||
fb_assert(currCteAlias == NULL);
|
||||
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->context = &temp;
|
||||
|
||||
const string* const* saveCteAlias = dsqlScratch->currCteAlias;
|
||||
const string* const saveCteAlias =
|
||||
dsqlScratch->currCteAlias ? *dsqlScratch->currCteAlias : NULL;
|
||||
dsqlScratch->resetCTEAlias(alias);
|
||||
|
||||
rse = PASS1_rse(dsqlScratch, input, updateLock);
|
||||
|
||||
if (saveCteAlias)
|
||||
dsqlScratch->resetCTEAlias(**saveCteAlias);
|
||||
dsqlScratch->resetCTEAlias(*saveCteAlias);
|
||||
dsqlScratch->recursiveCtx = saveRecursiveCtx;
|
||||
|
||||
// Finish off by cleaning up contexts and put them into derivedContext
|
||||
|
Loading…
Reference in New Issue
Block a user