@@ -10,7 +10,6 @@ import (
1010 "testing"
1111
1212 "github.com/cockroachdb/cockroach/pkg/base"
13- "github.com/cockroachdb/cockroach/pkg/keys"
1413 "github.com/cockroachdb/cockroach/pkg/sql/catalog"
1514 "github.com/cockroachdb/cockroach/pkg/sql/catalog/desctestutils"
1615 "github.com/cockroachdb/cockroach/pkg/sql/rowenc"
@@ -28,10 +27,10 @@ import (
2827func TestValidateUniqueConstraints (t * testing.T ) {
2928 defer leaktest .AfterTest (t )()
3029 defer log .Scope (t ).Close (t )
31- // This test fails when run within a tenant. More investigation is
32- // required. Tracked with #76378.
33- s , db , kvDB := serverutils . StartServer ( t , base. TestServerArgs { DefaultTestTenant : base . TODOTestTenantDisabled } )
34- defer s . Stopper (). Stop ( context . Background () )
30+
31+ srv , db , kvDB := serverutils . StartServer ( t , base. TestServerArgs {})
32+ defer srv . Stopper (). Stop ( context . Background () )
33+ s := srv . ApplicationLayer ( )
3534 r := sqlutils .MakeSQLRunner (db )
3635
3736 // Create two tables and a view.
@@ -57,7 +56,7 @@ CREATE TABLE u (
5756 insertValuesT := func (values []tree.Datum ) {
5857 // Get the table descriptor and primary index of t.
5958 tableDesc := desctestutils .TestingGetTableDescriptor (
60- kvDB , keys . SystemSQLCodec , "test" , "public" , "t" ,
59+ kvDB , s . Codec () , "test" , "public" , "t" ,
6160 )
6261 primaryIndex := tableDesc .GetPrimaryIndex ()
6362
@@ -67,7 +66,7 @@ CREATE TABLE u (
6766
6867 // Construct the primary index entry to insert.
6968 primaryIndexEntry , err := rowenc .EncodePrimaryIndex (
70- keys . SystemSQLCodec , tableDesc , primaryIndex , colIDtoRowIndex , values , true , /* includeEmpty */
69+ s . Codec () , tableDesc , primaryIndex , colIDtoRowIndex , values , true , /* includeEmpty */
7170 )
7271 require .NoError (t , err )
7372 require .Equal (t , 1 , len (primaryIndexEntry ))
@@ -82,7 +81,7 @@ CREATE TABLE u (
8281 insertValuesU := func (values []tree.Datum ) {
8382 // Get the table descriptor and indexes of u.
8483 tableDesc := desctestutils .TestingGetTableDescriptor (
85- kvDB , keys . SystemSQLCodec , "test" , "public" , "u" ,
84+ kvDB , s . Codec () , "test" , "public" , "u" ,
8685 )
8786 primaryIndex := tableDesc .GetPrimaryIndex ()
8887 secondaryIndex := tableDesc .PublicNonPrimaryIndexes ()[0 ]
@@ -94,12 +93,12 @@ CREATE TABLE u (
9493
9594 // Construct the primary and secondary index entries to insert.
9695 primaryIndexEntry , err := rowenc .EncodePrimaryIndex (
97- keys . SystemSQLCodec , tableDesc , primaryIndex , colIDtoRowIndex , values , true , /* includeEmpty */
96+ s . Codec () , tableDesc , primaryIndex , colIDtoRowIndex , values , true , /* includeEmpty */
9897 )
9998 require .NoError (t , err )
10099 require .Equal (t , 1 , len (primaryIndexEntry ))
101100 secondaryIndexEntry , err := rowenc .EncodeSecondaryIndex (
102- context .Background (), keys . SystemSQLCodec , tableDesc , secondaryIndex ,
101+ context .Background (), s . Codec () , tableDesc , secondaryIndex ,
103102 colIDtoRowIndex , values , rowenc .EmptyVectorIndexEncodingHelper , true , /* includeEmpty */
104103 )
105104 require .NoError (t , err )
0 commit comments