code: func CompareIndexData(sessCtx sessionctx.Context, txn kv.Transaction, t table.Table, idx table.Index, genExprs map[model.TableColumnID]expression.Expression) error {
  	err := checkIndexAndRecord(sessCtx, txn, t, idx, genExprs)
  	if err != nil {
  		return errors.Trace(err)
  	}
  
  	return CheckRecordAndIndex(sessCtx, txn, t, idx, genExprs)
  }
docs: // CompareIndexData compares index data one by one.
  // It returns nil if the data from the index is equal to the data from the table columns,
  // otherwise it returns an error with a different set of records.
  // genExprs is use to calculate the virtual generate column.