(pkFields []string, dbName, tblName string)
| 1013 | } |
| 1014 | |
| 1015 | func buildTiDBTableSampleQuery(pkFields []string, dbName, tblName string) string { |
| 1016 | template := "SELECT %s FROM `%s`.`%s` TABLESAMPLE REGIONS() ORDER BY %s" |
| 1017 | quotaPk := make([]string, len(pkFields)) |
| 1018 | for i, s := range pkFields { |
| 1019 | quotaPk[i] = fmt.Sprintf("`%s`", escapeString(s)) |
| 1020 | } |
| 1021 | pks := strings.Join(quotaPk, ",") |
| 1022 | return fmt.Sprintf(template, pks, escapeString(dbName), escapeString(tblName), pks) |
| 1023 | } |
| 1024 | |
| 1025 | func selectTiDBRowKeyFields(tctx *tcontext.Context, conn *BaseConn, meta TableMeta, checkPkFields func([]string, []string) error) (pkFields, pkColTypes []string, err error) { |
| 1026 | if meta.HasImplicitRowID() { |
no test coverage detected