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

Method Parse

IceFireDB-SQLite/pkg/mysql/mysql/field.go:44–134  ·  view source on GitHub ↗
(p FieldData)

Source from the content-addressed store, hash-verified

42)
43
44func (f *Field) Parse(p FieldData) (err error) {
45 f.Data = p
46
47 var n int
48 pos := 0
49 // skip catelog, always def
50 n, err = SkipLengthEncodedString(p)
51 if err != nil {
52 return
53 }
54 pos += n
55
56 // schema
57 f.Schema, _, n, err = LengthEncodedString(p[pos:])
58 if err != nil {
59 return
60 }
61 pos += n
62
63 // table
64 f.Table, _, n, err = LengthEncodedString(p[pos:])
65 if err != nil {
66 return
67 }
68 pos += n
69
70 // org_table
71 f.OrgTable, _, n, err = LengthEncodedString(p[pos:])
72 if err != nil {
73 return
74 }
75 pos += n
76
77 // name
78 f.Name, _, n, err = LengthEncodedString(p[pos:])
79 if err != nil {
80 return
81 }
82 pos += n
83
84 // org_name
85 f.OrgName, _, n, err = LengthEncodedString(p[pos:])
86 if err != nil {
87 return
88 }
89 pos += n
90
91 // skip oc
92 pos += 1
93
94 // charset
95 f.Charset = binary.LittleEndian.Uint16(p[pos:])
96 pos += 2
97
98 // column length
99 f.ColumnLength = binary.LittleEndian.Uint32(p[pos:])
100 pos += 4
101

Callers 6

confInitFunction · 0.45
readResultColumnsMethod · 0.45
readResultRowsMethod · 0.45
FieldListMethod · 0.45
ParseMethod · 0.45

Calls 3

SkipLengthEncodedStringFunction · 0.70
LengthEncodedStringFunction · 0.70
LengthEncodedIntFunction · 0.70

Tested by

no test coverage detected