func UnPackStatementPrepare(data []byte) (*Statement, error) {
	var err error
	stmt := &Statement{}
	buf := common.ReadBuffer(data)
	if stmt.Header, err = buf.ReadU8(); err != nil {
		return nil, sqldb.NewSQLErrorf(sqldb.ER_MALFORMED_PACKET, "invalid stmt-prepare-response packet header: %v", data)
	}
	if stmt.Header != OK_PACKET {
		return nil, sqldb.NewSQLErrorf(sqldb.ER_MALFORMED_PACKET, "invalid stmt-prepare-response packet header: %v", stmt.Header)
	}
	if stmt.ID, err = buf.ReadU32(); err != nil {
		return nil, sqldb.NewSQLErrorf(sqldb.ER_MALFORMED_PACKET, "invalid stmt-prepare-response packet stmt.ID: %v", data)
	}
	if stmt.ColumnCount, err = buf.ReadU16(); err != nil {
		return nil, sqldb.NewSQLErrorf(sqldb.ER_MALFORMED_PACKET, "invalid stmt-prepare-response packet column.count: %v", data)
	}
	if stmt.ParamCount, err = buf.ReadU16(); err != nil {
		return nil, sqldb.NewSQLErrorf(sqldb.ER_MALFORMED_PACKET, "invalid stmt-prepare-response packet param.count: %v", data)
	}
	if _, err = buf.ReadU8(); err != nil {
		return nil, sqldb.NewSQLErrorf(sqldb.ER_MALFORMED_PACKET, "invalid stmt-prepare-response packet reserved: %v", data)
	}
	if stmt.Warnings, err = buf.ReadU16(); err != nil {
		return nil, sqldb.NewSQLErrorf(sqldb.ER_MALFORMED_PACKET, "invalid stmt-prepare-response packet warnings: %v", data)
	}
	return stmt, nil
}
UnPackStatementPrepare -- used to unpack the stmt-prepare-response packet.
https://dev.mysql.com/doc/internals/en/com-stmt-prepare-response.html
package proto
import (
	"fmt"
	"github.com/xelabs/go-mysqlstack/sqldb"
	"github.com/xelabs/go-mysqlstack/sqlparser/depends/common"
	querypb "github.com/xelabs/go-mysqlstack/sqlparser/depends/query"
	"github.com/xelabs/go-mysqlstack/sqlparser/depends/sqltypes"
)
type Statement struct {
	Header      byte  
	ID          uint32
	ColumnCount uint16
	ParamCount  uint16
	Warnings    uint16
	ParamsType  []int32
	ColumnNames []string
	BindVars map[string]*querypb.BindVariable
}