Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sql/expression/function/json/json_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (j JSONType) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
}

if comparableDoc, ok := doc.(types.ComparableJSON); ok {
return comparableDoc.Type(ctx)
return comparableDoc.JsonType(ctx)
}

val, err := doc.ToInterface(ctx)
Expand Down
8 changes: 4 additions & 4 deletions sql/types/json_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ type SearchableJSON interface {

type ComparableJSON interface {
sql.JSONWrapper
Compare(other interface{}) (int, error)
Type(ctx context.Context) (string, error)
Compare(ctx context.Context, other interface{}) (int, error)
JsonType(ctx context.Context) (string, error)
}

// MutableJSON is a JSON value that can be efficiently modified. These modifications return the new value, but they
Expand Down Expand Up @@ -510,11 +510,11 @@ func CompareJSON(ctx context.Context, a, b interface{}) (int, error) {
}

if comparableA, ok := a.(ComparableJSON); ok {
return comparableA.Compare(b)
return comparableA.Compare(ctx, b)
}

if comparableB, ok := b.(ComparableJSON); ok {
result, err := comparableB.Compare(a)
result, err := comparableB.Compare(ctx, a)
return -result, err
}

Expand Down