Skip to content

Commit

Permalink
Merge pull request #6318 from planetscale/ds-6.0-backport-6205
Browse files Browse the repository at this point in the history
backport #6205 to 6.0 release branch
  • Loading branch information
deepthi authored Jun 16, 2020
2 parents 5245945 + f645412 commit a5d3646
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go/vt/vtgate/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,11 @@ func (e *Executor) StreamExecute(ctx context.Context, method string, safeSession
return err
}

err = e.addNeededBindVars(plan.BindVarNeeds, bindVars, safeSession)
if err != nil {
return err
}

execStart := time.Now()
logStats.PlanTime = execStart.Sub(logStats.StartTime)

Expand Down
18 changes: 18 additions & 0 deletions go/vt/vtgate/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2312,3 +2312,21 @@ func TestGenerateCharsetRows(t *testing.T) {
})
}
}

func TestOlapSelectDatabase(t *testing.T) {
executor, _, _, _ := createExecutorEnv()
executor.normalize = true

session := &vtgatepb.Session{Autocommit: true}

sql := `select database()`
target := querypb.Target{}
cbInvoked := false
cb := func(r *sqltypes.Result) error {
cbInvoked = true
return nil
}
err := executor.StreamExecute(context.Background(), "TestExecute", NewSafeSession(session), sql, nil, target, cb)
assert.NoError(t, err)
assert.True(t, cbInvoked)
}

0 comments on commit a5d3646

Please sign in to comment.