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

Function selectTiDBRowKeyFields

dumpling/export/dump.go:1025–1037  ·  view source on GitHub ↗
(tctx *tcontext.Context, conn *BaseConn, meta TableMeta, checkPkFields func([]string, []string) error)

Source from the content-addressed store, hash-verified

1023}
1024
1025func selectTiDBRowKeyFields(tctx *tcontext.Context, conn *BaseConn, meta TableMeta, checkPkFields func([]string, []string) error) (pkFields, pkColTypes []string, err error) {
1026 if meta.HasImplicitRowID() {
1027 pkFields, pkColTypes = []string{"_tidb_rowid"}, []string{"BIGINT"}
1028 } else {
1029 pkFields, pkColTypes, err = GetPrimaryKeyAndColumnTypes(tctx, conn, meta)
1030 if err == nil {
1031 if checkPkFields != nil {
1032 err = checkPkFields(pkFields, pkColTypes)
1033 }
1034 }
1035 }
1036 return
1037}
1038
1039func checkTiDBTableRegionPkFields(pkFields, pkColTypes []string) (err error) {
1040 if len(pkFields) != 1 || len(pkColTypes) != 1 {

Calls 2

HasImplicitRowIDMethod · 0.65

Tested by

no test coverage detected