func NewMysqlProxy(session base.ClientSession, decryptor base.Decryptor, setting base.ProxySetting) (*Handler, error) {
	observerManager, err := base.NewArrayQueryObserverableManager(session.Context())
	if err != nil {
		return nil, err
	}
	return &Handler{
		isTLSHandshake:         false,
		dbTLSHandshakeFinished: make(chan bool),
		clientDeprecateEOF:     false,
		decryptor:              decryptor,
		responseHandler:        defaultResponseHandler,
		acracensor:             setting.Censor(),
		clientConnection:       session.ClientConnection(),
		dbConnection:           session.DatabaseConnection(),
		setting:                setting,
		ctx:                    session.Context(),
		logger:                 logging.GetLoggerFromContext(session.Context()),
		queryObserverManager:   observerManager,
		decryptionObserver:     base.NewColumnDecryptionObserver(),
	}, nil
}
NewMysqlProxy returns new Handler
package mysql
import (
	"bytes"
	"context"
	"encoding/binary"
	"errors"
	"fmt"
	"go.opencensus.io/trace"
	"io"
	"net"
	"strconv"
	"time"
	"github.com/cossacklabs/acra/acra-censor"
	"github.com/cossacklabs/acra/acra-censor/common"
	"github.com/cossacklabs/acra/decryptor/base"
	"github.com/cossacklabs/acra/logging"
	"github.com/cossacklabs/acra/network"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/sirupsen/logrus"
)
const (
	MaxPayloadLen int = 1<<24 - 1
	ClientWaitDbTLSHandshake = 5
)
const (
	_ byte = iota  
	CommandQuit
	_  
	CommandQuery
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	_  
	CommandStatementPrepare
	CommandStatementExecute
	CommandStatementSendLongData
	CommandStatementClose
	CommandStatementReset
	_  
	_  
	_  
	_  
	_  
)
const (
	TypeDecimal byte = iota
	TypeTiny
	TypeShort
	TypeLong
	TypeFloat
	TypeDouble
	TypeNull
	TypeTimestamp
	TypeLongLong
	TypeInt24
	TypeDate
	TypeTime
	TypeDatetime
	TypeYear
	TypeNewDate
	TypeVarchar
	TypeBit
)
const (
	TypeNewDecimal byte = iota + 0xf6
	TypeEnum
	TypeSet
	TypeTinyBlob
	TypeMediumBlob
	TypeLongBlob
	TypeBlob
	TypeVarString
	TypeString
	TypeGeometry
)
func IsBinaryColumn(value byte) bool {
	isBlob := value >= TypeTinyBlob && value <= TypeBlob
	isString := value == TypeVarString || value == TypeString
	return isString || isBlob || value == TypeVarchar
}
type ResponseHandler func(ctx context.Context, packet *Packet, dbConnection, clientConnection net.Conn) error
func defaultResponseHandler(ctx context.Context, packet *Packet, _, clientConnection net.Conn) error {
	if _, err := clientConnection.Write(packet.Dump()); err != nil {
		return err
	}
	return nil
}
type Handler struct {
	responseHandler      ResponseHandler
	clientSequenceNumber int
	clientProtocol41     bool
	serverProtocol41     bool
	currentCommand       byte
	clientDeprecateEOF     bool
	decryptor              base.Decryptor
	acracensor             acracensor.AcraCensorInterface
	isTLSHandshake         bool
	dbTLSHandshakeFinished chan bool
	clientConnection       net.Conn
	dbConnection           net.Conn
	logger                 *logrus.Entry
	ctx                    context.Context
	queryObserverManager   base.QueryObserverManager
	decryptionObserver     base.ColumnDecryptionObserver
	setting                base.ProxySetting
}