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 on select +db_name.tbl_name.col_name #269

Closed
FlyingMao opened this issue Sep 19, 2017 · 0 comments
Closed

Error on select +db_name.tbl_name.col_name #269

FlyingMao opened this issue Sep 19, 2017 · 0 comments
Assignees
Milestone

Comments

@FlyingMao
Copy link

steps:

mysql> create table test_shard (id int(11) primary key,R_REGIONKEY float,R_NAME varchar(50),R_COMMENT varchar(50));                                 
Query OK, 0 rows affected (0.03 sec)

mysql> insert into test_shard (id,R_REGIONKEY,R_NAME,R_COMMENT) values (1,1, 'a string','test001'),(3,3, 'another string','test003');
Query OK, 2 rows affected (0.01 sec)

mysql> select mytest.test_shard.R_NAME from test_shard;
ERROR 1064 (HY000): com.alibaba.druid.sql.ast.expr.SQLPropertyExpr cannot be cast to com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr

log:

2017-09-19 15:56:29.090  WARN [BusinessExecutor1] (com.actiontech.dble.server.ServerConnection.executeException(ServerConnection.java:285)) - ServerConnection [id=5, schema=mytest, host=127.0.0.1, user=test,txIsolation=3, autocommit=true, schema=mytest]select mytest.test_shard.R_NAME from test_shard err:java.lang.ClassCastException: com.alibaba.druid.sql.ast.expr.SQLPropertyExpr cannot be cast to com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr
java.lang.ClassCastException: com.alibaba.druid.sql.ast.expr.SQLPropertyExpr cannot be cast to com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr
	at com.actiontech.dble.plan.visitor.MySQLItemVisitor.endVisit(MySQLItemVisitor.java:431) ~[dble-2.17.08.0.jar:?]
	at com.alibaba.druid.sql.ast.expr.SQLPropertyExpr.accept0(SQLPropertyExpr.java:71) ~[druid-1.0.31.jar:1.0.31]
	at com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.java:41) ~[druid-1.0.31.jar:1.0.31]
	at com.actiontech.dble.route.parser.druid.impl.DruidSelectParser.isSumFunc(DruidSelectParser.java:258) ~[dble-2.17.08.0.jar:?]
	at com.actiontech.dble.route.parser.druid.impl.DruidSelectParser.parseAggExprCommon(DruidSelectParser.java:216) ~[dble-2.17.08.0.jar:?]
	at com.actiontech.dble.route.parser.druid.impl.DruidSelectParser.parseAggGroupCommon(DruidSelectParser.java:306) ~[dble-2.17.08.0.jar:?]
	at com.actiontech.dble.route.parser.druid.impl.DruidSelectParser.parseOrderAggGroupMysql(DruidSelectParser.java:177) ~[dble-2.17.08.0.jar:?]
	at com.actiontech.dble.route.parser.druid.impl.DruidSelectParser.visitorParse(DruidSelectParser.java:113) ~[dble-2.17.08.0.jar:?]
	at com.actiontech.dble.route.parser.druid.impl.DefaultDruidParser.parser(DefaultDruidParser.java:47) ~[dble-2.17.08.0.jar:?]
	at com.actiontech.dble.route.util.RouterUtil.routeFromParser(RouterUtil.java:117) ~[dble-2.17.08.0.jar:?]
	at com.actiontech.dble.route.impl.DefaultRouteStrategy.routeNormalSqlWithAST(DefaultRouteStrategy.java:59) ~[dble-2.17.08.0.jar:?]
	at com.actiontech.dble.route.impl.AbstractRouteStrategy.route(AbstractRouteStrategy.java:45) ~[dble-2.17.08.0.jar:?]
	at com.actiontech.dble.route.RouteService.route(RouteService.java:105) ~[dble-2.17.08.0.jar:?]
	at com.actiontech.dble.server.ServerConnection.routeEndExecuteSQL(ServerConnection.java:232) [dble-2.17.08.0.jar:?]
	at com.actiontech.dble.server.ServerConnection.execute(ServerConnection.java:176) [dble-2.17.08.0.jar:?]
	at com.actiontech.dble.server.handler.SelectHandler.handle(SelectHandler.java:96) [dble-2.17.08.0.jar:?]
	at com.actiontech.dble.server.ServerQueryHandler.query(ServerQueryHandler.java:62) [dble-2.17.08.0.jar:?]
	at com.actiontech.dble.net.FrontendConnection.query(FrontendConnection.java:299) [dble-2.17.08.0.jar:?]
	at com.actiontech.dble.net.FrontendConnection.query(FrontendConnection.java:317) [dble-2.17.08.0.jar:?]
	at com.actiontech.dble.net.handler.FrontendCommandHandler.handleData(FrontendCommandHandler.java:65) [dble-2.17.08.0.jar:?]
	at com.actiontech.dble.net.handler.FrontendCommandHandler$1.run(FrontendCommandHandler.java:117) [dble-2.17.08.0.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [?:1.7.0_05]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [?:1.7.0_05]
	at java.lang.Thread.run(Thread.java:722) [?:1.7.0_05]

@FlyingMao FlyingMao changed the title select +db_name.tbl_name.col_namefailed error on select +db_name.tbl_name.col_name Sep 22, 2017
@FlyingMao FlyingMao changed the title error on select +db_name.tbl_name.col_name Error on select +db_name.tbl_name.col_name Sep 22, 2017
@yanhuqing666 yanhuqing666 added this to the 2.17.09.0 milestone Sep 25, 2017
yanhuqing666 added a commit that referenced this issue Sep 25, 2017
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

2 participants