You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "menghaoranss (via GitHub)" <gi...@apache.org> on 2026/04/13 08:24:42 UTC

[PR] Unify single-table schema identity and normalize default-schema casing across loaders and routes [shardingsphere]

menghaoranss opened a new pull request, #38617:
URL: https://github.com/apache/shardingsphere/pull/38617

   
   
   Changes proposed in this pull request:
   This change consolidates single-table schema identity rules and fixes casing inconsistencies when the database has no default schema (e.g., Oracle/Firebird). Previously, schema names derived from the logical database name could be stored in the original case during load while lookups relied on identifier rules, causing mismatches in single-table routing and metadata.
   
   - Key updates:
   
   - Normalize logical database name casing (UPPER_CASE / LOWER_CASE / KEEP_ORIGIN) when it is used as a schema:
     - SchemaMetaDataLoader now normalizes databaseName when default schema is absent.
     - DataNode construction now normalizes databaseName for schema derivation under the same rule.
   - Single rule configuration expansion uses defaultSchema.isPresent() consistently (aligned with SchemaMetaDataLoader and DataNode).
   - Router/engine adjustments pass ShardingSphereDatabase as a method parameter and standardize new parameter ordering.
   - Tests updated to match the new canonical schema behavior, including:
     - Firebird schema loader expectation now uses FOO_DB.
     - Oracle normalization case added in DataNodeTest.
     - Schema loader test covers UPPER_CASE normalization.
     - Single rule qualified-table assertions relaxed to avoid case/null schema drift from test mocks.
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   - [ ] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Unify single-table schema identity and normalize default-schema casing across loaders and routes [shardingsphere]

Posted by "menghaoranss (via GitHub)" <gi...@apache.org>.
menghaoranss commented on PR #38617:
URL: https://github.com/apache/shardingsphere/pull/38617#issuecomment-4235115498

   The remaining mergeability gap is closed by your test result.
   
   - Findings
   There are no remaining blockers on the latest head 501ad7ce7340226e59b372e1e5a5c2ecb6ace9b4. The quoted finding is outdated now: SingleRule.java (line 157) and SingleRule.java (line 212) both use IdentifierScope.SCHEMA, not DATABASE, so the previous shared semantic drift is fixed. The earlier getDefaultSchemaName() issue is also closed, because ShardingSphereDatabase.java (line 307) is now consumed by the production path in SingleRule.java (line 195).
   
   - Merge Verdict
   Mergeable
   
   The only reason I did not mark it mergeable in the previous round was incomplete validation of the affected kernel/single/core test set in this sandbox, due the local Mockito inline / Byte Buddy attach limitation. You have now confirmed that this command passes in your environment:
   
   sh mvnw -pl kernel/single/core -am -DskipITs -Dspotless.skip=true -Dtest=SingleRuleTest,SingleRouteEngineTest,SingleSQLRouterTest,SingleSQLFederationDeciderTest -Dsurefire.failIfNoSpecifiedTests=false test
   Combined with the latest-head code review, that is sufficient to close the final validation gap. I do not see a remaining shared semantic regression, default-schema fallback mismatch, or single-table routing regression on the current PR head.
   
   - Reviewed Scope
   
   SingleRule.java
   SingleSQLRouter.java
   SingleRouteEngine.java
   SingleSQLFederationDecider.java
   ShardingSphereDatabase.java
   DataNode.java
   SchemaMetaDataLoader.java


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Unify single-table schema identity and normalize default-schema casing across loaders and routes [shardingsphere]

Posted by "menghaoranss (via GitHub)" <gi...@apache.org>.
menghaoranss merged PR #38617:
URL: https://github.com/apache/shardingsphere/pull/38617


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org