8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:00:38 +01:00

Simplest fix for #8185: SIGSEGV in Firebird 5.0.0.1306 embedded during update on cursor - disallow caching for positioned updates/deletes

This commit is contained in:
Dmitry Yemanov 2024-07-27 14:48:41 +03:00
parent b056f5b4f3
commit 08dc25f8c4
2 changed files with 7 additions and 1 deletions

View File

@ -177,6 +177,8 @@ void DsqlRequest::destroy(thread_db* tdbb, DsqlRequest* dsqlRequest)
{
childStatement->addFlags(DsqlStatement::FLAG_ORPHAN);
childStatement->setParentRequest(nullptr);
childStatement->setParentDbKey(nullptr);
childStatement->setParentRecVersion(nullptr);
// hvlad: lines below is commented out as
// - child is already unlinked from its parent request

View File

@ -620,7 +620,11 @@ static RefPtr<DsqlStatement> prepareStatement(thread_db* tdbb, dsql_dbb* databas
if (!isInternalRequest && dsqlStatement->mustBeReplicated())
dsqlStatement->setOrgText(text, textLength);
if (isStatementCacheActive && dsqlStatement->isDml())
const bool basedOnCursor =
(dsqlStatement->getType() & (DsqlStatement::TYPE_UPDATE_CURSOR |
DsqlStatement::TYPE_DELETE_CURSOR));
if (isStatementCacheActive && dsqlStatement->isDml() && !basedOnCursor)
{
database->dbb_statement_cache->putStatement(tdbb,
textStr, clientDialect, isInternalRequest, dsqlStatement);