瀏覽代碼

Set the decimal pointer explicitly for each row

Ben Hood 11 年之前
父節點
當前提交
fa6b3488a5
共有 1 個文件被更改,包括 1 次插入0 次删除
  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)