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

Function buildOrderByClauseString

dumpling/export/sql.go:1208–1218  ·  view source on GitHub ↗
(handleColNames []string)

Source from the content-addressed store, hash-verified

1206}
1207
1208func buildOrderByClauseString(handleColNames []string) string {
1209 if len(handleColNames) == 0 {
1210 return ""
1211 }
1212 separator := ","
1213 quotaCols := make([]string, len(handleColNames))
1214 for i, col := range handleColNames {
1215 quotaCols[i] = fmt.Sprintf("`%s`", escapeString(col))
1216 }
1217 return fmt.Sprintf("ORDER BY %s", strings.Join(quotaCols, separator))
1218}
1219
1220func buildLockTablesSQL(allTables DatabaseTables, blockList map[string]map[string]any) string {
1221 // ,``.`` READ has 11 bytes, "LOCK TABLE" has 10 bytes

Calls 2

escapeStringFunction · 0.70
JoinMethod · 0.65