joelle-a-dev opened a new pull request, #39659:
URL: https://github.com/apache/shardingsphere/pull/39659
Fixes #37766.
Changes proposed in this pull request:
Oracle's dictionary views (`ALL_TABLES`, `ALL_SEQUENCES`, etc.) live in the
`SYS` schema, but you can query them without writing `SYS.ALL_TABLES`.
Oracle resolves the unqualified name for you. ShardingSphere didn't know
that. This PR teaches it: add the YAML table definitions for those views under
`SYS`, and tell the binder that `SYS` is Oracle's default system schema, the
same way it already knows Postgres's default system schema is `pg_catalog`.
This PR built upon #38388 (approved, then reverted) but differs in
implementation.
#38388 added an Oracle-specific `if ("Oracle".equals(...))` branch directly
inside the generic `SimpleTableSegmentBinder` shared code every dialect binds
through. Which broke the SPI-based pluggable design, where dialect-specific
behavior is supposed to live behind each dialect's own extension points.
This PR doesn't touch `SimpleTableSegmentBinder` at all. It only implements
Oracle's own `DialectSchemaOption`/`DialectSystemDatabase` extension points,
the exact mechanism PostgreSQL already uses for `pg_catalog`. The existing
generic binder logic (system-schema-checked-first) just works once Oracle's
dialect classes report `SYS` correctly, no shared-code changes required.
Worth noting: `OracleSystemDatabase` also lists `SYSTEM_LOBS` as a system
schema (pre-existing). I couldn't confirm `SYSTEM_LOBS` is a real Oracle schema
as it's not in Oracle's documented list of system-maintained users. It's
harmless here as it just resolves to an empty schema, but flagging it in case
someone with more Oracle context wants to double-check or remove it separately.
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/)
- [ ] I have disclosed the tool and affected files or scope for any material
AI assistance, as required by the [AI-assisted contribution policy].
--
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]