// TableLockTpInfo is composed by schema ID, table ID and table lock type.
typeTableLockTpInfostruct{
SchemaIDint64
TableIDint64
TpTableLockType
}
// TableLockState is the state for table lock.
typeTableLockStatebyte
const(
// TableLockStateNone means this table lock is absent.
TableLockStateNoneTableLockState=iota
// TableLockStatePreLock means this table lock is pre-lock state. Other session doesn't hold this lock should't do corresponding operation according to the lock type.
TableLockStatePreLock
// TableLockStatePublic means this table lock is public state.
TableLockStatePublic
)
// String implements fmt.Stringer interface.
func(tTableLockState)String()string{
switcht{
caseTableLockStatePreLock:
return"pre-lock"
caseTableLockStatePublic:
return"public"
default:
return"none"
}
}
// TableLockType is the type of the table lock.
typeTableLockTypebyte
const(
TableLockNoneTableLockType=iota
// TableLockRead means the session with this lock can read the table (but not write it).
// Multiple sessions can acquire a READ lock for the table at the same time.
// Other sessions can read the table without explicitly acquiring a READ lock.
TableLockRead
// TableLockReadLocal is not supported.
TableLockReadLocal
// TableLockWrite means only the session with this lock has write/read permission.
// Only the session that holds the lock can access the table. No other session can access it until the lock is released.
TableLockWrite
// TableLockWriteLocal means the session with this lock has write/read permission, and the other session still has read permission.
TableLockWriteLocal
)
func(tTableLockType)String()string{
switcht{
caseTableLockNone:
return"NONE"
caseTableLockRead:
return"READ"
caseTableLockReadLocal:
return"READ LOCAL"
caseTableLockWriteLocal:
return"WRITE LOCAL"
caseTableLockWrite:
return"WRITE"
}
return""
}
// GetPartitionInfo returns the partition information.
// GetPartitionInfo returns the partition information.