func (tc *ZDBContext) SetClientCapability(flags uint32) {
}
SetClientCapability implements QueryCtx SetClientCapability method.
package server
import (
	"context"
	"crypto/tls"
	"github.com/pingcap/parser/ast"
	"github.com/pingcap/parser/mysql"
	"github.com/pingcap/tidb/kv"
	"github.com/pingcap/tidb/sessionctx/variable"
	"github.com/pingcap/tidb/types"
	"github.com/pingcap/tidb/util/chunk"
	"github.com/zhihu/zetta/tablestore/mysql/sqlexec"
)
type ZDBDriver struct {
	store kv.Storage
}
func NewZDBDriver(store kv.Storage) *ZDBDriver {
	return &ZDBDriver{
		store: store,
	}
}
func (qd *ZDBDriver) OpenCtx(connID uint64, capability uint32, collation uint8, dbname string, tlsState *tls.ConnectionState) (QueryCtx, error) {
	se, err := CreateSession(qd.store)
	if err != nil {
		return nil, err
	}
	err = se.SetCollation(int(collation))
	if err != nil {
		return nil, err
	}
	se.SetConnectionID(connID)
	zc := &ZDBContext{
		session:   se,
		currentDB: dbname,
	}
	return zc, nil
}
type ZDBContext struct {
	baseContext
	session   Session
	currentDB string
}
func (tc *ZDBContext) Status() uint16 {
	return tc.session.Status()
}
func (tc *ZDBContext) GetHistorySQL() string {
	return tc.session.GetHistorySQL()
}
func (tc *ZDBContext) AffectedRows() uint64 {
	return tc.session.AffectedRows()
}
func (tc *ZDBContext) CommitTxn(ctx context.Context) error {
	return tc.session.CommitTxn(ctx)
}
func (tc *ZDBContext) RollbackTxn() {
	tc.session.RollbackTxn(context.TODO())
}
func (tc *ZDBContext) CurrentDB() string {
	return tc.currentDB
}
func (tc *ZDBContext) ExecuteStmt(ctx context.Context, stmt ast.StmtNode) (ResultSet, error) {
	rs, err := tc.session.ExecuteStmt(ctx, stmt)
	if err != nil {
		return nil, err
	}
	if rs == nil {
		return nil, nil
	}
	return &zdbResultSet{
		recordSet: rs,
	}, nil
}
func (tc *ZDBContext) Parse(ctx context.Context, sql string) ([]ast.StmtNode, error) {
	return tc.session.Parse(ctx, sql)
}