Explorar el Código

Set the decimal pointer explicitly for each row

Ben Hood hace 11 años
padre
commit
fa6b3488a5
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      marshal.go

+ 1 - 0
marshal.go

@@ -719,6 +719,7 @@ func unmarshalDecimal(info *TypeInfo, data []byte, value interface{}) error {
 			*v = inf.NewDecBig(unscaled, inf.Scale(scale))
 			return nil
 		} else if len(data) == 0 {
+			*v = nil
 			return nil
 		} else {
 			return unmarshalErrorf("can not unmarshal %s into %T", info, value)