You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/09/28 10:42:11 UTC
[GitHub] [incubator-shardingsphere] tristaZero commented on issue #2673:
Support query for `DB.TBL` in ShardingProxy
tristaZero commented on issue #2673: Support query for `DB.TBL` in ShardingProxy
URL: https://github.com/apache/incubator-shardingsphere/issues/2673#issuecomment-536174911
Hi,
It seems A bug. Which version do you use?
Juan Pan
panjuan@apache.org
Juan Pan(Trista), Apache ShardingSphere
On 09/27/2019 17:08, j4$0n wrote:
麻烦问下 这个功能什么时候能上? 我用的是jooq
Meet the same issue when using JOOQ query with backticks.
e.g.,:
Raw SQL,
select`user`.`id`, `user`.`name`, `user`.`timestamp`, `user`.`email``user`.`version`from`user`where (`user`.`id`=123and`user`.`email`='your_email@test.com')
Actual SQL after parser,
select`user`.`id`, `user`.`name`, `user`.`timestamp`, `user`.`email``user`.`version`from`user_21`where (user_21r`.`id` = 123 and user_21r`.`email`='your_email@test.com')
Troubleshot:
Unable parse the SQL correctly since the incorrect SQLTokens from FromWhereSegment, SelectItemSegment
Workaround,
Using table alias in query, verified
User author =Tables_USER.as("user");
Using org.jooq.VisitListener SPI
publicclassUnqualifyingListenerextendsDefaultVisitListener {
@OverridepublicvoidvisitStart(VisitContextcontext) {
if (context.queryPart() instanceofTableField) {
TableField<?, ?> field = (TableField<?, ?>) context.queryPart();
context.queryPart(DSL.field(field.getUnqualifiedName(), field.getDataType()));
}
}
}
Using native SQL...
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services