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

Method readDb

IceFireDB-SQLProxy/pkg/mysql/server/handshake_resp.go:107–122  ·  view source on GitHub ↗
(data []byte, pos int)

Source from the content-addressed store, hash-verified

105}
106
107func (c *Conn) readDb(data []byte, pos int) (int, error) {
108 if c.capability&CLIENT_CONNECT_WITH_DB != 0 {
109 if len(data[pos:]) == 0 {
110 return pos, nil
111 }
112
113 db := string(data[pos : pos+bytes.IndexByte(data[pos:], 0x00)])
114 pos += len(db) + 1
115
116 if err := c.h.UseDB(c, db); err != nil {
117 return 0, err
118 }
119 c.db = db
120 }
121 return pos, nil
122}
123
124func (c *Conn) readPluginName(data []byte, pos int) int {
125 if c.capability&CLIENT_PLUGIN_AUTH != 0 {

Callers 1

readHandshakeResponseMethod · 0.95

Calls 1

UseDBMethod · 0.65

Tested by

no test coverage detected