From 6092c7b3b9de10302a9020f14bf85034ea250fe6 Mon Sep 17 00:00:00 2001 From: xiongjiwei Date: Tue, 3 Jan 2023 16:36:46 +0800 Subject: [PATCH] fix test Signed-off-by: xiongjiwei --- executor/distsql.go | 2 +- table/tables/mutation_checker.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/executor/distsql.go b/executor/distsql.go index e0911023dde63..3b9a6a7d4b288 100644 --- a/executor/distsql.go +++ b/executor/distsql.go @@ -1257,7 +1257,7 @@ func (w *tableWorker) compareData(ctx context.Context, task *lookupTableTask, ta col := w.idxTblCols[i] idxVal := idxRow.GetDatum(i, w.idxColTps[i]) tablecodec.TruncateIndexValue(&idxVal, w.idxLookup.index.Columns[i], col.ColumnInfo) - cmpRes, err := tables.CompareIndexAndVal(sctx, vals[i], idxVal, collators[i], col.FieldType.IsArray()) + cmpRes, err := tables.CompareIndexAndVal(sctx, vals[i], idxVal, collators[i], col.FieldType.IsArray() && vals[i].Kind() == types.KindMysqlJSON) if err != nil { return ir().ReportAdminCheckInconsistentWithColInfo(ctx, handle, diff --git a/table/tables/mutation_checker.go b/table/tables/mutation_checker.go index e4abd4b291b6e..328989d88ad3f 100644 --- a/table/tables/mutation_checker.go +++ b/table/tables/mutation_checker.go @@ -347,7 +347,9 @@ func compareIndexData( cols[indexInfo.Columns[i].Offset].ColumnInfo, ) - comparison, err := CompareIndexAndVal(sc, expectedDatum, decodedMutationDatum, collate.GetCollator(decodedMutationDatum.Collation()), cols[indexInfo.Columns[i].Offset].ColumnInfo.FieldType.IsArray()) + comparison, err := CompareIndexAndVal(sc, expectedDatum, decodedMutationDatum, + collate.GetCollator(decodedMutationDatum.Collation()), + cols[indexInfo.Columns[i].Offset].ColumnInfo.FieldType.IsArray() && expectedDatum.Kind() == types.KindMysqlJSON) if err != nil { return errors.Trace(err) }