Skip to content

Commit

Permalink
Merge pull request #23670 from RaduBerinde/exec-db
Browse files Browse the repository at this point in the history
opt: set up database for execbuilder tests
  • Loading branch information
RaduBerinde authored Mar 9, 2018
2 parents bf57343 + 89f15bb commit 747d488
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 146 deletions.
9 changes: 7 additions & 2 deletions pkg/sql/opt/exec/execbuilder/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ func TestBuild(t *testing.T) {
s, sqlDB, _ := serverutils.StartServer(t, base.TestServerArgs{})
defer s.Stopper().Stop(ctx)

_, err := sqlDB.Exec("CREATE DATABASE test; SET DATABASE = test;")
if err != nil {
t.Fatal(err)
}

datadriven.RunTest(t, path, func(d *datadriven.TestData) string {
var allowUnsupportedExpr, rowSort bool

Expand Down Expand Up @@ -144,7 +149,7 @@ func TestBuild(t *testing.T) {
d.Fatalf(t, "%v", err)
}

eng := s.Executor().(exec.TestEngineFactory).NewTestEngine()
eng := s.Executor().(exec.TestEngineFactory).NewTestEngine("test")
defer eng.Close()

// Build and optimize the opt expression tree.
Expand Down Expand Up @@ -237,7 +242,7 @@ func TestBuild(t *testing.T) {

case "catalog":
// Create the engine in order to get access to its catalog.
eng := s.Executor().(exec.TestEngineFactory).NewTestEngine()
eng := s.Executor().(exec.TestEngineFactory).NewTestEngine("test")
defer eng.Close()

parts := strings.Split(d.Input, ".")
Expand Down
Loading

0 comments on commit 747d488

Please sign in to comment.