MCPcopy Create free account
hub / github.com/pingcap/tidb / writeColNames

Method writeColNames

pkg/ttl/sqlbuilder/sql.go:257–275  ·  view source on GitHub ↗
(cols []*model.ColumnInfo, writeBrackets bool)

Source from the content-addressed store, hash-verified

255}
256
257func (b *SQLBuilder) writeColNames(cols []*model.ColumnInfo, writeBrackets bool) {
258 if writeBrackets {
259 b.restoreCtx.WritePlain("(")
260 }
261
262 first := true
263 for _, col := range cols {
264 if first {
265 first = false
266 } else {
267 b.restoreCtx.WritePlain(", ")
268 }
269 b.writeColName(col)
270 }
271
272 if writeBrackets {
273 b.restoreCtx.WritePlain(")")
274 }
275}
276
277func (b *SQLBuilder) writeDataPoint(cols []*model.ColumnInfo, dp []types.Datum) error {
278 writeBrackets := len(cols) > 1

Callers 5

WriteSelectMethod · 0.95
WriteCommonConditionMethod · 0.95
WriteExpireConditionMethod · 0.95
WriteInConditionMethod · 0.95
WriteOrderByMethod · 0.95

Calls 2

writeColNameMethod · 0.95
WritePlainMethod · 0.80

Tested by

no test coverage detected