Skip to content

Commit 44e9748

Browse files
committed
Sync the trace logic with MON$ tables regarding txn isolation, make it more robust to improper set of flags
1 parent e5f6ec1 commit 44e9748

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

src/jrd/trace/TraceObjects.cpp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -210,27 +210,21 @@ int TraceTransactionImpl::getWait()
210210

211211
unsigned TraceTransactionImpl::getIsolation()
212212
{
213-
switch (m_tran->tra_flags & (TRA_read_committed | TRA_rec_version | TRA_degree3 | TRA_read_consistency))
214-
{
215-
case TRA_degree3:
213+
if (m_tran->tra_flags & TRA_degree3)
216214
return ISOLATION_CONSISTENCY;
217215

218-
case TRA_read_committed:
219-
return ISOLATION_READ_COMMITTED_NORECVER;
220-
221-
case TRA_read_committed | TRA_rec_version:
222-
return ISOLATION_READ_COMMITTED_RECVER;
223-
224-
case TRA_read_committed | TRA_rec_version | TRA_read_consistency:
225-
return ISOLATION_READ_COMMITTED_READ_CONSISTENCY;
216+
if (m_tran->tra_flags & TRA_read_committed)
217+
{
218+
if (m_tran->tra_flags & TRA_read_consistency)
219+
return ISOLATION_READ_COMMITTED_READ_CONSISTENCY;
226220

227-
case 0:
228-
return ISOLATION_CONCURRENCY;
221+
if (m_tran->tra_flags & TRA_rec_version)
222+
return ISOLATION_READ_COMMITTED_RECVER;
229223

230-
default:
231-
fb_assert(false);
232-
return ISOLATION_CONCURRENCY;
224+
return ISOLATION_READ_COMMITTED_NORECVER;
233225
}
226+
227+
return ISOLATION_CONCURRENCY;
234228
}
235229

236230
ISC_INT64 TraceTransactionImpl::getInitialID()

0 commit comments

Comments
 (0)