(data []byte, pos int)
| 105 | } |
| 106 | |
| 107 | func (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 | |
| 124 | func (c *Conn) readPluginName(data []byte, pos int) int { |
| 125 | if c.capability&CLIENT_PLUGIN_AUTH != 0 { |
no test coverage detected