MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Reset

Method Reset

IceFireDB-SQLProxy/pkg/mysql/mysql/resultset.go:38–62  ·  view source on GitHub ↗
(fieldsCount int)

Source from the content-addressed store, hash-verified

36}
37
38func (r *Resultset) Reset(fieldsCount int) {
39 r.RawPkg = r.RawPkg[:0]
40
41 r.Fields = r.Fields[:0]
42 r.Values = r.Values[:0]
43 r.RowDatas = r.RowDatas[:0]
44
45 if r.FieldNames != nil {
46 for k := range r.FieldNames {
47 delete(r.FieldNames, k)
48 }
49 } else {
50 r.FieldNames = make(map[string]int)
51 }
52
53 if fieldsCount == 0 {
54 return
55 }
56
57 if cap(r.Fields) < fieldsCount {
58 r.Fields = make([]*Field, fieldsCount)
59 } else {
60 r.Fields = r.Fields[:fieldsCount]
61 }
62}
63
64func (r *Resultset) RowNumber() int {
65 return len(r.Values)

Callers 9

BytesBufferGetFunction · 0.45
readResultStreamingMethod · 0.45
NewResultsetFunction · 0.45
CalcPasswordFunction · 0.45
CalcCachingSha2PasswordFunction · 0.45
scrambleValidationFunction · 0.45
writeCachingSha2CacheMethod · 0.45
ReturnMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected