@@ -99,7 +99,7 @@ func (a *Arith) evalDivideByZero(kind vector.Kind, lhs, rhs vector.Any) vector.A
9999 l , lnull := vector .IntValue (lhs , i )
100100 r , rnull := vector .IntValue (rhs , i )
101101 if lnull || rnull {
102- nulls .Set (i )
102+ nulls .Set (uint32 ( len ( ints )) )
103103 ints = append (ints , 0 )
104104 continue
105105 }
@@ -113,6 +113,7 @@ func (a *Arith) evalDivideByZero(kind vector.Kind, lhs, rhs vector.Any) vector.A
113113 ints = append (ints , l % r )
114114 }
115115 }
116+ nulls .Shorten (uint32 (len (ints )))
116117 out = vector .NewInt (super .TypeInt64 , ints , nulls )
117118 case vector .KindUint :
118119 var uints []uint64
@@ -121,7 +122,7 @@ func (a *Arith) evalDivideByZero(kind vector.Kind, lhs, rhs vector.Any) vector.A
121122 l , lnull := vector .UintValue (lhs , i )
122123 r , rnull := vector .UintValue (rhs , i )
123124 if lnull || rnull {
124- nulls .Set (i )
125+ nulls .Set (uint32 ( len ( uints )) )
125126 uints = append (uints , 0 )
126127 continue
127128 }
@@ -135,6 +136,7 @@ func (a *Arith) evalDivideByZero(kind vector.Kind, lhs, rhs vector.Any) vector.A
135136 uints = append (uints , l % r )
136137 }
137138 }
139+ nulls .Shorten (uint32 (len (uints )))
138140 out = vector .NewUint (super .TypeUint64 , uints , nulls )
139141 default :
140142 panic (kind )
0 commit comments