Ver código fonte

Propagate errors from SQL row reading

Currently errors while data is being read are being swallowed and result in a truncated result set, this fixes that and properly returns an error and not an incomplete result.
xormplus 7 anos atrás
pai
commit
96822e6a7f
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      session_get.go

+ 3 - 0
session_get.go

@@ -88,6 +88,9 @@ func (session *Session) nocacheGet(beanKind reflect.Kind, table *core.Table, bea
 	defer rows.Close()
 
 	if !rows.Next() {
+		if rows.Err() != nil {
+			return false, rows.Err()
+		}
 		return false, nil
 	}