// DateEqual returns true if i equals j.
541564
func DateEqual(i *google_type.Date, j *google_type.Date) bool {
	return ((i == nil) == (j == nil)) && ((i == nil) || (*i == *j))
}
593625
func areEqual(a, b interface{}) bool {
	if isNil(a) || isNil(b) {
		if isNil(a) && !isNil(b) {
			return false
		}
		if !isNil(a) && isNil(b) {
			return false
		}
		return true
	}
	if reflect.DeepEqual(a, b) {
		return true
	}
	aValue := reflect.ValueOf(a)
	bValue := reflect.ValueOf(b)
	return aValue == bValue
}
944717
func FacetsEqual(o1, o2 *FacetsOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
165153
func Equal(val1 interface{}, val2 interface{}) bool {
	if val1 == nil || val2 == nil {
		return false
	}
	switch v1 := val1.(type) {
	case UUID:
		if v2, ok := val2.(UUID); ok {
			return v1.Equal(v2)
		}
		return false
	case Timestamp:
		if v2, ok := val2.(Timestamp); ok {
			return v1.Equal(v2)
		}
		return false
	case Array:
		if v2, ok := val2.(Array); ok {
			return v1.Equal(v2)
		}
		return false
	case Struct:
		if v2, ok := val2.(Struct); ok {
			return v1.Equal(v2)
		}
		return false
	case Symbol:
		if v2, ok := val2.(Symbol); ok {
			return v1 == v2
		}
		return false
	case int, int32, int8, int16, int64, float32, float64, uint, uint8, uint16, uint32, uint64:
		return val1 == val2
	case bool:
		return val1 == val2
	case string:
		if v2, ok := val2.(string); ok {
			return v1 == v2
		}
		return false
	case []byte:
		if v2, ok := val2.([]byte); ok {
			return bytes.Compare(v1, v2) == 0
		}
		return false
	default:
		fmt.Println(val1)
		fmt.Println(val2)
		fmt.Println("fix Equal of these two types")
		panic("fix Equal of these two types")
	}
}
1280175
func keysEqual(a, b []string) bool {
	if len(a) != len(b) {
		return false
	}
	a = a[:]
	b = b[:]
	sort.Strings(a)
	sort.Strings(b)
	for i := range a {
		if a[i] != b[i] {
			return false
		}
	}
	return true
}
1016190
func (col *Column) Equal(_ sessionctx.Context, expr Expression) bool {
	if newCol, ok := expr.(*Column); ok {
		return newCol.UniqueID == col.UniqueID
	}
	return false
}
1234671
func (m *MenuEntry) IsEqual(inme *MenuEntry) bool {
	return m.hopefullyUniqueID() == inme.hopefullyUniqueID() && m.Parent == inme.Parent
}
839269
func (ts Timestamp) Equal(ts2 Timestamp) bool {
	return ts.Millis() == ts2.Millis()
}
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
}
786753
func StringEqual(t testing.TB, name string, act, exp interface{}) bool {
	actV, expV := reflect.ValueOf(act), reflect.ValueOf(exp)
	if actV.Kind() == reflect.Slice && expV.Kind() == reflect.Slice {
		return linesEqual(1, t, name, actV, expV)
	}
	actS, expS := fmt.Sprintf("%+v", act), fmt.Sprintf("%+v", exp)
	if actS == expS {
		return true
	}
	if strings.ContainsRune(actS, '\n') || strings.ContainsRune(expS, '\n') {
		return linesEqual(1, t, name,
			reflect.ValueOf(strings.Split(actS, "\n")),
			reflect.ValueOf(strings.Split(expS, "\n")))
	}
	msg := fmt.Sprintf("%s%s is expected to be %q, but got %q", assertPos(0), name,
		fmt.Sprint(exp), fmt.Sprint(act))
	if len(msg) >= 80 {
		msg = fmt.Sprintf("%s%s is expected to be\n  %q\nbut got\n  %q", assertPos(0), name,
			fmt.Sprint(exp), fmt.Sprint(act))
	}
	t.Error(msg)
	return false
}
232028
func (self StringEqualer) Equal(e Equaler) bool {
	return self.S == e.(StringEqualer).S
}
56093
func (h *Holiday) matches(date time.Time) bool {

	if h.Func != nil && (date.Year() != h.lastYear || date.Location() != h.lastLoc) {
		h.Month, h.Day = h.Func(date.Year(), date.Location())
		h.lastYear = date.Year()
		h.lastLoc = date.Location()
	}

	if h.Month > 0 {
		if date.Month() != h.Month {
			return false
		}
		if h.Year > 0 && date.Year() != h.Year {
			return false
		}
		if h.Day > 0 {
			return date.Day() == h.Day
		}
		if h.Weekday > 0 && h.Offset != 0 {
			return IsWeekdayN(date, h.Weekday, h.Offset)
		}
	} else if h.Offset > 0 {
		return date.YearDay() == h.Offset
	}
	return false
}
954975
func (od Date) Equal(o Date) bool {
	return od.Time.Equal(o.Time)
}
295245
func generateEqual(this, that *MyStruct) bool {
	return (this == nil && that == nil) ||
		this != nil && that != nil &&
			this.Int64 == that.Int64 &&
			((this.StringPtr == nil && that.StringPtr == nil) || (this.StringPtr != nil && that.StringPtr != nil && *(this.StringPtr) == *(that.StringPtr)))
}
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)
}
1158742
func (v ByteView) Equal(b2 ByteView) bool {
	if b2.b == nil {
		return v.EqualString(b2.s)
	}
	return v.EqualBytes(b2.b)
}
515474
func (t Timestamp) Equal(u Timestamp) bool {
	return t.Time.Equal(u.Time)
}