From 3a8213fdb7878c6f40c0151b5b5631e9178931ee Mon Sep 17 00:00:00 2001 From: Yifeng-Sigma Date: Thu, 29 Dec 2022 23:26:36 -0600 Subject: [PATCH] fix res.Success in async.go (#115) --- async.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/async.go b/async.go index 928848e37..2441992f2 100644 --- a/async.go +++ b/async.go @@ -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) { @@ -202,4 +204,4 @@ func (sr *snowflakeRestful) getAsyncOrStatus( } return response, nil -} \ No newline at end of file +}