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

Method readResult

IceFireDB-SQLProxy/pkg/mysql/client/resp.go:219–236  ·  view source on GitHub ↗
(binary bool)

Source from the content-addressed store, hash-verified

217}
218
219func (c *Conn) readResult(binary bool) (*Result, error) {
220 firstPkgBuf, err := c.ReadPacketReuseMem(utils.ByteSliceGet(16)[:0])
221 defer utils.ByteSlicePut(firstPkgBuf)
222
223 if err != nil {
224 return nil, errors.Trace(err)
225 }
226
227 if firstPkgBuf[0] == OK_HEADER {
228 return c.handleOKPacket(firstPkgBuf)
229 } else if firstPkgBuf[0] == ERR_HEADER {
230 return nil, c.handleErrorPacket(append([]byte{}, firstPkgBuf...))
231 } else if firstPkgBuf[0] == LocalInFile_HEADER {
232 return nil, ErrMalformPacket
233 }
234
235 return c.readResultset(firstPkgBuf, binary)
236}
237
238func (c *Conn) readResultStreaming(binary bool, result *Result, perRowCb SelectPerRowCallback) error {
239 firstPkgBuf, err := c.ReadPacketReuseMem(utils.ByteSliceGet(16)[:0])

Callers 2

execMethod · 0.95
ExecuteMethod · 0.45

Calls 6

ReadPacketReuseMemMethod · 0.95
handleOKPacketMethod · 0.95
handleErrorPacketMethod · 0.95
readResultsetMethod · 0.95
ByteSliceGetFunction · 0.92
ByteSlicePutFunction · 0.92

Tested by

no test coverage detected