Skip to content

Commit

Permalink
Fix truncation with SQL_SUCCESS_WITH_INFO code not being handled corr…
Browse files Browse the repository at this point in the history
…ectly on IBM DB2 for System i
  • Loading branch information
stefanbildl committed Feb 24, 2025
1 parent 25af894 commit 3295176
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions column.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,17 @@ loop:
break loop
case api.SQL_SUCCESS_WITH_INFO:
err := NewError("SQLGetData", h).(*Error)
if len(err.Diag) > 0 && err.Diag[0].State != "01004" {
return nil, err
if len(err.Diag) > 0 {
truncated := false
for _, diag := range err.Diag {
if diag.State == "01004" {
truncated = true
break
}
}
if !truncated {
return nil, err
}
}
i := len(b)
switch c.CType {
Expand Down

0 comments on commit 3295176

Please sign in to comment.