@@ -41,6 +41,7 @@ import (
41
41
"github.com/pingcap/tidb/pkg/util/logutil"
42
42
"github.com/pingcap/tidb/pkg/util/logutil/consistency"
43
43
"github.com/pingcap/tidb/pkg/util/mock"
44
+ "github.com/pingcap/tidb/pkg/util/redact"
44
45
"github.com/stretchr/testify/require"
45
46
"go.uber.org/zap"
46
47
)
@@ -1055,6 +1056,8 @@ func TestCheckFailReport(t *testing.T) {
1055
1056
store := testkit .CreateMockStore (t )
1056
1057
tk := newInconsistencyKit (t , testkit .NewAsyncTestKit (t , store ), newDefaultOpt ())
1057
1058
1059
+ rmode := tk .sctx .GetSessionVars ().EnableRedactNew
1060
+
1058
1061
// row more than unique index
1059
1062
func () {
1060
1063
defer tk .rebuild ()
@@ -1072,7 +1075,7 @@ func TestCheckFailReport(t *testing.T) {
1072
1075
hook .Logs [0 ].CheckField (t ,
1073
1076
zap .String ("table_name" , "admin_test" ),
1074
1077
zap .String ("index_name" , "uk1" ),
1075
- zap .Stringer ("row_id" , kv .IntHandle (1 )),
1078
+ zap .Stringer ("row_id" , redact . Stringer ( rmode , kv .IntHandle (1 ) )),
1076
1079
)
1077
1080
hook .Logs [0 ].CheckFieldNotEmpty (t , "row_mvcc" )
1078
1081
}()
@@ -1094,7 +1097,7 @@ func TestCheckFailReport(t *testing.T) {
1094
1097
hook .Logs [0 ].CheckField (t ,
1095
1098
zap .String ("table_name" , "admin_test" ),
1096
1099
zap .String ("index_name" , "k2" ),
1097
- zap .Stringer ("row_id" , kv .IntHandle (1 )),
1100
+ zap .Stringer ("row_id" , redact . Stringer ( rmode , kv .IntHandle (1 ) )),
1098
1101
)
1099
1102
hook .Logs [0 ].CheckFieldNotEmpty (t , "row_mvcc" )
1100
1103
}()
@@ -1118,7 +1121,7 @@ func TestCheckFailReport(t *testing.T) {
1118
1121
logEntry .CheckField (t ,
1119
1122
zap .String ("table_name" , "admin_test" ),
1120
1123
zap .String ("index_name" , "k2" ),
1121
- zap .Stringer ("row_id" , kv .IntHandle (1 )),
1124
+ zap .Stringer ("row_id" , redact . Stringer ( rmode , kv .IntHandle (1 ) )),
1122
1125
)
1123
1126
logEntry .CheckFieldNotEmpty (t , "row_mvcc" )
1124
1127
logEntry .CheckFieldNotEmpty (t , "index_mvcc" )
@@ -1162,7 +1165,7 @@ func TestCheckFailReport(t *testing.T) {
1162
1165
logEntry .CheckField (t ,
1163
1166
zap .String ("table_name" , "admin_test" ),
1164
1167
zap .String ("index_name" , "uk1" ),
1165
- zap .Stringer ("row_id" , kv .IntHandle (1 )),
1168
+ zap .Stringer ("row_id" , redact . Stringer ( rmode , kv .IntHandle (1 ) )),
1166
1169
)
1167
1170
logEntry .CheckFieldNotEmpty (t , "row_mvcc" )
1168
1171
logEntry .CheckFieldNotEmpty (t , "index_mvcc" )
@@ -1205,7 +1208,7 @@ func TestCheckFailReport(t *testing.T) {
1205
1208
logEntry .CheckField (t ,
1206
1209
zap .String ("table_name" , "admin_test" ),
1207
1210
zap .String ("index_name" , "uk1" ),
1208
- zap .Stringer ("row_id" , kv .IntHandle (1 )),
1211
+ zap .Stringer ("row_id" , redact . Stringer ( rmode , kv .IntHandle (1 ) )),
1209
1212
)
1210
1213
logEntry .CheckFieldNotEmpty (t , "row_mvcc" )
1211
1214
logEntry .CheckFieldNotEmpty (t , "index_mvcc" )
@@ -1231,7 +1234,7 @@ func TestCheckFailReport(t *testing.T) {
1231
1234
logEntry .CheckField (t ,
1232
1235
zap .String ("table_name" , "admin_test" ),
1233
1236
zap .String ("index_name" , "k2" ),
1234
- zap .Stringer ("row_id" , kv .IntHandle (1 )),
1237
+ zap .Stringer ("row_id" , redact . Stringer ( rmode , kv .IntHandle (1 ) )),
1235
1238
)
1236
1239
logEntry .CheckFieldNotEmpty (t , "row_mvcc" )
1237
1240
logEntry .CheckFieldNotEmpty (t , "index_mvcc" )
@@ -1271,7 +1274,7 @@ func TestCheckFailReport(t *testing.T) {
1271
1274
logEntry .CheckField (t ,
1272
1275
zap .String ("table_name" , "admin_test" ),
1273
1276
zap .String ("index_name" , "uk1" ),
1274
- zap .Stringer ("row_id" , kv .IntHandle (282574488403969 )),
1277
+ zap .Stringer ("row_id" , redact . Stringer ( rmode , kv .IntHandle (282574488403969 ) )),
1275
1278
)
1276
1279
logEntry .CheckFieldNotEmpty (t , "row_mvcc" )
1277
1280
logEntry .CheckFieldNotEmpty (t , "index_mvcc" )
0 commit comments