diff --git a/sql/parse/parse.go b/sql/parse/parse.go index 922964323..9349f6bf9 100644 --- a/sql/parse/parse.go +++ b/sql/parse/parse.go @@ -25,6 +25,9 @@ var ( // ErrUnsupportedFeature is thrown when a feature is not already supported ErrUnsupportedFeature = errors.NewKind("unsupported feature: %s") + // ErrUnsupportedSubqueryExpression is thrown because subqueries are not supported, yet. + ErrUnsupportedSubqueryExpression = errors.NewKind("unsupported subquery expression") + // ErrInvalidSQLValType is returned when a SQLVal type is not valid. ErrInvalidSQLValType = errors.NewKind("invalid SQLVal of type: %d") @@ -783,6 +786,8 @@ func exprToExpression(e sqlparser.Expr) (sql.Expression, error) { return binaryExprToExpression(v) case *sqlparser.UnaryExpr: return unaryExprToExpression(v) + case *sqlparser.Subquery: + return nil, ErrUnsupportedSubqueryExpression.New() } } diff --git a/sql/parse/parse_test.go b/sql/parse/parse_test.go index 003e4fd58..5f7b57d47 100644 --- a/sql/parse/parse_test.go +++ b/sql/parse/parse_test.go @@ -905,9 +905,10 @@ func TestParse(t *testing.T) { } var fixturesErrors = map[string]*errors.Kind{ - `SHOW METHEMONEY`: ErrUnsupportedFeature, - `LOCK TABLES foo AS READ`: errUnexpectedSyntax, - `LOCK TABLES foo LOW_PRIORITY READ`: errUnexpectedSyntax, + `SHOW METHEMONEY`: ErrUnsupportedFeature, + `LOCK TABLES foo AS READ`: errUnexpectedSyntax, + `LOCK TABLES foo LOW_PRIORITY READ`: errUnexpectedSyntax, + `SELECT * FROM mytable WHERE i IN (SELECT i FROM foo)`: ErrUnsupportedSubqueryExpression, } func TestParseErrors(t *testing.T) {
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: