소스 검색

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)