-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Table name capitalization cannot be queried #529
Labels
Comments
当我配置 retailOrderTableRuleConfig.setLogicTable("T22");的时候,居然查询到数据,但是数据库确实没有这张表 |
发现问题了 |
我们会在2.0.2版本中修复这个问题。 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
多张表分库,表名大写找不到表,只有其中一张表能查询,其他不能查询。
spring boot 1.5.9 mybatis3.4.5 shardingjdbc 2.0.1
其中一张表能查到数据,其他的表都报找不到表。表名都是大写 t1表无法查询,报错
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: io.shardingjdbc.core.exception.ShardingJdbcException: io.shardingjdbc.core.exception.ShardingJdbcException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'xx.T1' doesn't exist
The error may exist in file [T1Mapper.xml]
The error may involve defaultParameterMap
The error occurred while setting parameters
SQL: SELECT * from T1
Cause: io.shardingjdbc.core.exception.ShardingJdbcException: io.shardingjdbc.core.exception.ShardingJdbcException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'xx.T1' doesn't exist
T2表查询没有问题
private Map<String, DataSource> createDataSourceMap() {
HashMap<String, DataSource> dataSourceMap = new HashMap<>();
for (Map<String, String> database : myProps.getDatabase()) {
HikariDataSource ds = (HikariDataSource) DataSourceBuilder.create()
.url(database.get("url"))
.username(database.get("username"))
.password(database.get("password"))
.driverClassName(database.get("driveClassName"))
.type(HikariDataSource.class).build();
ds.setConnectionTestQuery("SELECT 1");
dataSourceMap.put(database.get("name"), ds);
}
return dataSourceMap;
}
private TableRuleConfiguration getT2TableRuleConfiguration() {
TableRuleConfiguration retailOrderTableRuleConfig = new TableRuleConfiguration();
retailOrderTableRuleConfig.setLogicTable("T2");
return retailOrderTableRuleConfig;
}
The text was updated successfully, but these errors were encountered: