Upgrade GMS and fix interface breakages

This commit is contained in:
Zach Musgrave
2021-09-24 11:24:42 -07:00
parent a1f0ada7c3
commit cb6dc214de
3 changed files with 7 additions and 13 deletions

View File

@@ -35,7 +35,6 @@ import (
"github.com/dolthub/dolt/go/libraries/doltcore/env"
"github.com/dolthub/dolt/go/libraries/doltcore/ref"
dsqle "github.com/dolthub/dolt/go/libraries/doltcore/sqle"
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/dfunctions"
_ "github.com/dolthub/dolt/go/libraries/doltcore/sqle/dfunctions"
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/dsess"
"github.com/dolthub/dolt/go/libraries/utils/tracing"
@@ -128,14 +127,9 @@ func Serve(ctx context.Context, version string, serverConfig ServerConfig, serve
dbs := commands.CollectDBs(mrEnv)
all := append(dsqleDBsAsSqlDBs(dbs), information_schema.NewInformationSchemaDatabase())
pro := dsqle.NewDoltDatabaseProvider(dEnv.Config, all...)
cat := sql.NewCatalog(pro)
a := analyzer.NewBuilder(cat).WithParallelism(serverConfig.QueryParallelism()).Build()
sqlEngine := sqle.New(cat, a, nil)
if err := sqlEngine.Catalog.Register(dfunctions.DoltFunctions...); err != nil {
return nil, err
}
a := analyzer.NewBuilder(pro).WithParallelism(serverConfig.QueryParallelism()).Build()
sqlEngine := sqle.New(a, nil)
portAsString := strconv.Itoa(serverConfig.Port())
hostPort := net.JoinHostPort(serverConfig.Host(), portAsString)
@@ -200,7 +194,7 @@ func newSessionBuilder(sqlEngine *sqle.Engine, username string, email string, pr
client := sql.Client{Address: conn.RemoteAddr().String(), User: conn.User, Capabilities: conn.Capabilities}
mysqlSess := sql.NewSession(host, client, conn.ConnectionID)
doltDbs := dbsAsDSQLDBs(sqlEngine.Catalog.AllDatabases())
doltDbs := dbsAsDSQLDBs(sqlEngine.Analyzer.Catalog.AllDatabases())
dbStates, err := getDbStates(ctx, doltDbs)
if err != nil {
return nil, nil, nil, err
@@ -225,7 +219,7 @@ func newSessionBuilder(sqlEngine *sqle.Engine, username string, email string, pr
sql.WithSession(doltSess),
sql.WithTracer(tracing.Tracer(ctx)))
dbs := dbsAsDSQLDBs(sqlEngine.Catalog.AllDatabases())
dbs := dbsAsDSQLDBs(sqlEngine.Analyzer.Catalog.AllDatabases())
for _, db := range dbs {
root, err := db.GetRoot(sqlCtx)
if err != nil {

View File

@@ -23,7 +23,7 @@ require (
github.com/denisbrodbeck/machineid v1.0.1
github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20201005193433-3ee972b1d078
github.com/dolthub/fslock v0.0.3
github.com/dolthub/go-mysql-server v0.10.1-0.20210916214046-f178c6b9d470
github.com/dolthub/go-mysql-server v0.10.1-0.20210924182047-42614db66e8d
github.com/dolthub/ishell v0.0.0-20210205014355-16a4ce758446
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81

View File

@@ -97,7 +97,7 @@ func (h *DoltHarness) ExecuteQuery(statement string) (schema string, results []s
defer func() {
if r := recover(); r != nil {
// Panics leave the engine in a bad state that we have to clean up
h.engine.Catalog.ProcessList.Kill(pid)
h.engine.ProcessList.Kill(pid)
panic(r)
}
}()
@@ -150,7 +150,7 @@ func innerInit(h *DoltHarness, dEnv *env.DoltEnv) error {
sql.WithViewRegistry(h.viewReg),
sql.WithSession(h.sess))
dbs := h.engine.Catalog.AllDatabases()
dbs := h.engine.Analyzer.Catalog.AllDatabases()
dsqlDBs := make([]dsql.Database, len(dbs))
for i, db := range dbs {
dsqlDB := db.(dsql.Database)