Skip to content

Commit

Permalink
clusterversion: remove ExpressionIndexes
Browse files Browse the repository at this point in the history
Release note: none.
  • Loading branch information
dt committed Dec 29, 2021
1 parent ba66afa commit 2bb519e
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 63 deletions.
6 changes: 0 additions & 6 deletions pkg/clusterversion/cockroach_versions.go
Expand Up @@ -172,8 +172,6 @@ const (
//
// Start21_2 demarcates work towards CockroachDB v21.2.
Start21_2
// ExpressionIndexes is when expression indexes are supported.
ExpressionIndexes
// DeleteDeprecatedNamespaceTableDescriptorMigration deletes the descriptor at ID=2.
DeleteDeprecatedNamespaceTableDescriptorMigration
// FixDescriptors is for the migration to fix all descriptors.
Expand Down Expand Up @@ -359,10 +357,6 @@ var versionsSingleton = keyedVersions{
Key: Start21_2,
Version: roachpb.Version{Major: 21, Minor: 1, Internal: 1102},
},
{
Key: ExpressionIndexes,
Version: roachpb.Version{Major: 21, Minor: 1, Internal: 1110},
},
{
Key: DeleteDeprecatedNamespaceTableDescriptorMigration,
Version: roachpb.Version{Major: 21, Minor: 1, Internal: 1112},
Expand Down
87 changes: 43 additions & 44 deletions pkg/clusterversion/key_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions pkg/sql/create_index.go
Expand Up @@ -358,12 +358,6 @@ func replaceExpressionElemsWithVirtualCols(
for i := range elems {
elem := &elems[i]
if elem.Expr != nil {
if !evalCtx.Settings.Version.IsActive(ctx, clusterversion.ExpressionIndexes) {
return pgerror.Newf(pgcode.FeatureNotSupported,
"version %v must be finalized to use expression indexes",
clusterversion.ExpressionIndexes)
}

// Create a dummy ColumnTableDef to use for validating the
// expression. The type is Any because it is unknown until
// validation is performed.
Expand Down
Expand Up @@ -110,7 +110,6 @@ go_library(
importpath = "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt",
visibility = ["//pkg/sql/schemachanger/scbuild:__subpackages__"],
deps = [
"//pkg/clusterversion",
"//pkg/keys",
"//pkg/settings/cluster",
"//pkg/sql/catalog",
Expand Down
Expand Up @@ -11,7 +11,6 @@
package scbuildstmt

import (
"github.com/cockroachdb/cockroach/pkg/clusterversion"
"github.com/cockroachdb/cockroach/pkg/sql/catalog"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr"
Expand Down Expand Up @@ -112,11 +111,6 @@ func CreateIndex(b BuildCtx, n *tree.CreateIndex) {
panic(scerrors.NotImplementedErrorf(n, "column was added in the current transaction"))
}
if columnNode.Expr != nil {
if !b.ClusterSettings().Version.IsActive(b, clusterversion.ExpressionIndexes) {
panic(pgerror.Newf(pgcode.FeatureNotSupported,
"version %v must be finalized to use expression indexes",
clusterversion.ExpressionIndexes))
}
// TODO(fqazi): We need to deal with columns added in the same
// transaction here as well.
_, typ, _, err := schemaexpr.DequalifyAndValidateExpr(
Expand Down

0 comments on commit 2bb519e

Please sign in to comment.