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

   
   Changes proposed in this pull request:
     - Make unquoted schema lookup case-insensitive for PostgresSQL
   
   **PR Title**  
   Refine PostgreSQL/openGauss schema identifier rules: case-insensitive 
unquoted lookup with exact quoted match
   
   **PR Description**  
   ## Summary
   This PR adjusts schema identifier matching for PostgreSQL and openGauss to 
support mixed-case stored schema names while preserving quoted-identifier 
semantics.
   
   ## Changes
   - Updated PostgreSQL identifier case rule provider:
     - Override `IdentifierScope.SCHEMA` with 
`newInsensitiveRuleSet().getRule(IdentifierScope.SCHEMA)`.
     - Keep other scopes on the existing lower-case rule set.
   - Updated openGauss identifier case rule provider with the same schema-scope 
override.
   - Updated related unit tests to reflect the new schema behavior.
   
   ## Behavior After Change
   For **schema** identifiers in PostgreSQL/openGauss:
   - Unquoted lookup is case-insensitive (`LookupMode.NORMALIZED`).
   - Quoted lookup remains exact (`LookupMode.EXACT` behavior for quoted 
identifiers).
   
   Other identifier scopes (table/column/view/etc.) keep their previous 
behavior.
   
   ## Why
   Previously, PostgreSQL/openGauss schema rules filtered unquoted candidates 
by lower-case stored names.  
   That could fail when schema metadata was stored in upper-case or mixed-case 
forms.  
   This change ensures unquoted schema lookup can still resolve those names, 
while quoted lookup remains strict.
   
   ## Verification
   Executed:
   - `./mvnw -pl 
database/connector/dialect/postgresql,database/connector/dialect/opengauss -am 
-DskipITs -Dspotless.skip=true 
-Dtest=PostgreSQLIdentifierCaseRuleProviderTest,OpenGaussIdentifierCaseRuleProviderTest
 test -Dsurefire.failIfNoSpecifiedTests=false`
   - `./mvnw -pl infra/common -DskipITs -Dspotless.skip=true 
-Dtest=DatabaseIdentifierContextFactoryTest test 
-Dsurefire.failIfNoSpecifiedTests=false`
   
   All passed.
   
   ---
   
   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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to