diff --git a/query.go b/query.go index 407a792c..b90d43b2 100644 --- a/query.go +++ b/query.go @@ -367,6 +367,7 @@ type QueryExOptions struct { } func (c *Conn) QueryEx(ctx context.Context, sql string, options *QueryExOptions, args ...interface{}) (rows *Rows, err error) { + c.lastActivityTime = time.Now() rows = c.getRows(sql, args) err = c.waitForPreviousCancelQuery(ctx) @@ -380,8 +381,6 @@ func (c *Conn) QueryEx(ctx context.Context, sql string, options *QueryExOptions, return rows, err } - c.lastActivityTime = time.Now() - if err := c.lock(); err != nil { rows.fatal(err) return rows, err