Generate tpb for table lock. If lock level is specified, it overrrides the transaction lock level.
| 9059 | // Generate tpb for table lock. |
| 9060 | // If lock level is specified, it overrrides the transaction lock level. |
| 9061 | void 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 | //-------------------- |
nothing calls this directly
no test coverage detected