-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
SQL:针对无路由配置表的查询,经路由后,表名被替换为小写,未保留原SQL规范 #576
Comments
DDL语句手动执行的原因:若通过程序自动执行,表名同样会被转为小写,无法再现本问题 |
代码: sqlBuilder.appendTable(tableToken.getTableName().toLowerCase()); |
|
@neo37927 现在dev 分支应该是可以的吧,我没试过,我现在是用2.0.0版本暂时没有表名大小写的问题 |
@hwck 您在维护么? |
应该是之前改的一个issue并没有完全想清楚,这个bug下一版本会修复 |
经过排查,这是使用方的问题。 |
@terrymanu 本来想着,来找找新版本,却发现日志被取消了。。。做了简要说明,麻烦有时间确认下。
link:https://github.com/neo37927/sharding-jdbc-example.git
1.Insert-------------- |
We should make clear with rule here. |
Please answer these questions before submitting your issue. Thanks!
Which version of Sharding-Jdbc do you using?
2.0.2
Expected behavior
保留原始SQL中的表名的规范
Actual behavior
表名被转成了小写
Steps to reproduce the behavior
数据库为:mysql
数据库设置项中,并没有设置lower_case_table_names=1
即数据库表名区分大小写
Please provide the reproduce example codes (such as github link)
link:https://github.com/neo37927/sharding-jdbc-example.git
branch:reproduce-example-codes
说明:
1.首先,我在git code中,抓取了T_ORDER、T_ORDER_ITEM 的建删表SQL,并手动执行。注释掉demo中的相关建删表代码。(即//orderRepository.createIfNotExistsTable()等)
2.修改xml中表名为大写
3.运行Demo会将会看到报错
异常:[ERROR] 2018-01-24 16:24:24,818 --ShardingJDBC-2-- [com.google.common.util.concurrent.Futures$CombinedFuture] input future failed.
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'platform_honor.t_order_1' doesn't exist
其中platform_honor 为我本地库名
The text was updated successfully, but these errors were encountered: