Skip to content

Commit 51d7bda

Browse files
authored
Fix locking error if IN/EXISTS is converted into a semi-join (#8871)
1 parent d676629 commit 51d7bda

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/jrd/recsrc/HashJoin.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,11 @@ bool HashJoin::refetchRecord(thread_db* /*tdbb*/) const
543543
return true;
544544
}
545545

546-
WriteLockResult HashJoin::lockRecord(thread_db* /*tdbb*/) const
546+
WriteLockResult HashJoin::lockRecord(thread_db* tdbb) const
547547
{
548+
if (m_joinType == SEMI_JOIN || m_joinType == ANTI_JOIN)
549+
return m_leader.source->lockRecord(tdbb);
550+
548551
status_exception::raise(Arg::Gds(isc_record_lock_not_supp));
549552
}
550553

src/jrd/recsrc/NestedLoopJoin.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,11 @@ bool NestedLoopJoin::refetchRecord(thread_db* /*tdbb*/) const
247247
return true;
248248
}
249249

250-
WriteLockResult NestedLoopJoin::lockRecord(thread_db* /*tdbb*/) const
250+
WriteLockResult NestedLoopJoin::lockRecord(thread_db* tdbb) const
251251
{
252+
if (m_joinType == SEMI_JOIN || m_joinType == ANTI_JOIN)
253+
return m_args.front()->lockRecord(tdbb);
254+
252255
status_exception::raise(Arg::Gds(isc_record_lock_not_supp));
253256
}
254257

0 commit comments

Comments
 (0)