lidavidm commented on code in PR #828:
URL: https://github.com/apache/arrow-adbc/pull/828#discussion_r1237200515


##########
go/adbc/driver/snowflake/driver.go:
##########
@@ -162,7 +162,11 @@ func errToAdbcErr(code adbc.Status, err error) error {
        if errors.As(err, &sferr) {
                var sqlstate [5]byte
                if len(sferr.SQLState) > 0 {
-                       copy(sqlstate[:], sferr.SQLState[:5])
+                       if len(sferr.SQLState) <= 5 {
+                               copy(sqlstate[:], sferr.SQLState)
+                       } else {
+                               copy(sqlstate[:], sferr.SQLState[:5])

Review Comment:
   Into the error message, not into the sqlstate field.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to