Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nferrario committed Feb 16, 2022
1 parent a636783 commit 04e155b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions rowset.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ func (r *rowSet) Next() bool {

resp, err := r.client.Fetch(r.ctx, r.handle, false, 1000000)
if err != nil {
log.Printf("FetchResults failed: %v\n", err)
if !strings.Contains(err.Error(), "Cancelled") && !strings.Contains(err.Error(), "Invalid or unknown") {
log.Printf("FetchResults failed: %v\n", err)
}
return false
}
r.hasMore = resp.HasMore
Expand Down Expand Up @@ -197,7 +199,7 @@ func (r *rowSet) Scan(dest ...interface{}) error {
*dt = int(i)
case *int64:
i, _ := strconv.ParseInt(val, 10, 0)
*dt = int64(i)
*dt = i
case *int32:
i, _ := strconv.ParseInt(val, 10, 0)
*dt = int32(i)
Expand Down Expand Up @@ -315,10 +317,6 @@ func (r *rowSet) Cancel() error {
return err
}

err = con.client.Close(context.Background(), r.handle)
if err != nil {
return err
}
//log.Println(status)
return nil
return con.Close()
}

0 comments on commit 04e155b

Please sign in to comment.