Open linghengqian opened 11 months ago
I check your config.yaml, please use this yaml and try it again
rules:
- !SHARDING
tables:
t_order:
actualDataNodes: lingh_readwrite_data_sources.t_order$->{0..1}
tableStrategy:
standard:
shardingColumn: order_id
shardingAlgorithmName: lingh_inline
keyGenerateStrategy:
column: order_id
keyGeneratorName: lingh_snowflake
shardingAlgorithms:
lingh_inline:
type: INLINE
props:
algorithm-expression: t_order$->{order_id % 2}
allow-range-query-with-inline-sharding: true
keyGenerators:
lingh_snowflake:
type: SNOWFLAKE
props:
max-vibration-offset: 1
max-tolerate-time-difference-milliseconds: 10
- !READWRITE_SPLITTING
dataSources:
lingh_readwrite_data_sources:
writeDataSourceName: shardingmaster
readDataSourceNames:
- shardingslave0
- shardingslave1
loadBalancerName: lingh_load_balance_algorithm
loadBalancers:
lingh_load_balance_algorithm:
type: ROUND_ROBIN
- !SINGLE
tables:
- "*.*"
defaultDataSource: lingh_readwrite_data_sources
@zhaojinchao95
./mvnw clean test
will still get the same Error Log about org.apache.shardingsphere.dialect.exception.syntax.table.NoSuchTableException
.DATABASE_TO_LOWER=TRUE
.jdbcUrl
of h2database does not contain DATABASE_TO_LOWER=TRUE
, the class name involved in algorithm-expression
is forced to be capitalized, otherwise column name matching fails when SQL is executed. So I did another test in https://github.com/linghengqian/shardingsphere-v540-readwrite-splitting-test/pull/1 and after adding DATABASE_TO_LOWER=TRUE
to jdbcUrl
, NoSuchTableException
will reappear.DATABASE_TO_LOWER=TRUE
in the master branch, so I don't understand why this parameter causes ShardingSphere's Metadata to be broken.There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will close it.
Please answer these questions before submitting your issue. Thanks!
Which version of ShardingSphere did you use?
5.4.0
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
./mvnw clean test
without error.SHARDING
andREADWRITE_SPLITTING
features, CRUD operations on table throwNoSuchTableException
.Actual behavior
./mvnw clean test
throws an exception ofNoSuchTableException
, below is the error log.Error Log
Reason analyze (If you can)
ShardingSphere JDBC 5.3.2
.Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
git clone git@github.com:linghengqian/shardingsphere-v540-readwrite-splitting-test.git cd ./shardingsphere-v540-readwrite-splitting-test/ ./mvnw clean test