Skip to content

Commit 2624613

Browse files
committed
sql: remove miscellaneous unused functions and objects
These were exported, so our unused linter didn't catch them. Release note: None
1 parent bc50ec9 commit 2624613

File tree

21 files changed

+4
-253
lines changed

21 files changed

+4
-253
lines changed

pkg/settings/registry.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ var retiredSettings = map[InternalKey]struct{}{
267267
"changefeed.new_pubsub_sink_enabled": {},
268268
"changefeed.new_pubsub_sink.enabled": {},
269269
"logical_replication.consumer.use_implicit_txns.enabled": {},
270+
271+
// removed as of 25.3
272+
"sql.metrics.max_stmt_fingerprints_per_explicit_txn": {},
270273
}
271274

272275
// grandfatheredDefaultSettings is the list of "grandfathered" existing sql.defaults

pkg/sql/catalog/post_deserialization_changes.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ const (
7979
// field was unset and that the MVCC timestamp value was assigned to it.
8080
SetModTimeToMVCCTimestamp
8181

82-
// SetCreateAsOfTimeUsingModTime indicates that a table's CreateAsOfTime field
83-
// was unset and the ModificationTime value was assigned to it.
84-
SetCreateAsOfTimeUsingModTime
85-
8682
// SetSystemDatabaseDescriptorVersion indicates that the system database
8783
// descriptor did not have its version set.
8884
SetSystemDatabaseDescriptorVersion

pkg/sql/catalog/systemschema/system.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,14 +1359,6 @@ const (
13591359
// in the hash sharded primary key in the sql stats tables, this value needs to
13601360
// be updated.
13611361
SQLStatsHashShardBucketCount = 8
1362-
1363-
// StmtStatsHashColumnName is the name of the hash column of
1364-
// system.statement_statistics.
1365-
StmtStatsHashColumnName = "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_plan_hash_transaction_fingerprint_id_shard_8"
1366-
1367-
// TxnStatsHashColumnName is the name of the hash column of
1368-
// system.transaction_statistics.
1369-
TxnStatsHashColumnName = "crdb_internal_aggregated_ts_app_name_fingerprint_id_node_id_shard_8"
13701362
)
13711363

13721364
// SystemDatabaseName is the name of the system database.

pkg/sql/catalog/table_elements.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,20 +1011,6 @@ func ColumnIDToOrdinalMap(columns []Column) TableColMap {
10111011
return m
10121012
}
10131013

1014-
// ColumnTypesWithInvertedCol returns the types of all given columns,
1015-
// If invertedCol is non-nil, substitutes the type of the inverted
1016-
// column instead of the column with the same ID.
1017-
func ColumnTypesWithInvertedCol(columns []Column, invertedCol Column) []*types.T {
1018-
t := make([]*types.T, len(columns))
1019-
for i, col := range columns {
1020-
t[i] = col.GetType()
1021-
if invertedCol != nil && col.GetID() == invertedCol.GetID() {
1022-
t[i] = invertedCol.GetType()
1023-
}
1024-
}
1025-
return t
1026-
}
1027-
10281014
// ColumnsByIDs returns a map of Columns keyed by their ID for the given table.
10291015
func ColumnsByIDs(tbl TableDescriptor) map[descpb.ColumnID]Column {
10301016
cols := tbl.AllColumns()

pkg/sql/catalog/tabledesc/index.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,6 @@ func (w index) IsEnforced() bool {
526526
return !w.IsMutation() || w.WriteAndDeleteOnly()
527527
}
528528

529-
// NewTestIndex wraps an index descriptor in an index struct for use in unit tests.
530-
func NewTestIndex(desc *descpb.IndexDescriptor, ordinal int) index {
531-
return index{desc: desc, ordinal: ordinal}
532-
}
533-
534529
// partitioning is the backing struct for a catalog.Partitioning interface.
535530
type partitioning struct {
536531
desc *catpb.PartitioningDescriptor

pkg/sql/colexec/colexecsel/selection_ops_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ import (
2525
"github.com/stretchr/testify/require"
2626
)
2727

28-
const (
29-
selectivity = .5
30-
nullProbability = .1
31-
)
32-
3328
func TestSelLTInt64Int64ConstOp(t *testing.T) {
3429
defer leaktest.AfterTest(t)()
3530
defer log.Scope(t).Close(t)
@@ -164,7 +159,7 @@ func runSelOpBenchmarks(
164159
batch := testAllocator.NewMemBatchWithMaxCapacity(inputTypes)
165160
nullProb := 0.0
166161
if hasNulls {
167-
nullProb = nullProbability
162+
nullProb = 0.1
168163
}
169164
for _, colVec := range batch.ColVecs() {
170165
coldatatestutils.RandomVec(coldatatestutils.RandomVecArgs{

pkg/sql/descriptor.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -245,19 +245,6 @@ func TranslateSurvivalGoal(g tree.SurvivalGoal) (descpb.SurvivalGoal, error) {
245245
}
246246
}
247247

248-
// TranslateProtoSurvivalGoal translate a descpb.SurvivalGoal into a
249-
// tree.SurvivalGoal.
250-
func TranslateProtoSurvivalGoal(g descpb.SurvivalGoal) (tree.SurvivalGoal, error) {
251-
switch g {
252-
case descpb.SurvivalGoal_ZONE_FAILURE:
253-
return tree.SurvivalGoalZoneFailure, nil
254-
case descpb.SurvivalGoal_REGION_FAILURE:
255-
return tree.SurvivalGoalRegionFailure, nil
256-
default:
257-
return 0, errors.Newf("unknown survival goal: %d", g)
258-
}
259-
}
260-
261248
// TranslateDataPlacement translates a tree.DataPlacement into a
262249
// descpb.DataPlacement.
263250
func TranslateDataPlacement(g tree.DataPlacement) (descpb.DataPlacement, error) {

pkg/sql/exprutil/type_check.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,6 @@ var (
6565
_ ToTypeCheck = TenantSpec{}
6666
)
6767

68-
// MakeStringArraysFromOptList makes a StringArrays by casting the members of in.
69-
func MakeStringArraysFromOptList(in []tree.StringOrPlaceholderOptList) StringArrays {
70-
ret := make([]tree.Exprs, len(in))
71-
for i, exprs := range in {
72-
ret[i] = tree.Exprs(exprs)
73-
}
74-
return ret
75-
}
76-
7768
func (s StringArrays) typeCheck(ctx context.Context, op string, semaCtx *tree.SemaContext) error {
7869
for _, exprs := range s {
7970
if err := Strings(exprs).typeCheck(ctx, op, semaCtx); err != nil {

pkg/sql/schemachanger/scplan/internal/rules/release_25_2/helpers.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ func isDescriptor(e scpb.Element) bool {
7474
return false
7575
}
7676

77-
// IsDescriptor returns true for a descriptor-element, i.e. an element which
78-
// owns its corresponding descriptor. This is only used for exports
79-
func IsDescriptor(e scpb.Element) bool {
80-
return isDescriptor(e)
81-
}
82-
8377
func isSubjectTo2VersionInvariant(e scpb.Element) bool {
8478
// TODO(ajwerner): This should include constraints and enum values but it
8579
// currently does not because we do not support dropping them unless we're

pkg/sql/sem/catconstants/namespace.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,4 @@ const (
1313
// NamespaceTablePrimaryIndexID is the id of the primary index of the
1414
// namespace table.
1515
NamespaceTablePrimaryIndexID = 1
16-
17-
// PreMigrationNamespaceTableName is the name that was used on the descriptor
18-
// of the current namespace table before the DeprecatedNamespaceTable was
19-
// migrated away.
20-
PreMigrationNamespaceTableName = "namespace2"
2116
)

0 commit comments

Comments
 (0)