zeroshade commented on code in PR #828:
URL: https://github.com/apache/arrow-adbc/pull/828#discussion_r1237252549
##########
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:
Ah gotcha. So SQLState will get added to the string representation of the
error right now, so i think letting it truncate at 5 characters is fine with
the copy.
--
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]