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

Method writeOK

IceFireDB-SQLProxy/pkg/mysql/server/resp.go:9–29  ·  view source on GitHub ↗
(r *Result)

Source from the content-addressed store, hash-verified

7)
8
9func (c *Conn) writeOK(r *Result) error {
10 if r == nil {
11 r = &Result{}
12 }
13
14 r.Status |= c.status
15
16 data := make([]byte, 4, 32)
17
18 data = append(data, OK_HEADER)
19
20 data = append(data, PutLengthEncodedInt(r.AffectedRows)...)
21 data = append(data, PutLengthEncodedInt(r.InsertId)...)
22
23 if c.capability&CLIENT_PROTOCOL_41 > 0 {
24 data = append(data, byte(r.Status), byte(r.Status>>8))
25 data = append(data, byte(r.Warnings), byte(r.Warnings>>8))
26 }
27
28 return c.WritePacket(data)
29}
30
31func (c *Conn) WriteError(e error) error {
32 return c.writeError(e)

Callers 2

WriteValueMethod · 0.95
handshakeMethod · 0.95

Calls 2

WritePacketMethod · 0.95
PutLengthEncodedIntFunction · 0.50

Tested by

no test coverage detected