// IntervalEq calls the stored procedure 'pg_catalog.interval_eq(interval, interval) boolean' on db.
436986
func IntervalEq(db XODB, v0 *time.Duration, v1 *time.Duration) (bool, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.interval_eq($1, $2)`

	// run query
	var ret bool
	XOLog(sqlstr, v0, v1)
	err = db.QueryRow(sqlstr, v0, v1).Scan(&ret)
	if err != nil {
		return false, err
	}

	return ret, nil
}
1000618
func (db *DB) localSeq(id ID) uint64 {
	return db.fetchUint64(localItemKey(id, dbLocalSeq))
}
665349
func (c *Carbon) Eq(another *Carbon) bool {
	return c.Equal(another.Time)
}
446540
func ExpectEq(expected, actual interface{}, errorParts ...interface{}) {
	expectThat(actual, oglematchers.Equals(expected), 1, errorParts)
}
801160
func (s *basePropConstSolver) tryToUpdateEQList(col *Column, con *Constant) (bool, bool) {
	if con.Value.IsNull() {
		return false, true
	}
	id := s.getColID(col)
	oldCon := s.eqList[id]
	if oldCon != nil {
		return false, !oldCon.Equal(s.ctx, con)
	}
	s.eqList[id] = con
	return true, false
}
690024
func (*Namespace) Eq(x, y interface{}) bool {
	if e, ok := x.(compare.Eqer); ok {
		return e.Eq(y)
	}

	if e, ok := y.(compare.Eqer); ok {
		return e.Eq(x)
	}

	normalize := func(v interface{}) interface{} {
		if types.IsNil(v) {
			return nil
		}
		vv := reflect.ValueOf(v)
		switch vv.Kind() {
		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
			return vv.Int()
		case reflect.Float32, reflect.Float64:
			return vv.Float()
		case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
			return vv.Uint()
		default:
			return v
		}
	}
	x = normalize(x)
	y = normalize(y)
	return reflect.DeepEqual(x, y)
}
410600
func (lp LockedProject) Eq(lp2 LockedProject) bool {
	if lp.pi != lp2.pi {
		return false
	}

	if lp.r != lp2.r {
		return false
	}

	if len(lp.pkgs) != len(lp2.pkgs) {
		return false
	}

	for k, v := range lp.pkgs {
		if lp2.pkgs[k] != v {
			return false
		}
	}

	v1n := lp.v == nil
	v2n := lp2.v == nil

	if v1n != v2n {
		return false
	}

	if !v1n && !lp.v.Matches(lp2.v) {
		return false
	}

	return true
}
652080
func MakeInterval(db XODB, v0 int, v1 int, v2 int, v3 int, v4 int, v5 int, v6 float64) (*time.Duration, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.make_interval($1, $2, $3, $4, $5, $6, $7)`

	// run query
	var ret *time.Duration
	XOLog(sqlstr, v0, v1, v2, v3, v4, v5, v6)
	err = db.QueryRow(sqlstr, v0, v1, v2, v3, v4, v5, v6).Scan(&ret)
	if err != nil {
		return nil, err
	}

	return ret, nil
}
670727
func (s *DescribeEvaluationsInput) SetEQ(v string) *DescribeEvaluationsInput {
	s.EQ = &v
	return s
}
257125
func (pages Pages) ProbablyEq(other interface{}) bool {
	otherPages, ok := other.(Pages)
	if !ok {
		return false
	}

	if len(pages) != len(otherPages) {
		return false
	}

	step := 1

	for i := 0; i < len(pages); i += step {
		if !pages[i].Eq(otherPages[i]) {
			return false
		}

		if i > 50 {
			// This is most likely the same.
			step = 50
		}
	}

	return true
}
939700
func (a *DateHistogramAggregation) Interval(interval string) *DateHistogramAggregation {
	a.interval = interval
	return a
}
710139
func (r *RemoveRangeOp) Eq(fieldName string, value interface{}) *RemoveRangeOp {
	r.appendOp(Eq, fieldName, value)
	return r
}
23688
func (srv *Server) serveReq(c *conn, req *Request, h Handler) {
	state := StateActive
	if req.Header.Type == TypeHello {
		state = StateHandshake
	}

	srv.setState(c, state)
	// Define a response version from the request version, so
	// it will potentially reduce the amount of additional
	// header configurations.
	header := Header{
		Version:     req.Header.Version,
		Transaction: req.Header.Transaction,
	}

	// Construct a new response instance with some default
	// attributes and execute respective handler for it.
	resp := &response{conn: c, header: header}
	h.Serve(resp, req)

	// Write the buffer content to the connection, so the
	// pending messages will be written to the wire.
	c.Flush()

	// Update the state as the handler just processed the
	// received request and now the server will wait for a
	// new one.
	srv.setState(c, StateIdle)
}
1001453
func (s *DescribeBatchPredictionsInput) SetEQ(v string) *DescribeBatchPredictionsInput {
	s.EQ = &v
	return s
}
1260462
func ErrorEq(expected, actual error) {
	if NoDebug || (expected == actual) {
		return
	}

	if expected == nil {
		die(fmt.Sprintf("assert.ErrorEq: %s", actual.Error()))
	}

	var should string
	if actual == nil {
		should = "no error was returned"
	} else {
		should = fmt.Sprintf("have '%s'", actual)
	}

	die(fmt.Sprintf("assert.ErrorEq: expected '%s', but %s", expected, should))
}
1241299
func (s SessionID) Eq(s2 SessionID) bool {
	return hmac.Equal(s[:], s2[:])
}
1214267
func (p Pitch) Eq(o Pitch) bool {
	return p.Interval.Eq(o.Interval)
}