File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -663,17 +663,21 @@ func (s *Stmt) Columns(dest ...any) error {
663
663
case byte (NULL ):
664
664
dest [i ] = nil
665
665
default :
666
- ptr := util .Read32 [ptr_t ](s .c .mod , dataPtr + 0 )
667
- if ptr == 0 {
668
- dest [i ] = []byte {}
669
- continue
670
- }
671
666
len := util .Read32 [int32 ](s .c .mod , dataPtr + 4 )
672
- buf := util .View (s .c .mod , ptr , int64 (len ))
673
- if types [i ] == byte (TEXT ) {
674
- dest [i ] = string (buf )
667
+ if len != 0 {
668
+ ptr := util .Read32 [ptr_t ](s .c .mod , dataPtr )
669
+ buf := util .View (s .c .mod , ptr , int64 (len ))
670
+ if types [i ] == byte (TEXT ) {
671
+ dest [i ] = string (buf )
672
+ } else {
673
+ dest [i ] = buf
674
+ }
675
675
} else {
676
- dest [i ] = buf
676
+ if types [i ] == byte (TEXT ) {
677
+ dest [i ] = ""
678
+ } else {
679
+ dest [i ] = []byte {}
680
+ }
677
681
}
678
682
}
679
683
dataPtr += 8
You can’t perform that action at this time.
0 commit comments