Skip to content

Commit

Permalink
sql: keep experimental_enable_hash_sharded_indexes var as noop
Browse files Browse the repository at this point in the history
Release justification: needed for session var backward compatibility.
Release note (sql change): experimental_enable_hash_sharded_indexes
used to be set to enable the hash sharded index feature. since we now
enable the feature by default, user don't need to set this var anymore.
But still keeping it as noop for backward compatibility.
  • Loading branch information
chengxiong-ruan committed Mar 17, 2022
1 parent 87a3366 commit 7c51bdc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/hash_sharded_index
Original file line number Diff line number Diff line change
Expand Up @@ -1019,3 +1019,8 @@ SELECT * FROM t ORDER BY x
x duped
1 true
2 true

# NOTE: Please keep this statement at the end this file.
# This session variable has noop and is just kept for backward compatibility.
statement ok
set experimental_enable_hash_sharded_indexes = on
1 change: 1 addition & 0 deletions pkg/sql/logictest/testdata/logic_test/information_schema
Original file line number Diff line number Diff line change
Expand Up @@ -4715,6 +4715,7 @@ enable_zigzag_join on
escape_string_warning on
experimental_computed_column_rewrites ·
experimental_enable_auto_rehoming off
experimental_enable_hash_sharded_indexes on
experimental_enable_implicit_column_partitioning off
experimental_enable_temp_tables off
experimental_enable_unique_without_index_constraints on
Expand Down
17 changes: 17 additions & 0 deletions pkg/sql/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,23 @@ var varGen = map[string]sessionVar{
},
},

// CockroachDB extension.
// This is only kept for backwards compatibility and no longer has any effect.
`experimental_enable_hash_sharded_indexes`: {
Hidden: true,
GetStringVal: makePostgresBoolGetStringValFn(`experimental_enable_hash_sharded_indexes`),
Set: func(_ context.Context, m sessionDataMutator, s string) error {
_, err := paramparse.ParseBoolVar("experimental_enable_hash_sharded_indexes", s)
return err
},
Get: func(evalCtx *extendedEvalContext) (string, error) {
return formatBoolAsPostgresSetting(true), nil
},
GlobalDefault: func(sv *settings.Values) string {
return formatBoolAsPostgresSetting(true)
},
},

// CockroachDB extension.
`disallow_full_table_scans`: {
GetStringVal: makePostgresBoolGetStringValFn(`disallow_full_table_scans`),
Expand Down

0 comments on commit 7c51bdc

Please sign in to comment.