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/07/22 03:03:18 UTC
[PR] Enforce case sensitivity for mysql columns, indexes, and constraints [shardingsphere]
menghaoranss opened a new pull request, #39210:
URL: https://github.com/apache/shardingsphere/pull/39210
Changes proposed in this pull request:
- Enforce case sensitivity for mysql columns, indexes, and constraints
---
Before committing this PR, I'm sure that I have checked the following options:
- [ ] 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] Enforce case sensitivity for mysql columns, indexes, and constraints [shardingsphere]
Posted by "menghaoranss (via GitHub)" <gi...@apache.org>.
menghaoranss commented on PR #39210:
URL: https://github.com/apache/shardingsphere/pull/39210#issuecomment-5042931437
```markdown
### Correction
- **Previous Finding:** MCP directly propagated the MySQL storage policy into identifier matching, making mixed-case column matching case-sensitive.
- **Current Status:** Withdrawn
- **Reason:** The latest head replaces the direct storage-policy propagation with `DatabaseIdentifierContext` and uses metadata-policy matching throughout MCP.
### Summary
**Review Result: Mergeable**
**Reason:** The latest patch correctly separates storage normalization from metadata matching and closes the previously identified MCP propagation gap. This result is code-scope only; CI was not reviewed by request.
### Evidence
- [`MySQLIdentifierCasePolicyProvider`](https://github.com/apache/shardingsphere/blob/7f932ee18a61af3b67eb2ffbcdb9abd8271ad185/database/connector/dialect/mysql/src/main/java/org/apache/shardingsphere/database/connector/mysql/metadata/identifier/MySQLIdentifierCasePolicyProvider.java#L60-L69) preserves the original case of columns, indexes, and constraints at the storage-normalization layer without changing table behavior.
- [`DatabaseIdentifierContextFactory`](https://github.com/apache/shardingsphere/blob/7f932ee18a61af3b67eb2ffbcdb9abd8271ad185/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/identifier/DatabaseIdentifierContextFactory.java#L57-L64) now creates a complete protocol, storage, and metadata identifier context from one database type and data source.
- [`MCPJdbcDatabaseProfileLoader`](https://github.com/apache/shardingsphere/blob/7f932ee18a61af3b67eb2ffbcdb9abd8271ad185/mcp/support/src/main/java/org/apache/shardingsphere/mcp/support/database/metadata/jdbc/MCPJdbcDatabaseProfileLoader.java#L79-L92) propagates that context instead of exposing the raw storage policy.
- [`WorkflowSQLUtils`](https://github.com/apache/shardingsphere/blob/7f932ee18a61af3b67eb2ffbcdb9abd8271ad185/mcp/support/src/main/java/org/apache/shardingsphere/mcp/support/workflow/service/WorkflowSQLUtils.java#L131-L138), database visibility validation, and cross-schema validation now use `matchesMetaData` while preserving quoted-identifier information.
- The factory test verifies that MySQL column storage normalization preserves case while metadata column matching remains case-insensitive and table matching retains database-specific behavior.
- No direct `IdentifierCasePolicySet` or `IdentifierCasePolicyResolver.resolveStorage` usage remains in MCP production code.
### Review Details
- **Review Focus:** Code Correctness Review. CI not reviewed by request.
- **Reviewed Scope:** All 28 changed files across the MySQL connector, `infra/common`, and MCP support, core, bootstrap, Encrypt, and Mask modules. Latest head: `7f932ee18a61af3b67eb2ffbcdb9abd8271ad185`; local merge-base: `9bd9eaa6e55d96e5db03d9fdac4d359795ba8829`. The local triple-dot scope matched GitHub’s file list.
- **Not Reviewed Scope:** GitHub Actions and external database E2E execution.
- **Verification:** Focused current-head test run completed with exit code 0: 507 tests passed with no failures or errors. `spotless:check checkstyle:check -Pcheck -T1C` completed with exit code 0 and no formatting or Checkstyle violations.
- **Release Note / User Docs:** Not required; this corrects internal identifier normalization and matching ownership without introducing user configuration or migration requirements.
```
--
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] Enforce case sensitivity for mysql columns, indexes, and constraints [shardingsphere]
Posted by "menghaoranss (via GitHub)" <gi...@apache.org>.
menghaoranss merged PR #39210:
URL: https://github.com/apache/shardingsphere/pull/39210
--
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