// Equal reports whether t and u are equal based on time.Equal
515474
func (t Timestamp) Equal(u Timestamp) bool {
	return t.Time.Equal(u.Time)
}
918823
func (s *OutputState) Equal(other *OutputState) bool {
	if s == nil && other == nil {
		return true
	}

	if s == nil || other == nil {
		return false
	}
	s.Lock()
	defer s.Unlock()

	if s.Type != other.Type {
		return false
	}

	if s.Sensitive != other.Sensitive {
		return false
	}

	if !reflect.DeepEqual(s.Value, other.Value) {
		return false
	}

	return true
}
52690
func (o *QueryOption) Equal(o2 *QueryOption) bool {
	if o2 == nil {
		return o.value == ""
	}
	return o.value == o2.value
}
491818
func (d *PortRuleDNS) Equal(o PortRuleDNS) bool {
	return d != nil && d.MatchName == o.MatchName && d.MatchPattern == o.MatchPattern
}
1291636
func (o *SynonymsOption) Equal(o2 *SynonymsOption) bool {
	if o2 == nil {
		return o.value == true
	}
	return o.value == o2.value
}
590886
func (t Time) Compare(o Time) int {
	return compareTime(t.Time, o.Time)
}
517848
func (c *Constant) Equal(ctx sessionctx.Context, b Expression) bool {
	y, ok := b.(*Constant)
	if !ok {
		return false
	}
	_, err1 := y.Eval(chunk.Row{})
	_, err2 := c.Eval(chunk.Row{})
	if err1 != nil || err2 != nil {
		return false
	}
	con, err := c.Value.CompareDatum(ctx.GetSessionVars().StmtCtx, &y.Value)
	if err != nil || con != 0 {
		return false
	}
	return true
}
1258726
func (k Key) Equal(k2 Key) bool {
	k.CreatedAt, k2.CreatedAt = time.Time{}, time.Time{}
	k.Validity, k2.Validity = 0, 0
	return reflect.DeepEqual(k, k2)
}
1093983
func (o *OffsetOption) Equal(o2 *OffsetOption) bool {
	if o2 == nil {
		return o.value == 0
	}
	return o.value == o2.value
}
1284348
func (o *TagFiltersOption) Equal(o2 *TagFiltersOption) bool {
	return o.comp.Equal(&o2.comp)
}
489394
func (o *PrimaryOption) Equal(o2 *PrimaryOption) bool {
	if o2 == nil {
		return o.value == ""
	}
	return o.value == o2.value
}
126251
func TimeEqual(a, b time.Time) bool {
	if runtime.GOOS == "darwin" {
		a = a.Truncate(1 * time.Second)
		b = b.Truncate(1 * time.Second)
	}
	return a.Equal(b)
}
537730
func (d *Duration) Equal(value time.Duration) *Duration {
	if d.value == nil {
		d.chain.fail("expected duration is set, but it is not")
		return d
	}
	if !(*d.value == value) {
		d.chain.fail("\nexpected duration equal to:\n %s\n\nbut got:\n %s",
			value, *d.value)
	}
	return d
}
604508
func (o *UserTokenOption) Equal(o2 *UserTokenOption) bool {
	if o2 == nil {
		return o.value == ""
	}
	return o.value == o2.value
}
1255767
func (t SimpleType) Equal(u convert.Equaler) bool {
	other, ok := u.(SimpleType)
	if !ok {
		return false
	}
	if t.DefaultValue != other.DefaultValue {
		return false
	}
	return t.Kind == other.Kind
}
1159114
func Equal(l, r Value) (bool, error) {

	if l == nil && r == nil {
		return true, nil
	}

	if r == nil {
		switch l.(type) {
		case NilValue:
			return true, nil
		}
		return false, nil
	}
	if _, isNil := r.(NilValue); isNil {
		switch l.(type) {
		case nil:
			return true, nil
		case NilValue:
			return true, nil
		}
		return false, nil
	}

	switch lt := l.(type) {
	case nil, NilValue:
		return false, nil
	case StringValue:
		if lt.Val() == r.ToString() {
			return true, nil
		}
		return false, nil
	case IntValue:
		rhv, _ := ValueToInt64(r)
		return lt.Val() == rhv, nil
	case NumberValue:
		rhv, _ := ValueToFloat64(r)
		return lt.Val() == rhv, nil
	case BoolValue:
		rhv, _ := ValueToBool(r)
		return lt.Val() == rhv, nil
	case TimeValue:
		rhv, _ := ValueToTime(r)
		return lt.Val() == rhv, nil
	case Slice:
		if rhv, ok := r.(Slice); ok {
			if lt.Len() != rhv.Len() {
				return false, nil
			}
			rhslice := rhv.SliceValue()
			for i, lhval := range lt.SliceValue() {
				if eq, err := Equal(lhval, rhslice[i]); !eq || err != nil {
					return false, nil
				}
			}
			return true, nil
		}
	}
	return false, fmt.Errorf("Could not evaluate equals for %v = %v", l.Value(), r.Value())
}
1201775
func (t proofTerm) equal(u proofTerm) bool {
	return t.seqno() == u.seqno()
}