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

Error when sql_small_result/sql_big_result+distinct/distinctrow #129

Open
actiontech-bot opened this issue Aug 25, 2017 · 1 comment
Open

Comments

@actiontech-bot
Copy link
Member

actiontech-bot commented Aug 25, 2017

Raised by: @FlyingMao
Steps:

  1. Query: select sql_big_result distinct pad from sbtest1;
    Return:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS pad
FROM sbtest1
LIMIT 100' at line 1
  1. Query: select sql_small_result distinct pad from sbtest1 order by pad;
    Return: io.mycat.plan.common.exception.MySQLOutPutException:column distinct not found
@actiontech-bot
Copy link
Member Author

By @yanhuqing666

  1. distinctrow case should be fixed.
  2. Parser support only select distinct sql_small_result.
    When parsing select sql_small_result distinct column, distinct will be treated as column name, and column as alias name. The SQL will be treated as select sql_small_result distinct as column, which cause 1064 error.
    Solution: Usage should follow MySQL documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants