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 2020/11/17 03:14:59 UTC
[GitHub] [shardingsphere] lightningl opened a new issue #8182: Field 'config' doesn't have a default value
lightningl opened a new issue #8182:
URL: https://github.com/apache/shardingsphere/issues/8182
I use Spring Boot 2.x together with mybatis and sharding-jdbc 4.1.0.
There is only one database, some tables need to sharding, and others are not.
There are total 5 tables: t_1, t_2, t_3, t_model, t_template. t_1, t_2, t_3 need to do sharding, the other two do not need. Configuration are follows:
spring:
shardingsphere:
datasource: &dataSource
names: ds0
ds0:
jdbc-url: jdbc:mysql://xxxx:3306/xxxx
username: xxxx
password: xxxx
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
sharding:
default-data-source-name: ds0
binding-tables: t_1, t_2, t_3
tables:
t_1:
actual-data-nodes: ds0.t_1_$->{0..9}
database-strategy:
inline:
sharding-column: shard
algorithm-expression: ds0
table-strategy:
inline:
sharding-column: shard
algorithm-expression: t_1_$->{shard % 10}
t_2:
actual-data-nodes: ds0.t_2_$->{0..9}
database-strategy:
inline:
sharding-column: shard
algorithm-expression: ds0
table-strategy:
inline:
sharding-column: shard
algorithm-expression: t_2_$->{shard % 10}
t_3:
actual-data-nodes: ds0.t_3_$->{0..9}
database-strategy:
inline:
sharding-column: shard
algorithm-expression: ds0
table-strategy:
inline:
sharding-column: sharding
algorithm-expression: t_3_$->{shard % 10}
the question is, when I insert a piece of data into table "t_model" and "t_template", "t_model" can work successfully, but "t_template" throws an exception:
![image](https://user-images.githubusercontent.com/19239260/99341967-d6a8ff00-28c5-11eb-9eb4-a84d543ceef9.png)
It looks like the default datasource configuration does not work effectively. How do I fix it?
----------------------------------------------------------------
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
[GitHub] [shardingsphere] lightningl closed issue #8182: Field 'config' doesn't have a default value
Posted by GitBox <gi...@apache.org>.
lightningl closed issue #8182:
URL: https://github.com/apache/shardingsphere/issues/8182
----------------------------------------------------------------
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