You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TableLockTpInfo is composed by schema ID, table ID and table lock type.
262
+
typeTableLockTpInfostruct {
263
+
SchemaIDint64
264
+
TableIDint64
265
+
TpTableLockType
266
+
}
267
+
268
+
// TableLockState is the state for table lock.
269
+
typeTableLockStatebyte
270
+
271
+
const (
272
+
// TableLockStateNone means this table lock is absent.
273
+
TableLockStateNoneTableLockState=iota
274
+
// 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.
275
+
TableLockStatePreLock
276
+
// TableLockStatePublic means this table lock is public state.
277
+
TableLockStatePublic
278
+
)
279
+
280
+
// String implements fmt.Stringer interface.
281
+
func (tTableLockState) String() string {
282
+
switcht {
283
+
caseTableLockStatePreLock:
284
+
return"pre-lock"
285
+
caseTableLockStatePublic:
286
+
return"public"
287
+
default:
288
+
return"none"
289
+
}
290
+
}
291
+
292
+
// TableLockType is the type of the table lock.
293
+
typeTableLockTypebyte
294
+
295
+
const (
296
+
TableLockNoneTableLockType=iota
297
+
// TableLockRead means the session with this lock can read the table (but not write it).
298
+
// Multiple sessions can acquire a READ lock for the table at the same time.
299
+
// Other sessions can read the table without explicitly acquiring a READ lock.
300
+
TableLockRead
301
+
// TableLockReadLocal is not supported.
302
+
TableLockReadLocal
303
+
// TableLockWrite means only the session with this lock has write/read permission.
304
+
// Only the session that holds the lock can access the table. No other session can access it until the lock is released.
305
+
TableLockWrite
306
+
// TableLockWriteLocal means the session with this lock has write/read permission, and the other session still has read permission.
307
+
TableLockWriteLocal
308
+
)
309
+
310
+
func (tTableLockType) String() string {
311
+
switcht {
312
+
caseTableLockNone:
313
+
return"NONE"
314
+
caseTableLockRead:
315
+
return"READ"
316
+
caseTableLockReadLocal:
317
+
return"READ LOCAL"
318
+
caseTableLockWriteLocal:
319
+
return"WRITE LOCAL"
320
+
caseTableLockWrite:
321
+
return"WRITE"
322
+
}
323
+
return""
324
+
}
325
+
238
326
// GetPartitionInfo returns the partition information.
0 commit comments