Skip to content

Commit

Permalink
fix res.Success in async.go (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yifeng-Sigma committed Dec 30, 2022
1 parent 74d0bd9 commit 3a8213f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions async.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ func (sr *snowflakeRestful) getAsync(
}

sc := &snowflakeConn{rest: sr, cfg: cfg}
if response.Success {
// the result response sometimes contains only Data and not anything else.
// if code is not set we treat as success
if response.Success || response.Code == "" {
if resType == execResultType {
res.insertID = -1
if isDml(response.Data.StatementTypeID) {
Expand Down Expand Up @@ -202,4 +204,4 @@ func (sr *snowflakeRestful) getAsyncOrStatus(
}

return response, nil
}
}

0 comments on commit 3a8213f

Please sign in to comment.