MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / genTableLock

Method genTableLock

src/dsql/StmtNodes.cpp:9061–9083  ·  view source on GitHub ↗

Generate tpb for table lock. If lock level is specified, it overrrides the transaction lock level.

Source from the content-addressed store, hash-verified

9059// Generate tpb for table lock.
9060// If lock level is specified, it overrrides the transaction lock level.
9061void SetTransactionNode::genTableLock(DsqlCompilerScratch* dsqlScratch,
9062 const RestrictionOption& tblLock, USHORT lockLevel)
9063{
9064 if (tblLock.tables->isEmpty())
9065 return;
9066
9067 if (tblLock.lockMode & LOCK_MODE_PROTECTED)
9068 lockLevel = isc_tpb_protected;
9069 else if (tblLock.lockMode & LOCK_MODE_SHARED)
9070 lockLevel = isc_tpb_shared;
9071
9072 const USHORT lockMode = (tblLock.lockMode & LOCK_MODE_WRITE) ?
9073 isc_tpb_lock_write : isc_tpb_lock_read;
9074
9075 for (ObjectsArray<MetaName>::iterator i = tblLock.tables->begin();
9076 i != tblLock.tables->end();
9077 ++i)
9078 {
9079 dsqlScratch->appendUChar(lockMode);
9080 dsqlScratch->appendNullString(i->c_str()); // stuff table name
9081 dsqlScratch->appendUChar(lockLevel);
9082 }
9083}
9084
9085
9086//--------------------

Callers

nothing calls this directly

Calls 6

appendUCharMethod · 0.80
appendNullStringMethod · 0.80
isEmptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected