dble
dble copied to clipboard
Error when `sql_small_result`/`sql_big_result+distinct`/`distinctrow`
Raised by: @FlyingMao Steps:
- 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
- Query:
select sql_small_result distinct pad from sbtest1 order by pad;
Return:io.mycat.plan.common.exception.MySQLOutPutException:column distinct not found
By @yanhuqing666
-
distinctrow
case should be fixed. - Parser support only
select distinct sql_small_result
. When parsingselect sql_small_result distinct column
,distinct
will be treated as column name, andcolumn
as alias name. The SQL will be treated asselect sql_small_result distinct as column
, which cause 1064 error. Solution: Usage should follow MySQL documentation.