This repository was archived by the owner on Jan 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 2525 // ErrUnsupportedFeature is thrown when a feature is not already supported
2626 ErrUnsupportedFeature = errors .NewKind ("unsupported feature: %s" )
2727
28+ // ErrUnsupportedSubqueryExpression is thrown because subqueries are not supported, yet.
29+ ErrUnsupportedSubqueryExpression = errors .NewKind ("unsupported subquery expression" )
30+
2831 // ErrInvalidSQLValType is returned when a SQLVal type is not valid.
2932 ErrInvalidSQLValType = errors .NewKind ("invalid SQLVal of type: %d" )
3033
@@ -783,6 +786,8 @@ func exprToExpression(e sqlparser.Expr) (sql.Expression, error) {
783786 return binaryExprToExpression (v )
784787 case * sqlparser.UnaryExpr :
785788 return unaryExprToExpression (v )
789+ case * sqlparser.Subquery :
790+ return nil , ErrUnsupportedSubqueryExpression .New ()
786791 }
787792}
788793
Original file line number Diff line number Diff line change @@ -905,9 +905,10 @@ func TestParse(t *testing.T) {
905905}
906906
907907var fixturesErrors = map [string ]* errors.Kind {
908- `SHOW METHEMONEY` : ErrUnsupportedFeature ,
909- `LOCK TABLES foo AS READ` : errUnexpectedSyntax ,
910- `LOCK TABLES foo LOW_PRIORITY READ` : errUnexpectedSyntax ,
908+ `SHOW METHEMONEY` : ErrUnsupportedFeature ,
909+ `LOCK TABLES foo AS READ` : errUnexpectedSyntax ,
910+ `LOCK TABLES foo LOW_PRIORITY READ` : errUnexpectedSyntax ,
911+ `SELECT * FROM mytable WHERE i IN (SELECT i FROM foo)` : ErrUnsupportedSubqueryExpression ,
911912}
912913
913914func TestParseErrors (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments