You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/11/06 13:17:38 UTC
[GitHub] [shardingsphere] 743834110 opened a new pull request, #21980: fix ShardingSphereException:oracle.jdbc.driver.T4CConnection.getSchem…
743834110 opened a new pull request, #21980:
URL: https://github.com/apache/shardingsphere/pull/21980
Fixes #14463.
Changes proposed in this pull request:
- Fix ShardingSphereException:oracle.jdbc.driver.T4CConnection.getSchema() when using ojdbc6;
---
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 : `mvn clean install -B -T2C -DskipTests -Dmaven.javadoc.skip=true -e`.
- [ ] I have made corresponding changes to the documentation.
- [ ] I have added corresponding unit tests for my changes.
--
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
[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #21980: fix ShardingSphereException:oracle.jdbc.driver.T4CConnection.getSchem…
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #21980:
URL: https://github.com/apache/shardingsphere/pull/21980#discussion_r1014844593
##########
infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/dialect/OracleSchemaMetaDataLoader.java:
##########
@@ -74,7 +75,7 @@ public final class OracleSchemaMetaDataLoader implements DialectSchemaMetaDataLo
public Collection<SchemaMetaData> load(final DataSource dataSource, final Collection<String> tables, final String defaultSchemaName) throws SQLException {
Map<String, Collection<ColumnMetaData>> columnMetaDataMap = new HashMap<>(tables.size(), 1);
Map<String, Collection<IndexMetaData>> indexMetaDataMap = new HashMap<>(tables.size(), 1);
- try (Connection connection = dataSource.getConnection()) {
+ try (Connection connection = new MetaDataLoaderConnectionAdapter(DatabaseTypeFactory.getInstance("Oracle"), dataSource.getConnection())) {
Review Comment:
Why add MetaDataLoaderConnectionAdapter?
--
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
[GitHub] [shardingsphere] 743834110 commented on a diff in pull request #21980: fix ShardingSphereException:oracle.jdbc.driver.T4CConnection.getSchem…
Posted by GitBox <gi...@apache.org>.
743834110 commented on code in PR #21980:
URL: https://github.com/apache/shardingsphere/pull/21980#discussion_r1014948973
##########
infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/dialect/OracleSchemaMetaDataLoader.java:
##########
@@ -74,7 +75,7 @@ public final class OracleSchemaMetaDataLoader implements DialectSchemaMetaDataLo
public Collection<SchemaMetaData> load(final DataSource dataSource, final Collection<String> tables, final String defaultSchemaName) throws SQLException {
Map<String, Collection<ColumnMetaData>> columnMetaDataMap = new HashMap<>(tables.size(), 1);
Map<String, Collection<IndexMetaData>> indexMetaDataMap = new HashMap<>(tables.size(), 1);
- try (Connection connection = dataSource.getConnection()) {
+ try (Connection connection = new MetaDataLoaderConnectionAdapter(DatabaseTypeFactory.getInstance("Oracle"), dataSource.getConnection())) {
Review Comment:
Using ojdbc6 with defined development circumstance, there will be a NoSuchMethodError like "java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.getSchema()Ljava/lang/String;" when invoke following statement in OracleSchemaMetaDataLoader
```
private Map<String, Collection<ColumnMetaData>> loadColumnMetaDataMap(final Connection connection, final Collection<String> tables) throws SQLException {
...
preparedStatement.setString(1, connection.getSchema());
...
}
```
With debug with connection.getSchema(). We could know ojdbc6 doesn't define method T4CConnection.getSchema().
To invoke connection.getSchema() smoothly, adapt a class like MetaDataLoaderConnectionAdapter
--
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
[GitHub] [shardingsphere] strongduanmu merged pull request #21980: fix ShardingSphereException:oracle.jdbc.driver.T4CConnection.getSchem…
Posted by GitBox <gi...@apache.org>.
strongduanmu merged PR #21980:
URL: https://github.com/apache/shardingsphere/pull/21980
--
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] fix ShardingSphereException:oracle.jdbc.driver.T4CConnection.getSchem… [shardingsphere]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #21980:
URL: https://github.com/apache/shardingsphere/pull/21980#issuecomment-4160782125
## [Codecov](https://app.codecov.io/gh/apache/shardingsphere/pull/21980?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 60.83%. Comparing base ([`b57b515`](https://app.codecov.io/gh/apache/shardingsphere/commit/b57b515cdbaeb48d8725acaf56225f0a813f50bc?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`bb10634`](https://app.codecov.io/gh/apache/shardingsphere/commit/bb10634758191a68b3f70208ef07aff19e9b9431?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 12369 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #21980 +/- ##
============================================
- Coverage 60.85% 60.83% -0.02%
Complexity 2467 2467
============================================
Files 4104 4104
Lines 57225 57241 +16
Branches 9688 9691 +3
============================================
+ Hits 34823 34824 +1
- Misses 19462 19477 +15
Partials 2940 2940
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/shardingsphere/pull/21980?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
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