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

Method WriteToBufferInCsv

dumpling/export/sql_type.go:278–286  ·  view source on GitHub ↗

WriteToBufferInCsv implements Stringer.WriteToBufferInCsv

(bf *bytes.Buffer, escapeBackslash bool, opt *csvOption)

Source from the content-addressed store, hash-verified

276
277// WriteToBufferInCsv implements Stringer.WriteToBufferInCsv
278func (s *SQLTypeString) WriteToBufferInCsv(bf *bytes.Buffer, escapeBackslash bool, opt *csvOption) {
279 if s.RawBytes != nil {
280 bf.Write(opt.delimiter)
281 escapeCSV(s.RawBytes, bf, escapeBackslash, opt)
282 bf.Write(opt.delimiter)
283 } else {
284 bf.WriteString(opt.nullValue)
285 }
286}
287
288// SQLTypeBytes implements RowReceiverStringer which represents bytes type columns in database
289type SQLTypeBytes struct {

Callers

nothing calls this directly

Calls 3

escapeCSVFunction · 0.85
WriteMethod · 0.65
WriteStringMethod · 0.45

Tested by

no test coverage detected