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/06/01 10:04:40 UTC

[PR] Merge contains and get database by name for QueryContext [shardingsphere]

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

   
   Changes proposed in this pull request:
     - Merge contains and get database by name for QueryContext
   
   ---
   
   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] Merge contains and get database by name for QueryContext [shardingsphere]

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

   ### Decision
   
   - **Merge Verdict: Mergeable**
   - **Reviewed Scope:** Latest PR head `1e1b074cabdfad1bac4e7af90045450d18e0ceb6`; base `upstream/master` `0ee3f817c35aa1bdd269d752ba09c9cc43a7b39e`; merge-base `0ee3f817c35aa1bdd269d752ba09c9cc43a7b39e`.  
     File list matched GitHub `/pulls/38768/files` exactly (4 files):
     - `infra/session/src/main/java/org/apache/shardingsphere/infra/session/query/QueryContext.java`
     - `proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseProxyConnectorFactoryTest.java`
     - `proxy/frontend/dialect/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLPreparedStatementMetadataFactoryTest.java`
     - `proxy/frontend/dialect/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/bind/PostgreSQLComBindExecutorTest.java`
   - **Not Reviewed Scope:** CI/check-runs and full runtime integration were not part of this review.
   - **Need Expert Review:** No additional expert review required beyond normal module maintainers.
   
   ### Basis
   
   - Root-cause path in active call chain is `QueryContext#getUsedDatabase()` (used broadly in Proxy/JDBC execution flow); this method now uses a single metadata lookup and preserves `UnknownDatabaseException` behavior on missing DB.
   - The PR’s test adjustments are consistent with the production change: callers no longer need separate `containsDatabase(...)` stubs when `getDatabase(...)` already drives existence.
   - Fresh adversarial pass:
     - Cross-dialect/shared-path check: `getUsedDatabase()` is shared across Proxy/JDBC flows, and behavior remains stable for both existing DB and unknown DB branches.
     - Config-disabled path: no new feature flag/config branch introduced by this patch.
     - Partial-coverage risk: no unresolved semantic drift found on the modified execution path.
   
   ### Verification
   
   - Scope validation:
     - `git fetch upstream master pull/38768/head:pr-38768`
     - `git merge-base upstream/master pr-38768`
     - `git diff --name-status <merge-base>..pr-38768`
     - GitHub API `/pulls/38768` and `/pulls/38768/files` cross-check
   - Usage/impact validation:
     - `rg -n "getUsedDatabase\\(|new QueryContext\\(" infra proxy jdbc -g"*.java"`
     - Confirms `getUsedDatabase()` is the active path; `getUsedDatabases()` has no callsites in current tree.


-- 
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] Merge contains and get database by name for QueryContext [shardingsphere]

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


-- 
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