diff --git a/pkg/sql/alter_database.go b/pkg/sql/alter_database.go index ae12b60a700d..a1a4ce18a3f1 100644 --- a/pkg/sql/alter_database.go +++ b/pkg/sql/alter_database.go @@ -561,7 +561,6 @@ func (p *planner) checkCanDropSystemDatabaseRegion(ctx context.Context, region t // - either be part of an admin role. // - or be an owner of the table. // - or have the CREATE privilege on the table. -// privilege on the table descriptor. // // For the system database, the conditions are more stringent. The user must // be the node user, and this must be a secondary tenant. diff --git a/pkg/sql/conn_executor_exec.go b/pkg/sql/conn_executor_exec.go index 2d9b4c730088..26e630db600a 100644 --- a/pkg/sql/conn_executor_exec.go +++ b/pkg/sql/conn_executor_exec.go @@ -1881,10 +1881,6 @@ func (ex *connExecutor) dispatchToExecutionEngine( panic(err) } - if !planner.ExecCfg().Codec.ForSystemTenant() { - planner.curPlan.flags.Set(planFlagTenant) - } - switch distributePlan { case physicalplan.FullyDistributedPlan: planner.curPlan.flags.Set(planFlagFullyDistributed) diff --git a/pkg/sql/plan.go b/pkg/sql/plan.go index 527700672449..aee32122fbb2 100644 --- a/pkg/sql/plan.go +++ b/pkg/sql/plan.go @@ -596,9 +596,6 @@ const ( // engine. planFlagVectorized - // planFlagTenant is set if the plan is executed on behalf of a tenant. - planFlagTenant - // planFlagContainsFullTableScan is set if the plan involves an unconstrained // scan on (the primary key of) a table. This could be an unconstrained scan // of any cardinality. diff --git a/pkg/sql/set_cluster_setting.go b/pkg/sql/set_cluster_setting.go index 25f8cab03d62..7847310f4ca2 100644 --- a/pkg/sql/set_cluster_setting.go +++ b/pkg/sql/set_cluster_setting.go @@ -334,7 +334,6 @@ func (n *setClusterSettingNode) startExec(params runParams) error { n.st, n.value, params.p.EvalContext(), - params.extendedEvalCtx.Codec.ForSystemTenant(), params.p.logEvent, params.p.descCollection.ReleaseLeases, params.p.makeUnsafeSettingInterlockInfo(), @@ -430,7 +429,6 @@ func writeSettingInternal( st *cluster.Settings, value tree.TypedExpr, evalCtx *eval.Context, - forSystemTenant bool, logFn func(context.Context, descpb.ID, logpb.EventPayload) error, releaseLeases func(context.Context), interlockInfo unsafeSettingInterlockInfo, @@ -451,10 +449,7 @@ func writeSettingInternal( return err } reportedValue, expectedEncodedValue, err = writeNonDefaultSettingValue( - ctx, hook, db, - setting, user, st, value, forSystemTenant, - releaseLeases, - interlockInfo, + ctx, hook, db, setting, user, st, value, releaseLeases, interlockInfo, ) if err != nil { return err @@ -505,7 +500,6 @@ func writeNonDefaultSettingValue( user username.SQLUsername, st *cluster.Settings, value tree.Datum, - forSystemTenant bool, releaseLeases func(context.Context), interlockInfo unsafeSettingInterlockInfo, ) (reportedValue string, expectedEncodedValue string, err error) { @@ -522,8 +516,7 @@ func writeNonDefaultSettingValue( verSetting, isSetVersion := setting.(*settings.VersionSetting) if isSetVersion { if err := setVersionSetting( - ctx, hook, verSetting, db, user, st, value, encoded, - forSystemTenant, releaseLeases, + ctx, hook, verSetting, db, user, st, value, encoded, releaseLeases, ); err != nil { return reportedValue, expectedEncodedValue, err } @@ -559,7 +552,6 @@ func setVersionSetting( st *cluster.Settings, value tree.Datum, encoded string, - forSystemTenant bool, releaseLeases func(context.Context), ) error { // In the special case of the 'version' cluster setting, @@ -579,23 +571,7 @@ func setVersionSetting( // hasn't run yet, we can't update the version as we don't // have good enough information about the current cluster // version. - if forSystemTenant { - return errors.New("no persisted cluster version found, please retry later") - } - // The tenant cluster in 20.2 did not ever initialize this value and - // utilized this hard-coded value instead. In 21.1, the builtin - // which creates tenants sets up the cluster version state. It also - // is set when the version is upgraded. - tenantDefaultVersion := clusterversion.ClusterVersion{ - Version: roachpb.Version{Major: 20, Minor: 2}, - } - // Pretend that the expected value was already there to allow us to - // run migrations. - prevEncoded, err := protoutil.Marshal(&tenantDefaultVersion) - if err != nil { - return errors.WithAssertionFailure(err) - } - prev = tree.NewDString(string(prevEncoded)) + return errors.New("no persisted cluster version found, please retry later") } else { prev = datums[0] }