// Equal returns true if the given option is equal to the instance one. In case
// the given option is nil, we checked the instance one is set to the default
// value of the option.
439510
func (o *SnippetEllipsisTextOption) Equal(o2 *SnippetEllipsisTextOption) bool {
	if o2 == nil {
		// We cannot generate this setting using `go generate` as the default
		// value can either be "…" or "". From the documentation:
		//   * Defaults to an empty string for all accounts created before
		//     February 10th, 2016.
		//   * Defaults to "…" (U+2026, HORIZONTAL ELLIPSIS) for accounts
		//     created after that date.
		return o.value == newDefaultSnippetEllipsisTextValue || o.value == oldDefaultSnippetEllipsisTextValue
	}
	return o.value == o2.value
}
370880
func (c *Constant) Equal(b Expression, ctx context.Context) bool {
	y, ok := b.(*Constant)
	if !ok {
		return false
	}
	con, err := c.Value.CompareDatum(ctx.GetSessionVars().StmtCtx, y.Value)
	if err != nil || con != 0 {
		return false
	}
	return true
}
225708
func Equal(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {

	if !ObjectsAreEqual(expected, actual) {
		diff := diff(expected, actual)
		return Fail(t, fmt.Sprintf("Not equal: %#v (expected)\n"+
			"        != %#v (actual)%s", expected, actual, diff), msgAndArgs...)
	}

	return true

}
124188
func (o *LengthOption) Equal(o2 *LengthOption) bool {
	if o2 == nil {
		return o.value == 0
	}
	return o.value == o2.value
}
1187760
func (o *MaxValuesPerFacetOption) Equal(o2 *MaxValuesPerFacetOption) bool {
	if o2 == nil {
		return o.value == 100
	}
	return o.value == o2.value
}
1363500
func (o *InsidePolygonOption) Equal(o2 *InsidePolygonOption) bool {
	if o2 == nil {
		return len(o.polygons) == 0 && len(o.coordinates) == 0
	}
	return reflect.DeepEqual(o, o2)
}
1128336
func Equal(l, r interface{}) bool {
	if l == nil || r == nil {
		return false
	}
	switch val := l.(type) {
	case *Error:
		return val.Equal(r)
	case error:
		return newError(val, 2).(*Error).Equal(r)
	default:
		panic("invalid type, must be *Error")
	}
}
461380
func (o *KeepDiacriticsOnCharactersOption) Equal(o2 *KeepDiacriticsOnCharactersOption) bool {
	if o2 == nil {
		return o.value == ""
	}
	return o.value == o2.value
}
457292
func (o *ClearExistingRulesOption) Equal(o2 *ClearExistingRulesOption) bool {
	if o2 == nil {
		return o.value == false
	}
	return o.value == o2.value
}
1036101
func (a *AggFuncDesc) Equal(ctx sessionctx.Context, other *AggFuncDesc) bool {
	if a.HasDistinct != other.HasDistinct {
		return false
	}
	return a.baseFuncDesc.equal(ctx, &other.baseFuncDesc)
}
716848
func (o *DistinctOption) Equal(o2 *DistinctOption) bool {
	if o2 == nil {
		return o.value == 0
	}
	return o.value == o2.value
}
115469
func (o *AttributeForDistinctOption) Equal(o2 *AttributeForDistinctOption) bool {
	if o2 == nil {
		return o.value == ""
	}
	return o.value == o2.value
}
787738
func (o *SafeOption) Equal(o2 *SafeOption) bool {
	if o2 == nil {
		return o.value == false
	}
	return o.value == o2.value
}
733976
func (str String) Equal(other Value) bool {
	switch other := other.(type) {
	case String:
		return str == other
	default:
		return false
	}
}
1200846
func (o *IgnorePluralsOption) Equal(o2 *IgnorePluralsOption) bool {
	if o2 == nil {
		return !o.ignorePlurals && len(o.languages) == 0
	}
	return reflect.DeepEqual(o, o2)
}
1148363
func (e *Error) Equal(ie interface{}) bool {
	if ie == nil || e == nil || e.err == nil {
		return false
	}
	switch val := ie.(type) {
	case *Error:
		if val == nil {
			return false
		}
		if val.err == nil {
			return false
		}
		return e.err.Error() == val.String()
	case error:
		if val == nil {
			return false
		}
		return e.err.Error() == val.Error()
	case string:
		return e.err.Error() == val
	default:
		panic("invalid type")
	}
}
961502
func (o *ReplaceSynonymsInHighlightOption) Equal(o2 *ReplaceSynonymsInHighlightOption) bool {
	if o2 == nil {
		return o.value == true
	}
	return o.value == o2.value
}