Skip to content

Commit c9054b0

Browse files
author
James Cor
committed
unwrap
1 parent 6d56cc5 commit c9054b0

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

sql/hash/hash.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ func HashOf(ctx *sql.Context, sch sql.Schema, row sql.Row) (uint64, error) {
4343
}
4444
}
4545

46+
v, err := sql.UnwrapAny(ctx, v)
47+
if err != nil {
48+
return 0, fmt.Errorf("error unwrapping value: %w", err)
49+
}
50+
4651
// TODO: we may not always have the type information available, so we check schema length.
4752
// Then, defer to original behavior
4853
if i >= len(sch) || v == nil {

sql/iters/rel_iters.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,10 @@ func (ii *IntersectIter) Next(ctx *sql.Context) (sql.Row, error) {
644644
ii.cache = make(map[uint64]int)
645645
for {
646646
res, err := ii.RIter.Next(ctx)
647-
if err != nil && err != io.EOF {
647+
if err != nil {
648+
if err == io.EOF {
649+
break
650+
}
648651
return nil, err
649652
}
650653

@@ -656,10 +659,6 @@ func (ii *IntersectIter) Next(ctx *sql.Context) (sql.Row, error) {
656659
ii.cache[hash] = 0
657660
}
658661
ii.cache[hash]++
659-
660-
if err == io.EOF {
661-
break
662-
}
663662
}
664663
ii.cached = true
665664
}

0 commit comments

Comments
 (0)