Skip to content

Commit

Permalink
Simplest fix for #8185: SIGSEGV in Firebird 5.0.0.1306 embedded durin…
Browse files Browse the repository at this point in the history
…g update on cursor - disallow caching for positioned updates/deletes
  • Loading branch information
dyemanov committed Jul 27, 2024
1 parent b056f5b commit 08dc25f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/dsql/DsqlRequests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/dsql/dsql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 08dc25f

Please sign in to comment.