Browse Source

Set the decimal pointer explicitly for each row

Ben Hood 11 years ago
parent
commit
fa6b3488a5
1 changed files with 1 additions and 0 deletions
  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)