Skip to content

Commit

Permalink
Fix the bug of plus operator (matrixorigin#2194)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnsgmsone authored Apr 12, 2022
1 parent ebb2eca commit d7babd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/sql/viewexec/oplus/oplus.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ func (ctr *Container) fillH8(bat *batch.Batch, proc *process.Process) error {
if !nulls.Any(vecs[j].Nsp) {
for k := int64(0); k < n; k++ {
*(*int8)(unsafe.Add(unsafe.Pointer(&ctr.h8.keys[k]), ctr.keyOffs[k])) = 0
copy(unsafe.Slice((*byte)(unsafe.Pointer(&ctr.h8.keys[k])), 8)[ctr.keyOffs[k]:], vData[vOff[i+k]:vOff[i+k]+vLen[i+k]])
copy(unsafe.Slice((*byte)(unsafe.Pointer(&ctr.h8.keys[k])), 8)[ctr.keyOffs[k]+1:], vData[vOff[i+k]:vOff[i+k]+vLen[i+k]])
ctr.keyOffs[k] += vLen[i+k] + 1
}
} else {
Expand Down Expand Up @@ -776,7 +776,7 @@ func (ctr *Container) fillH8(bat *batch.Batch, proc *process.Process) error {
if !nulls.Any(vecs[j].Nsp) {
for k := int64(0); k < n; k++ {
*(*int8)(unsafe.Add(unsafe.Pointer(&ctr.h8.keys[k]), ctr.keyOffs[k])) = 0
copy(unsafe.Slice((*byte)(unsafe.Pointer(&ctr.h8.keys[k])), 8)[ctr.keyOffs[k]:], vData[vOff[i+k]:vOff[i+k]+vLen[i+k]])
copy(unsafe.Slice((*byte)(unsafe.Pointer(&ctr.h8.keys[k])), 8)[ctr.keyOffs[k]+1:], vData[vOff[i+k]:vOff[i+k]+vLen[i+k]])
ctr.keyOffs[k] += vLen[i+k] + 1
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/viewexec/plus/plus.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ func (ctr *Container) fillH8(bat *batch.Batch, proc *process.Process) error {
if !nulls.Any(vecs[j].Nsp) {
for k := int64(0); k < n; k++ {
*(*int8)(unsafe.Add(unsafe.Pointer(&ctr.h8.keys[k]), ctr.keyOffs[k])) = 0
copy(unsafe.Slice((*byte)(unsafe.Pointer(&ctr.h8.keys[k])), 8)[ctr.keyOffs[k]:], vData[vOff[i+k]:vOff[i+k]+vLen[i+k]])
copy(unsafe.Slice((*byte)(unsafe.Pointer(&ctr.h8.keys[k])), 8)[ctr.keyOffs[k]+1:], vData[vOff[i+k]:vOff[i+k]+vLen[i+k]])
ctr.keyOffs[k] += vLen[i+k] + 1
}
} else {
Expand Down

0 comments on commit d7babd5

Please sign in to comment.