-
-
Notifications
You must be signed in to change notification settings - Fork 237
Fix schema for call to hash.HashOf() in HashLookups
#3038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
4827bd1
250b8e0
ee61b87
c8940d7
0eb0331
f3ed6e2
76c0b7a
ab428c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ import ( | |
| "sync" | ||
|
|
||
| "github.com/dolthub/go-mysql-server/sql" | ||
| "github.com/dolthub/go-mysql-server/sql/expression" | ||
| "github.com/dolthub/go-mysql-server/sql/hash" | ||
| "github.com/dolthub/go-mysql-server/sql/types" | ||
| ) | ||
|
|
@@ -127,7 +128,13 @@ func (n *HashLookup) GetHashKey(ctx *sql.Context, e sql.Expression, row sql.Row) | |
| return nil, err | ||
| } | ||
| if s, ok := key.([]interface{}); ok { | ||
| return hash.HashOf(ctx, n.Schema(), s) | ||
| var sch sql.Schema | ||
| if tup, isTup := e.(*expression.Tuple); isTup { | ||
| for _, expr := range tup.Children() { | ||
| sch = append(sch, &sql.Column{Type: expr.Type()}) | ||
|
||
| } | ||
| } | ||
| return hash.HashOf(ctx, sch, s) | ||
| } | ||
| // byte slices are not hashable | ||
| if k, ok := key.([]byte); ok { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is confusing without context. This is a regression test but it doesn't describe what issue was being fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that we were passing in the wrong schema; now, we're passing in the right one.