Skip to content
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

More clear error on unsupported IN using subqueries instead of expressions #622

Closed
campoy opened this issue Nov 17, 2018 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@campoy
Copy link
Contributor

campoy commented Nov 17, 2018

When running this request, I get a very unclear error. What is not supported exactly?

SELECT *
FROM trees
WHERE tree_hash IN (
  SELECT tree_hash
  FROM commits
  WHERE commit_hash = '5e5f7e53896a171959c34483a60db5770a8abac0'
)

The error message doesn't necessarily help explain why this is not supported.

Query Failed - unknown error: unsupported syntax: &sqlparser.Subquery{Select:(*sqlparser.Select)(0xc000a5e340)}
@ajnavarro ajnavarro added the bug Something isn't working label Nov 19, 2018
@ajnavarro ajnavarro changed the title unclear unsupported syntax error More clear error on unsupported IN using subqueries instead of expressions Nov 19, 2018
@kuba-- kuba-- self-assigned this Nov 19, 2018
@kuba--
Copy link
Contributor

kuba-- commented Nov 19, 2018

First of all the query should be (tree_entries instead of trees):

SELECT *
FROM tree_entries
WHERE tree_hash IN (  SELECT tree_hash  FROM commits  WHERE commit_hash = '5e5f7e53896a171959c34483a60db5770a8abac0');

So far we don't support subqueries for conditions/filters (it will require extra work for mysql - here is an open issue: src-d/go-mysql-server#59)

This PR just adds an explicit error message: src-d/go-mysql-server#552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants