MCPcopy
hub / github.com/pingcap/tidb / Cols

Method Cols

pkg/meta/model/table.go:323–336  ·  view source on GitHub ↗

Cols returns the columns of the table in public state.

()

Source from the content-addressed store, hash-verified

321
322// Cols returns the columns of the table in public state.
323func (t *TableInfo) Cols() []*ColumnInfo {
324 publicColumns := make([]*ColumnInfo, len(t.Columns))
325 maxOffset := -1
326 for _, col := range t.Columns {
327 if col.State != StatePublic {
328 continue
329 }
330 publicColumns[col.Offset] = col
331 if maxOffset < col.Offset {
332 maxOffset = col.Offset
333 }
334 }
335 return publicColumns[0 : maxOffset+1]
336}
337
338// FindIndexByName finds index by name.
339func (t *TableInfo) FindIndexByName(idxName string) *IndexInfo {

Callers 3

TestBuildExpressionFunction · 0.95
GetPrimaryKeyMethod · 0.95

Calls

no outgoing calls

Tested by 1

TestBuildExpressionFunction · 0.76