From a645cba390d008f2f9fd768b1e7789e70e262e2e Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Tue, 13 Jun 2023 15:30:43 -0700 Subject: [PATCH] server: use server's codec instead of TestingSQLCodec in some tests Epic: None Release note: None --- pkg/server/BUILD.bazel | 1 - pkg/server/decommission_test.go | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/server/BUILD.bazel b/pkg/server/BUILD.bazel index 882b99a4c6b1..f75c50a82230 100644 --- a/pkg/server/BUILD.bazel +++ b/pkg/server/BUILD.bazel @@ -521,7 +521,6 @@ go_test( "//pkg/testutils", "//pkg/testutils/datapathutils", "//pkg/testutils/diagutils", - "//pkg/testutils/keysutils", "//pkg/testutils/serverutils", "//pkg/testutils/skip", "//pkg/testutils/sqlutils", diff --git a/pkg/server/decommission_test.go b/pkg/server/decommission_test.go index 2d39fd7101bd..c4bc293a58ee 100644 --- a/pkg/server/decommission_test.go +++ b/pkg/server/decommission_test.go @@ -21,7 +21,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/security/username" "github.com/cockroachdb/cockroach/pkg/testutils" - "github.com/cockroachdb/cockroach/pkg/testutils/keysutils" "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/cockroachdb/cockroach/pkg/util/leaktest" @@ -129,8 +128,8 @@ func TestDecommissionPreCheckEvaluation(t *testing.T) { require.NoError(t, err) tblBID, err := firstSvr.admin.queryTableID(ctx, username.RootUserName(), "test", "tblB") require.NoError(t, err) - startKeyTblA := keysutils.TestingSQLCodec.TablePrefix(uint32(tblAID)) - startKeyTblB := keysutils.TestingSQLCodec.TablePrefix(uint32(tblBID)) + startKeyTblA := firstSvr.Codec().TablePrefix(uint32(tblAID)) + startKeyTblB := firstSvr.Codec().TablePrefix(uint32(tblBID)) // Split off ranges for tblA and tblB. _, rDescA, err := firstSvr.SplitRange(startKeyTblA) @@ -234,7 +233,7 @@ func TestDecommissionPreCheckOddToEven(t *testing.T) { runQueries(alterQueries...) tblAID, err := firstSvr.admin.queryTableID(ctx, username.RootUserName(), "test", "tblA") require.NoError(t, err) - startKeyTblA := keysutils.TestingSQLCodec.TablePrefix(uint32(tblAID)) + startKeyTblA := firstSvr.Codec().TablePrefix(uint32(tblAID)) // Split off range for tblA. _, rDescA, err := firstSvr.SplitRange(startKeyTblA)