terrymanu commented on issue #37536:
URL:
https://github.com/apache/shardingsphere/issues/37536#issuecomment-3692837367
Issue Understanding
- Enabling mode.repository JDBC props causes queries to logical table
user_info to fail with “Table or view 'user_info' does not exist”; commenting
out that repository block makes the query succeed. Environment: Spring Boot
3.5.8 + ShardingSphere-JDBC 5.5.2 + Druid 1.2.23 + MyBatis-Plus 3.5.1, with
standalone + JDBC repository, sharding table user_info on
ds_0.user_info_${0..4} (INLINE by id%4), SINGLE rule *.*, and props.sql-show:
true.
Root Cause
- In standalone mode with a JDBC repository, startup loads metadata/rules
from the repository first. If the repository lacks the current database’s
sharding config or table metadata, metadata is empty or stale and the binder
treats the logical table as non-existent, triggering the error. Without the
repository block, it falls back to local YAML and works.
Analysis
- The error arises during metadata binding, matching a “missing metadata
in repository” usage issue rather than a physical-table issue. Please
double-check:
- Indentation: mode.repository.props is nested under mode.repository.
- Repository contents: the JDBC repository’s repository table should
contain the current database’s sharding config and table metadata (e.g.,
/metadata/<db>/schemas/... includes user_info).
- Physical tables: ensure user_info_0..4 exist.
- Official doc for standalone mode config:
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/yaml-config/mode/#standalone
Conclusion
- This is a usage/configuration issue: the repository does not hold the
current sharding metadata, so the logical table is not loaded. Once the
repository contains the same sharding rules and table metadata as your YAML
(with correct indentation and existing physical shards), startup will recognize
the table and the query should pass.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]