diff --git a/query.go b/query.go index 8b88d6f..bce7829 100644 --- a/query.go +++ b/query.go @@ -200,7 +200,10 @@ func (conn *Connection) QueryParameterized(sqlStatements []ParameterizedStatemen } func (conn *Connection) parseQueryResult(thisResult map[string]interface{}) QueryResult { - var qr QueryResult + var qr = QueryResult{ + conn: conn, + rowNumber: -1, + } // did we get an error? _, ok := thisResult["error"] @@ -231,8 +234,6 @@ func (conn *Connection) parseQueryResult(thisResult map[string]interface{}) Quer trace("%s: fyi, no values this query", conn.ID) } - qr.rowNumber = -1 - trace("%s: this result (#col,time) %d %f", conn.ID, len(qr.columns), qr.Timing) return qr @@ -295,7 +296,6 @@ func (conn *Connection) QueryParameterizedContext(ctx context.Context, sqlStatem for n, r := range resultsArray { trace("%s: parsing result %d", conn.ID, n) qr := conn.parseQueryResult(r.(map[string]interface{})) - qr.conn = conn results = append(results, qr) if qr.Err != nil { errs = append(errs, qr.Err) diff --git a/request.go b/request.go index ff34a2f..efebb0c 100644 --- a/request.go +++ b/request.go @@ -148,11 +148,9 @@ func (conn *Connection) RequestParameterizedContext(ctx context.Context, sqlStat if hasValues || hasColumns { // Presence of these keys means this is a query result qr := conn.parseQueryResult(thisResult) - qr.conn = conn thisR.Query = &qr } else { wr := conn.parseWriteResult(thisResult) - wr.conn = conn thisR.Write = &wr } results = append(results, thisR) diff --git a/write.go b/write.go index 8da457f..d22f67f 100644 --- a/write.go +++ b/write.go @@ -124,7 +124,7 @@ func (conn *Connection) WriteParameterized(sqlStatements []ParameterizedStatemen } func (conn *Connection) parseWriteResult(thisResult map[string]interface{}) WriteResult { - var wr WriteResult + var wr = WriteResult{conn: conn} // did we get an error? _, ok := thisResult["error"] @@ -209,7 +209,6 @@ func (conn *Connection) WriteParameterizedContext(ctx context.Context, sqlStatem for n, k := range resultsArray { trace("%s: starting on result %d", conn.ID, n) wr := conn.parseWriteResult(k.(map[string]interface{})) - wr.conn = conn results = append(results, wr) if wr.Err != nil { errs = append(errs, wr.Err)