select id, sharding_id , count(company_id) as r from customer group by sharding_id order by id having r = 10000; 上面这个句子用解析器的parseStatement()方法尽然不报错,只是返回的语句里把having r = 10000给去除了。
实际上任何字符都可以,例如:select id, sharding_id , count(company_id) as r from customer group by sharding_id order by id dfdfdf;因为解析的过程是parseFrom->parseWhere->parseHierachical-->parseGroupBy->parseOrderBy,之后是按合法sql语句可能出现的关键词的解析,但对非法字符没做处理了。
1条答案
按热度按时间i7uq4tfw1#
实际上任何字符都可以,例如:select id, sharding_id , count(company_id) as r from customer group by sharding_id order by id dfdfdf;因为解析的过程是parseFrom->parseWhere->parseHierachical-->parseGroupBy->parseOrderBy,之后是按合法sql语句可能出现的关键词的解析,但对非法字符没做处理了。