Skip to content

Commit

Permalink
force tablesample sort
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunzhu authored and ti-chi-bot committed Nov 8, 2023
1 parent 5a6c8c8 commit 2e681e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dumpling/export/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ func buildTiDBTableSampleQuery(pkFields []string, dbName, tblName string) string
template := "SELECT %s FROM `%s`.`%s` TABLESAMPLE REGIONS() ORDER BY %s"
quotaPk := make([]string, len(pkFields))
for i, s := range pkFields {
quotaPk[i] = fmt.Sprintf("`%s`", escapeString(s))
quotaPk[i] = fmt.Sprintf("COALESCE(`%s`)", escapeString(s))
}
pks := strings.Join(quotaPk, ",")
return fmt.Sprintf(template, pks, escapeString(dbName), escapeString(tblName), pks)
Expand Down

0 comments on commit 2e681e6

Please sign in to comment.