Skip to content

Commit 250b8e0

Browse files
author
James Cor
committed
use correct schema for hashlookup keys
1 parent 4827bd1 commit 250b8e0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sql/plan/hash_lookup.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package plan
1616

1717
import (
1818
"fmt"
19+
"github.com/dolthub/go-mysql-server/sql/expression"
1920
"sync"
2021

2122
"github.com/dolthub/go-mysql-server/sql"
@@ -127,7 +128,13 @@ func (n *HashLookup) GetHashKey(ctx *sql.Context, e sql.Expression, row sql.Row)
127128
return nil, err
128129
}
129130
if s, ok := key.([]interface{}); ok {
130-
return hash.HashOf(ctx, nil, s)
131+
var sch sql.Schema
132+
if tup, isTup := e.(*expression.Tuple); isTup {
133+
for _, expr := range tup.Children() {
134+
sch = append(sch, &sql.Column{Type: expr.Type()})
135+
}
136+
}
137+
return hash.HashOf(ctx, sch, s)
131138
}
132139
// byte slices are not hashable
133140
if k, ok := key.([]byte); ok {

0 commit comments

Comments
 (0)