Skip to content

Commit

Permalink
sql: add a TODO for sql-queries to investigate a test
Browse files Browse the repository at this point in the history
After changing the sessiondata to stop using zero-value defaults, a test
started failing. It works when using a zero sessiondata, which deserves
more investigation.

Release note: None
  • Loading branch information
rafiss committed Apr 28, 2023
1 parent 7db67d6 commit 546419f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/sql/distsql_running_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql/parser"
"github.com/cockroachdb/cockroach/pkg/sql/rowenc"
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
"github.com/cockroachdb/cockroach/pkg/sql/sessiondata"
"github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/pgtest"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
Expand Down Expand Up @@ -252,7 +254,14 @@ func TestDistSQLRunningParallelFKChecksAfterAbort(t *testing.T) {

createPlannerAndRunQuery := func(ctx context.Context, txn *kv.Txn, query string) error {
execCfg := s.ExecutorConfig().(ExecutorConfig)
sd := NewInternalSessionData(ctx, execCfg.Settings, "test")
// TODO(sql-queries): This sessiondata contains zero-values for most fields,
// meaning DistSQLMode is DistSQLOff. Is this correct?
sd := &sessiondata.SessionData{
SessionData: sessiondatapb.SessionData{},
SearchPath: sessiondata.DefaultSearchPathForUser(username.RootUserName()),
SequenceState: sessiondata.NewSequenceState(),
Location: time.UTC,
}
// Plan the statement.
internalPlanner, cleanup := NewInternalPlanner(
"test",
Expand Down

0 comments on commit 546419f

Please sign in to comment.