Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

ORDER BY with aggregations fails with a missleading error #675

Closed
mcuadros opened this issue Apr 12, 2019 · 0 comments · Fixed by #680
Closed

ORDER BY with aggregations fails with a missleading error #675

mcuadros opened this issue Apr 12, 2019 · 0 comments · Fixed by #680
Assignees
Labels
bug Something isn't working

Comments

@mcuadros
Copy link
Contributor

Executing a SQL query generated by superset, the execution fails with a missleading error.

SELECT repository_id AS repository_id,        
COUNT(*) AS count,        
COUNT(repository_id) AS c 
FROM commits 
GROUP BY repository_id ORDER BY COUNT(repository_id) DESC LIMIT 10000;

Outputs:
ERROR 1105 (HY000): unknown error: table "commits" does not have column "repository_id"

@erizocosmico erizocosmico transferred this issue from src-d/gitbase Apr 12, 2019
@erizocosmico erizocosmico added the bug Something isn't working label Apr 12, 2019
@erizocosmico erizocosmico self-assigned this Apr 16, 2019
erizocosmico added a commit to erizocosmico/go-mysql-server that referenced this issue Apr 17, 2019
Fixes src-d#675

When there was an alias with the same name as a column in a table,
the column was qualified with the table instead of referencing the
alias.

Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants