mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 01:23:03 +01:00
Additional patch for CORE-6015 : Segfault when using expression index with complex expression.
Changed way to detect indirect recursion: when req_caller chain is broken by EXECUTE STATEMENT.
This commit is contained in:
parent
a34b48586d
commit
5bbf69b5b3
@ -317,7 +317,7 @@ bool JrdStatement::isActive() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
jrd_req* JrdStatement::findRequest(thread_db* tdbb)
|
jrd_req* JrdStatement::findRequest(thread_db* tdbb, bool unique)
|
||||||
{
|
{
|
||||||
SET_TDBB(tdbb);
|
SET_TDBB(tdbb);
|
||||||
Attachment* const attachment = tdbb->getAttachment();
|
Attachment* const attachment = tdbb->getAttachment();
|
||||||
@ -346,6 +346,9 @@ jrd_req* JrdStatement::findRequest(thread_db* tdbb)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unique)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
else if (!(next->req_flags & req_in_use) && !clone)
|
else if (!(next->req_flags & req_in_use) && !clone)
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
const Routine* getRoutine() const;
|
const Routine* getRoutine() const;
|
||||||
bool isActive() const;
|
bool isActive() const;
|
||||||
|
|
||||||
jrd_req* findRequest(thread_db* tdbb);
|
jrd_req* findRequest(thread_db* tdbb, bool unique = false);
|
||||||
jrd_req* getRequest(thread_db* tdbb, USHORT level);
|
jrd_req* getRequest(thread_db* tdbb, USHORT level);
|
||||||
void verifyAccess(thread_db* tdbb);
|
void verifyAccess(thread_db* tdbb);
|
||||||
void release(thread_db* tdbb);
|
void release(thread_db* tdbb);
|
||||||
|
@ -526,13 +526,11 @@ DSC* BTR_eval_expression(thread_db* tdbb, index_desc* idx, Record* record, bool&
|
|||||||
|
|
||||||
// check for resursive expression evaluation
|
// check for resursive expression evaluation
|
||||||
jrd_req* const org_request = tdbb->getRequest();
|
jrd_req* const org_request = tdbb->getRequest();
|
||||||
for (jrd_req* req = org_request; req; req = req->req_caller)
|
jrd_req* const expr_request = idx->idx_expression_statement->findRequest(tdbb, true);
|
||||||
{
|
|
||||||
if (req->getStatement() == idx->idx_expression_statement)
|
if (expr_request == NULL)
|
||||||
ERR_post(Arg::Gds(isc_random) << "Attempt to evaluate index expression recursively");
|
ERR_post(Arg::Gds(isc_random) << "Attempt to evaluate index expression recursively");
|
||||||
}
|
|
||||||
|
|
||||||
jrd_req* const expr_request = idx->idx_expression_statement->findRequest(tdbb);
|
|
||||||
fb_assert(expr_request != org_request);
|
fb_assert(expr_request != org_request);
|
||||||
|
|
||||||
fb_assert(expr_request->req_caller == NULL);
|
fb_assert(expr_request->req_caller == NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user