Skip to content

Commit b6a29d0

Browse files
committed
Fixed issue with transaction in R/O database reported by Adriano privately
1 parent ab9cd28 commit b6a29d0

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/jrd/Attachment.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,12 @@ void Attachment::createMetaTransaction(thread_db* tdbb)
959959
{
960960
att_meta_transaction = TRA_start(tdbb,
961961
TRA_readonly | TRA_ignore_limbo | TRA_read_committed | TRA_rec_version, DEFAULT_LOCK_TIMEOUT);
962+
963+
if (att_meta_transaction && att_meta_transaction->tra_lock)
964+
{
965+
LCK_release(tdbb, att_meta_transaction->tra_lock);
966+
att_meta_transaction->tra_lock = nullptr;
967+
}
962968
}
963969
}
964970

src/jrd/tra.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class jrd_tra final : public pool_alloc<type_tra>
278278
ReplBlobMap tra_repl_blobs; // map of blob IDs replicated in this transaction
279279
BlobUtilMap tra_blob_util_map; // map of blob IDs for RDB$BLOB_UTIL package
280280
ArrayField* tra_arrays; // Linked list of active arrays
281-
Lock* tra_lock; // lock for transaction
281+
Lock* tra_lock; // lock for transaction - may be NULL for special transactions
282282
Lock* tra_alter_db_lock; // lock for ALTER DATABASE statement(s)
283283
vec<Lock*>* tra_relation_locks; // locks for relations
284284
TransactionBitmap* tra_commit_sub_trans; // committed sub-transactions

0 commit comments

Comments
 (0)