Skip to content

Commit

Permalink
Merge pull request #2585 from cockroachdb/vivek/distinct-fix
Browse files Browse the repository at this point in the history
Improve error for unsupported result type.
  • Loading branch information
vivekmenezes committed Sep 21, 2015
2 parents 759747f + f3613d7 commit 88ef0ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions sql/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/cockroachdb/cockroach/proto"
"github.com/cockroachdb/cockroach/sql/driver"
"github.com/cockroachdb/cockroach/sql/parser"
"github.com/cockroachdb/cockroach/util"
gogoproto "github.com/gogo/protobuf/proto"
)

Expand Down Expand Up @@ -207,7 +206,7 @@ func (e Executor) execStmt(stmt parser.Statement, params parameters, planMaker *
Payload: &driver.Datum_IntervalVal{IntervalVal: vt.Nanoseconds()},
})
default:
return util.Errorf("unsupported datum: %T", val)
return fmt.Errorf("unsupported result type: %s", val.Type())
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions sql/testdata/select
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ SELECT * FROM xyzw OFFSET a
query error unsupported binary operator: <int> \+ <float>
SELECT * FROM xyzw OFFSET 1 + 0.0

query error unsupported result type: tuple
SELECT (x,y) FROM xyzw

query III
SELECT * FROM xyzw LIMIT 0
----
Expand Down

0 comments on commit 88ef0ca

Please sign in to comment.