You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2026/03/17 10:16:00 UTC
(shardingsphere) branch master updated: Revert "Add core Oracle system schema tables and set SYS as default (#38388)" (#38485)
This is an automated email from the ASF dual-hosted git repository.
menghaoran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new ea83842ed20 Revert "Add core Oracle system schema tables and set SYS as default (#38388)" (#38485)
ea83842ed20 is described below
commit ea83842ed20682e97b66e52c97005fa282a3706b
Author: Haoran Meng <me...@gmail.com>
AuthorDate: Tue Mar 17 18:15:54 2026 +0800
Revert "Add core Oracle system schema tables and set SYS as default (#38388)" (#38485)
---
.../metadata/database/OracleSystemDatabase.java | 49 ----
.../database/option/OracleSchemaOption.java | 2 +-
....metadata.database.system.DialectSystemDatabase | 18 --
.../resources/schema/oracle/sys/all_sequences.yaml | 73 ------
.../resources/schema/oracle/sys/all_synonyms.yaml | 49 ----
.../schema/oracle/sys/all_tab_columns.yaml | 205 ---------------
.../resources/schema/oracle/sys/all_tables.yaml | 283 ---------------------
.../resources/schema/oracle/sys/all_views.yaml | 97 -------
.../resources/schema/oracle/sys/user_tables.yaml | 277 --------------------
.../database/OracleSystemDatabaseTest.java | 42 ---
.../database/option/OracleSchemaOptionTest.java | 6 +-
.../dml/from/type/SimpleTableSegmentBinder.java | 29 +--
.../test/it/sql/binder/SQLBinderIT.java | 4 -
.../binder/src/test/resources/cases/dml/select.xml | 65 -----
.../binder/src/test/resources/sqls/dml/select.xml | 4 -
.../parser/src/main/resources/case/dml/select.xml | 9 -
.../main/resources/sql/supported/dml/select.xml | 1 -
17 files changed, 4 insertions(+), 1209 deletions(-)
diff --git a/database/connector/dialect/oracle/src/main/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/OracleSystemDatabase.java b/database/connector/dialect/oracle/src/main/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/OracleSystemDatabase.java
deleted file mode 100644
index 613c4dd95a2..00000000000
--- a/database/connector/dialect/oracle/src/main/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/OracleSystemDatabase.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.database.connector.oracle.metadata.database;
-
-import org.apache.shardingsphere.database.connector.core.metadata.database.system.DialectSystemDatabase;
-
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * System database for Oracle.
- */
-public final class OracleSystemDatabase implements DialectSystemDatabase {
-
- @Override
- public Collection<String> getSystemDatabases() {
- return Collections.emptyList();
- }
-
- @Override
- public Collection<String> getSystemSchemas() {
- return Collections.singletonList("SYS");
- }
-
- @Override
- public Collection<String> getSystemSchemas(final String databaseName) {
- return Collections.singletonList("SYS");
- }
-
- @Override
- public String getDatabaseType() {
- return "Oracle";
- }
-}
diff --git a/database/connector/dialect/oracle/src/main/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/option/OracleSchemaOption.java b/database/connector/dialect/oracle/src/main/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/option/OracleSchemaOption.java
index 7143b906793..9e1391b9aa8 100644
--- a/database/connector/dialect/oracle/src/main/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/option/OracleSchemaOption.java
+++ b/database/connector/dialect/oracle/src/main/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/option/OracleSchemaOption.java
@@ -52,6 +52,6 @@ public final class OracleSchemaOption implements DialectSchemaOption {
@Override
public Optional<String> getDefaultSystemSchema() {
- return Optional.of("SYS");
+ return delegate.getDefaultSystemSchema();
}
}
diff --git a/database/connector/dialect/oracle/src/main/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.metadata.database.system.DialectSystemDatabase b/database/connector/dialect/oracle/src/main/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.metadata.database.system.DialectSystemDatabase
deleted file mode 100644
index 35daab0c62b..00000000000
--- a/database/connector/dialect/oracle/src/main/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.metadata.database.system.DialectSystemDatabase
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.shardingsphere.database.connector.oracle.metadata.database.OracleSystemDatabase
diff --git a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_sequences.yaml b/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_sequences.yaml
deleted file mode 100644
index 26daf0768b4..00000000000
--- a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_sequences.yaml
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-name: all_sequences
-columns:
- SEQUENCE_OWNER:
- caseSensitive: false
- dataType: 12
- generated: false
- name: SEQUENCE_OWNER
- primaryKey: false
- SEQUENCE_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: SEQUENCE_NAME
- primaryKey: false
- MIN_VALUE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: MIN_VALUE
- primaryKey: false
- MAX_VALUE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: MAX_VALUE
- primaryKey: false
- INCREMENT_BY:
- caseSensitive: false
- dataType: 2
- generated: false
- name: INCREMENT_BY
- primaryKey: false
- CYCLE_FLAG:
- caseSensitive: false
- dataType: 12
- generated: false
- name: CYCLE_FLAG
- primaryKey: false
- ORDER_FLAG:
- caseSensitive: false
- dataType: 12
- generated: false
- name: ORDER_FLAG
- primaryKey: false
- CACHE_SIZE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: CACHE_SIZE
- primaryKey: false
- LAST_NUMBER:
- caseSensitive: false
- dataType: 2
- generated: false
- name: LAST_NUMBER
- primaryKey: false
diff --git a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_synonyms.yaml b/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_synonyms.yaml
deleted file mode 100644
index 701eb01e8a8..00000000000
--- a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_synonyms.yaml
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-name: all_synonyms
-columns:
- OWNER:
- caseSensitive: false
- dataType: 12
- generated: false
- name: OWNER
- primaryKey: false
- SYNONYM_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: SYNONYM_NAME
- primaryKey: false
- TABLE_OWNER:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TABLE_OWNER
- primaryKey: false
- TABLE_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TABLE_NAME
- primaryKey: false
- DB_LINK:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DB_LINK
- primaryKey: false
diff --git a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_tab_columns.yaml b/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_tab_columns.yaml
deleted file mode 100644
index b22de5bc633..00000000000
--- a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_tab_columns.yaml
+++ /dev/null
@@ -1,205 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-name: all_tab_columns
-columns:
- OWNER:
- caseSensitive: false
- dataType: 12
- generated: false
- name: OWNER
- primaryKey: false
- TABLE_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TABLE_NAME
- primaryKey: false
- COLUMN_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: COLUMN_NAME
- primaryKey: false
- DATA_TYPE:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DATA_TYPE
- primaryKey: false
- DATA_TYPE_MOD:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DATA_TYPE_MOD
- primaryKey: false
- DATA_TYPE_OWNER:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DATA_TYPE_OWNER
- primaryKey: false
- DATA_LENGTH:
- caseSensitive: false
- dataType: 2
- generated: false
- name: DATA_LENGTH
- primaryKey: false
- DATA_PRECISION:
- caseSensitive: false
- dataType: 2
- generated: false
- name: DATA_PRECISION
- primaryKey: false
- DATA_SCALE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: DATA_SCALE
- primaryKey: false
- NULLABLE:
- caseSensitive: false
- dataType: 12
- generated: false
- name: NULLABLE
- primaryKey: false
- COLUMN_ID:
- caseSensitive: false
- dataType: 2
- generated: false
- name: COLUMN_ID
- primaryKey: false
- DEFAULT_LENGTH:
- caseSensitive: false
- dataType: 2
- generated: false
- name: DEFAULT_LENGTH
- primaryKey: false
- DATA_DEFAULT:
- caseSensitive: false
- dataType: -1
- generated: false
- name: DATA_DEFAULT
- primaryKey: false
- NUM_DISTINCT:
- caseSensitive: false
- dataType: 2
- generated: false
- name: NUM_DISTINCT
- primaryKey: false
- LOW_VALUE:
- caseSensitive: false
- dataType: -3
- generated: false
- name: LOW_VALUE
- primaryKey: false
- HIGH_VALUE:
- caseSensitive: false
- dataType: -3
- generated: false
- name: HIGH_VALUE
- primaryKey: false
- DENSITY:
- caseSensitive: false
- dataType: 2
- generated: false
- name: DENSITY
- primaryKey: false
- NUM_NULLS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: NUM_NULLS
- primaryKey: false
- NUM_BUCKETS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: NUM_BUCKETS
- primaryKey: false
- LAST_ANALYZED:
- caseSensitive: false
- dataType: 93
- generated: false
- name: LAST_ANALYZED
- primaryKey: false
- SAMPLE_SIZE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: SAMPLE_SIZE
- primaryKey: false
- CHARACTER_SET_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: CHARACTER_SET_NAME
- primaryKey: false
- CHAR_COL_DECL_LENGTH:
- caseSensitive: false
- dataType: 2
- generated: false
- name: CHAR_COL_DECL_LENGTH
- primaryKey: false
- GLOBAL_STATS:
- caseSensitive: false
- dataType: 12
- generated: false
- name: GLOBAL_STATS
- primaryKey: false
- USER_STATS:
- caseSensitive: false
- dataType: 12
- generated: false
- name: USER_STATS
- primaryKey: false
- AVG_COL_LEN:
- caseSensitive: false
- dataType: 2
- generated: false
- name: AVG_COL_LEN
- primaryKey: false
- CHAR_LENGTH:
- caseSensitive: false
- dataType: 2
- generated: false
- name: CHAR_LENGTH
- primaryKey: false
- CHAR_USED:
- caseSensitive: false
- dataType: 12
- generated: false
- name: CHAR_USED
- primaryKey: false
- V80_FMT_IMAGE:
- caseSensitive: false
- dataType: 12
- generated: false
- name: V80_FMT_IMAGE
- primaryKey: false
- DATA_UPGRADED:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DATA_UPGRADED
- primaryKey: false
- HISTOGRAM:
- caseSensitive: false
- dataType: 12
- generated: false
- name: HISTOGRAM
- primaryKey: false
diff --git a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_tables.yaml b/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_tables.yaml
deleted file mode 100644
index ffb4acccb70..00000000000
--- a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_tables.yaml
+++ /dev/null
@@ -1,283 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-name: all_tables
-columns:
- OWNER:
- caseSensitive: false
- dataType: 12
- generated: false
- name: OWNER
- primaryKey: false
- TABLE_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TABLE_NAME
- primaryKey: false
- TABLESPACE_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TABLESPACE_NAME
- primaryKey: false
- CLUSTER_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: CLUSTER_NAME
- primaryKey: false
- IOT_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: IOT_NAME
- primaryKey: false
- STATUS:
- caseSensitive: false
- dataType: 12
- generated: false
- name: STATUS
- primaryKey: false
- PCT_FREE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: PCT_FREE
- primaryKey: false
- PCT_USED:
- caseSensitive: false
- dataType: 2
- generated: false
- name: PCT_USED
- primaryKey: false
- INI_TRANS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: INI_TRANS
- primaryKey: false
- MAX_TRANS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: MAX_TRANS
- primaryKey: false
- INITIAL_EXTENT:
- caseSensitive: false
- dataType: 2
- generated: false
- name: INITIAL_EXTENT
- primaryKey: false
- NEXT_EXTENT:
- caseSensitive: false
- dataType: 2
- generated: false
- name: NEXT_EXTENT
- primaryKey: false
- MIN_EXTENTS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: MIN_EXTENTS
- primaryKey: false
- MAX_EXTENTS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: MAX_EXTENTS
- primaryKey: false
- LOGGING:
- caseSensitive: false
- dataType: 12
- generated: false
- name: LOGGING
- primaryKey: false
- BACKED_UP:
- caseSensitive: false
- dataType: 12
- generated: false
- name: BACKED_UP
- primaryKey: false
- NUM_ROWS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: NUM_ROWS
- primaryKey: false
- BLOCKS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: BLOCKS
- primaryKey: false
- EMPTY_BLOCKS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: EMPTY_BLOCKS
- primaryKey: false
- AVG_SPACE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: AVG_SPACE
- primaryKey: false
- CHAIN_CNT:
- caseSensitive: false
- dataType: 2
- generated: false
- name: CHAIN_CNT
- primaryKey: false
- AVG_ROW_LEN:
- caseSensitive: false
- dataType: 2
- generated: false
- name: AVG_ROW_LEN
- primaryKey: false
- DEGREE:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DEGREE
- primaryKey: false
- INSTANCES:
- caseSensitive: false
- dataType: 12
- generated: false
- name: INSTANCES
- primaryKey: false
- CACHE:
- caseSensitive: false
- dataType: 12
- generated: false
- name: CACHE
- primaryKey: false
- TABLE_LOCK:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TABLE_LOCK
- primaryKey: false
- SAMPLE_SIZE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: SAMPLE_SIZE
- primaryKey: false
- LAST_ANALYZED:
- caseSensitive: false
- dataType: 93
- generated: false
- name: LAST_ANALYZED
- primaryKey: false
- PARTITIONED:
- caseSensitive: false
- dataType: 12
- generated: false
- name: PARTITIONED
- primaryKey: false
- IOT_TYPE:
- caseSensitive: false
- dataType: 12
- generated: false
- name: IOT_TYPE
- primaryKey: false
- TEMPORARY:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TEMPORARY
- primaryKey: false
- SECONDARY:
- caseSensitive: false
- dataType: 12
- generated: false
- name: SECONDARY
- primaryKey: false
- NESTED:
- caseSensitive: false
- dataType: 12
- generated: false
- name: NESTED
- primaryKey: false
- BUFFER_POOL:
- caseSensitive: false
- dataType: 12
- generated: false
- name: BUFFER_POOL
- primaryKey: false
- ROW_MOVEMENT:
- caseSensitive: false
- dataType: 12
- generated: false
- name: ROW_MOVEMENT
- primaryKey: false
- GLOBAL_STATS:
- caseSensitive: false
- dataType: 12
- generated: false
- name: GLOBAL_STATS
- primaryKey: false
- USER_STATS:
- caseSensitive: false
- dataType: 12
- generated: false
- name: USER_STATS
- primaryKey: false
- DURATION:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DURATION
- primaryKey: false
- SKIP_CORRUPT:
- caseSensitive: false
- dataType: 12
- generated: false
- name: SKIP_CORRUPT
- primaryKey: false
- MONITORING:
- caseSensitive: false
- dataType: 12
- generated: false
- name: MONITORING
- primaryKey: false
- CLUSTER_OWNER:
- caseSensitive: false
- dataType: 12
- generated: false
- name: CLUSTER_OWNER
- primaryKey: false
- DEPENDENCIES:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DEPENDENCIES
- primaryKey: false
- COMPRESSION:
- caseSensitive: false
- dataType: 12
- generated: false
- name: COMPRESSION
- primaryKey: false
- DROPPED:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DROPPED
- primaryKey: false
diff --git a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_views.yaml b/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_views.yaml
deleted file mode 100644
index 802abf0f4b3..00000000000
--- a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/all_views.yaml
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-name: all_views
-columns:
- OWNER:
- caseSensitive: false
- dataType: 12
- generated: false
- name: OWNER
- primaryKey: false
- VIEW_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: VIEW_NAME
- primaryKey: false
- TEXT_LENGTH:
- caseSensitive: false
- dataType: 2
- generated: false
- name: TEXT_LENGTH
- primaryKey: false
- TEXT:
- caseSensitive: false
- dataType: -1
- generated: false
- name: TEXT
- primaryKey: false
- TYPE_TEXT_LENGTH:
- caseSensitive: false
- dataType: 2
- generated: false
- name: TYPE_TEXT_LENGTH
- primaryKey: false
- TYPE_TEXT:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TYPE_TEXT
- primaryKey: false
- OID_TEXT_LENGTH:
- caseSensitive: false
- dataType: 2
- generated: false
- name: OID_TEXT_LENGTH
- primaryKey: false
- OID_TEXT:
- caseSensitive: false
- dataType: 12
- generated: false
- name: OID_TEXT
- primaryKey: false
- VIEW_TYPE_OWNER:
- caseSensitive: false
- dataType: 12
- generated: false
- name: VIEW_TYPE_OWNER
- primaryKey: false
- VIEW_TYPE:
- caseSensitive: false
- dataType: 12
- generated: false
- name: VIEW_TYPE
- primaryKey: false
- SUPERVIEW_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: SUPERVIEW_NAME
- primaryKey: false
- EDITIONING_VIEW:
- caseSensitive: false
- dataType: 12
- generated: false
- name: EDITIONING_VIEW
- primaryKey: false
- READ_ONLY:
- caseSensitive: false
- dataType: 12
- generated: false
- name: READ_ONLY
- primaryKey: false
diff --git a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/user_tables.yaml b/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/user_tables.yaml
deleted file mode 100644
index 642815e45a7..00000000000
--- a/database/connector/dialect/oracle/src/main/resources/schema/oracle/sys/user_tables.yaml
+++ /dev/null
@@ -1,277 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-name: user_tables
-columns:
- TABLE_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TABLE_NAME
- primaryKey: false
- TABLESPACE_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TABLESPACE_NAME
- primaryKey: false
- CLUSTER_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: CLUSTER_NAME
- primaryKey: false
- IOT_NAME:
- caseSensitive: false
- dataType: 12
- generated: false
- name: IOT_NAME
- primaryKey: false
- STATUS:
- caseSensitive: false
- dataType: 12
- generated: false
- name: STATUS
- primaryKey: false
- PCT_FREE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: PCT_FREE
- primaryKey: false
- PCT_USED:
- caseSensitive: false
- dataType: 2
- generated: false
- name: PCT_USED
- primaryKey: false
- INI_TRANS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: INI_TRANS
- primaryKey: false
- MAX_TRANS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: MAX_TRANS
- primaryKey: false
- INITIAL_EXTENT:
- caseSensitive: false
- dataType: 2
- generated: false
- name: INITIAL_EXTENT
- primaryKey: false
- NEXT_EXTENT:
- caseSensitive: false
- dataType: 2
- generated: false
- name: NEXT_EXTENT
- primaryKey: false
- MIN_EXTENTS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: MIN_EXTENTS
- primaryKey: false
- MAX_EXTENTS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: MAX_EXTENTS
- primaryKey: false
- LOGGING:
- caseSensitive: false
- dataType: 12
- generated: false
- name: LOGGING
- primaryKey: false
- BACKED_UP:
- caseSensitive: false
- dataType: 12
- generated: false
- name: BACKED_UP
- primaryKey: false
- NUM_ROWS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: NUM_ROWS
- primaryKey: false
- BLOCKS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: BLOCKS
- primaryKey: false
- EMPTY_BLOCKS:
- caseSensitive: false
- dataType: 2
- generated: false
- name: EMPTY_BLOCKS
- primaryKey: false
- AVG_SPACE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: AVG_SPACE
- primaryKey: false
- CHAIN_CNT:
- caseSensitive: false
- dataType: 2
- generated: false
- name: CHAIN_CNT
- primaryKey: false
- AVG_ROW_LEN:
- caseSensitive: false
- dataType: 2
- generated: false
- name: AVG_ROW_LEN
- primaryKey: false
- DEGREE:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DEGREE
- primaryKey: false
- INSTANCES:
- caseSensitive: false
- dataType: 12
- generated: false
- name: INSTANCES
- primaryKey: false
- CACHE:
- caseSensitive: false
- dataType: 12
- generated: false
- name: CACHE
- primaryKey: false
- TABLE_LOCK:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TABLE_LOCK
- primaryKey: false
- SAMPLE_SIZE:
- caseSensitive: false
- dataType: 2
- generated: false
- name: SAMPLE_SIZE
- primaryKey: false
- LAST_ANALYZED:
- caseSensitive: false
- dataType: 93
- generated: false
- name: LAST_ANALYZED
- primaryKey: false
- PARTITIONED:
- caseSensitive: false
- dataType: 12
- generated: false
- name: PARTITIONED
- primaryKey: false
- IOT_TYPE:
- caseSensitive: false
- dataType: 12
- generated: false
- name: IOT_TYPE
- primaryKey: false
- TEMPORARY:
- caseSensitive: false
- dataType: 12
- generated: false
- name: TEMPORARY
- primaryKey: false
- SECONDARY:
- caseSensitive: false
- dataType: 12
- generated: false
- name: SECONDARY
- primaryKey: false
- NESTED:
- caseSensitive: false
- dataType: 12
- generated: false
- name: NESTED
- primaryKey: false
- BUFFER_POOL:
- caseSensitive: false
- dataType: 12
- generated: false
- name: BUFFER_POOL
- primaryKey: false
- ROW_MOVEMENT:
- caseSensitive: false
- dataType: 12
- generated: false
- name: ROW_MOVEMENT
- primaryKey: false
- GLOBAL_STATS:
- caseSensitive: false
- dataType: 12
- generated: false
- name: GLOBAL_STATS
- primaryKey: false
- USER_STATS:
- caseSensitive: false
- dataType: 12
- generated: false
- name: USER_STATS
- primaryKey: false
- DURATION:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DURATION
- primaryKey: false
- SKIP_CORRUPT:
- caseSensitive: false
- dataType: 12
- generated: false
- name: SKIP_CORRUPT
- primaryKey: false
- MONITORING:
- caseSensitive: false
- dataType: 12
- generated: false
- name: MONITORING
- primaryKey: false
- CLUSTER_OWNER:
- caseSensitive: false
- dataType: 12
- generated: false
- name: CLUSTER_OWNER
- primaryKey: false
- DEPENDENCIES:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DEPENDENCIES
- primaryKey: false
- COMPRESSION:
- caseSensitive: false
- dataType: 12
- generated: false
- name: COMPRESSION
- primaryKey: false
- DROPPED:
- caseSensitive: false
- dataType: 12
- generated: false
- name: DROPPED
- primaryKey: false
diff --git a/database/connector/dialect/oracle/src/test/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/OracleSystemDatabaseTest.java b/database/connector/dialect/oracle/src/test/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/OracleSystemDatabaseTest.java
deleted file mode 100644
index 2a08c032ba0..00000000000
--- a/database/connector/dialect/oracle/src/test/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/OracleSystemDatabaseTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.database.connector.oracle.metadata.database;
-
-import org.apache.shardingsphere.database.connector.core.metadata.database.system.DialectSystemDatabase;
-import org.apache.shardingsphere.database.connector.core.spi.DatabaseTypedSPILoader;
-import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
-import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
-import org.junit.jupiter.api.Test;
-
-import java.util.Collection;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-class OracleSystemDatabaseTest {
-
- @Test
- void assertGetSystemSchemas() {
- DatabaseType databaseType = TypedSPILoader.getService(DatabaseType.class, "Oracle");
- DialectSystemDatabase actual = DatabaseTypedSPILoader.getService(DialectSystemDatabase.class, databaseType);
- assertThat(actual.getDatabaseType(), is("Oracle"));
- Collection<String> systemSchemas = actual.getSystemSchemas();
- assertTrue(systemSchemas.contains("SYS"));
- }
-}
diff --git a/database/connector/dialect/oracle/src/test/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/option/OracleSchemaOptionTest.java b/database/connector/dialect/oracle/src/test/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/option/OracleSchemaOptionTest.java
index bcea5af9f90..48159996e75 100644
--- a/database/connector/dialect/oracle/src/test/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/option/OracleSchemaOptionTest.java
+++ b/database/connector/dialect/oracle/src/test/java/org/apache/shardingsphere/database/connector/oracle/metadata/database/option/OracleSchemaOptionTest.java
@@ -21,13 +21,11 @@ import org.junit.jupiter.api.Test;
import java.sql.Connection;
import java.sql.SQLException;
-import java.util.Optional;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -60,8 +58,6 @@ class OracleSchemaOptionTest {
@Test
void assertGetDefaultSystemSchema() {
- Optional<String> actual = new OracleSchemaOption().getDefaultSystemSchema();
- assertTrue(actual.isPresent());
- assertThat(actual.get(), is("SYS"));
+ assertFalse(new OracleSchemaOption().getDefaultSystemSchema().isPresent());
}
}
diff --git a/infra/binder/core/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/dml/from/type/SimpleTableSegmentBinder.java b/infra/binder/core/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/dml/from/type/SimpleTableSegmentBinder.java
index a68ba08b2f8..083b54adb4c 100644
--- a/infra/binder/core/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/dml/from/type/SimpleTableSegmentBinder.java
+++ b/infra/binder/core/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/dml/from/type/SimpleTableSegmentBinder.java
@@ -125,37 +125,12 @@ public final class SimpleTableSegmentBinder {
}
DatabaseType databaseType = binderContext.getSqlStatement().getDatabaseType();
DatabaseTypeRegistry databaseTypeRegistry = new DatabaseTypeRegistry(databaseType);
- String defaultSchemaName = databaseTypeRegistry.getDefaultSchemaName(binderContext.getCurrentDatabaseName());
- String tableName = segment.getTableName().getIdentifier().getValue();
- ShardingSphereSchema defaultSchema = binderContext.getMetaData().getDatabase(binderContext.getCurrentDatabaseName()).getSchema(defaultSchemaName);
DialectDatabaseMetaData dialectDatabaseMetaData = databaseTypeRegistry.getDialectDatabaseMetaData();
Optional<String> defaultSystemSchema = dialectDatabaseMetaData.getSchemaOption().getDefaultSystemSchema();
- if ("Oracle".equals(databaseType.getType())) {
- if (null != defaultSchema && defaultSchema.containsTable(tableName)) {
- return Optional.of(new IdentifierValue(defaultSchemaName));
- }
-
- if (!defaultSystemSchema.isPresent()) {
- return Optional.of(new IdentifierValue(defaultSchemaName));
- }
-
- if (!SystemSchemaManager.isSystemTable(databaseType.getType(), defaultSystemSchema.get(), tableName)) {
- return Optional.of(new IdentifierValue(defaultSchemaName));
- }
-
- ShardingSphereSchema sysSchema =
- binderContext.getMetaData().getDatabase(binderContext.getCurrentDatabaseName()).getSchema(defaultSystemSchema.get());
-
- if (null != sysSchema && sysSchema.containsTable(tableName)) {
- return Optional.of(new IdentifierValue(defaultSystemSchema.get()));
- }
-
- return Optional.of(new IdentifierValue(defaultSchemaName));
- }
- if (defaultSystemSchema.isPresent() && SystemSchemaManager.isSystemTable(databaseType.getType(), defaultSystemSchema.get(), tableName)) {
+ if (defaultSystemSchema.isPresent() && SystemSchemaManager.isSystemTable(databaseType.getType(), defaultSystemSchema.get(), segment.getTableName().getIdentifier().getValue())) {
return Optional.of(new IdentifierValue(defaultSystemSchema.get()));
}
- return Optional.of(new IdentifierValue(defaultSchemaName));
+ return Optional.of(new IdentifierValue(databaseTypeRegistry.getDefaultSchemaName(binderContext.getCurrentDatabaseName())));
}
private static void checkTableExists(final SQLStatementBinderContext binderContext, final ShardingSphereSchema schema, final String tableName, final SimpleTableSegment segment) {
diff --git a/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java b/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java
index 54627b498fd..7c6516bae24 100644
--- a/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java
+++ b/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java
@@ -28,7 +28,6 @@ import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.resource.ResourceMetaData;
import org.apache.shardingsphere.infra.metadata.database.rule.RuleMetaData;
-import org.apache.shardingsphere.infra.metadata.database.schema.builder.SystemSchemaBuilder;
import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereColumn;
import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereIndex;
import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema;
@@ -61,7 +60,6 @@ import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import java.util.Properties;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -101,8 +99,6 @@ public abstract class SQLBinderIT {
String defaultSchemaName = new DatabaseTypeRegistry(databaseType).getDefaultSchemaName(databaseName);
Collection<ShardingSphereTable> tables = "foo_db_1".equalsIgnoreCase(databaseName) ? mockFooDB1Tables() : mockFooDB2Tables();
result.add(new ShardingSphereSchema(defaultSchemaName, databaseType, tables, Collections.emptyList()));
- Map<String, ShardingSphereSchema> systemSchemas = SystemSchemaBuilder.build(databaseName, databaseType, new ConfigurationProperties(new Properties()));
- result.addAll(systemSchemas.values());
return result;
}
diff --git a/test/it/binder/src/test/resources/cases/dml/select.xml b/test/it/binder/src/test/resources/cases/dml/select.xml
index b7750fd1c7a..537ee3f19fd 100644
--- a/test/it/binder/src/test/resources/cases/dml/select.xml
+++ b/test/it/binder/src/test/resources/cases/dml/select.xml
@@ -1411,69 +1411,4 @@
</expr>
</where>
</select>
- <select sql-case-id="select_oracle_all_tables_with_column">
- <projections start-index="7" stop-index="11">
- <column-projection name="OWNER" start-index="7" stop-index="11">
- <column-bound>
- <original-database name="foo_db_1" />
- <original-schema name="SYS" />
- <original-table name="ALL_TABLES" />
- <original-column name="OWNER" start-delimiter=""" end-delimiter=""" />
- <table-source-type name="PHYSICAL_TABLE" />
- </column-bound>
- </column-projection>
- </projections>
- <from start-index="18" stop-index="27">
- <simple-table name="ALL_TABLES" start-index="18" stop-index="27">
- <table-bound>
- <original-database name="foo_db_1" />
- <original-schema name="SYS" />
- <original-table name="ALL_TABLES" />
- </table-bound>
- </simple-table>
- </from>
- </select>
- <select sql-case-id="select_oracle_all_tables_unqualified">
- <projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
- </projections>
- <from start-index="14" stop-index="23">
- <simple-table name="ALL_TABLES" start-index="14" stop-index="23">
- <table-bound>
- <original-database name="foo_db_1" />
- <original-schema name="SYS" />
- <original-table name="ALL_TABLES" />
- </table-bound>
- </simple-table>
- </from>
- </select>
- <select sql-case-id="select_oracle_all_sequences_unqualified">
- <projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
- </projections>
- <from start-index="14" stop-index="26">
- <simple-table name="ALL_SEQUENCES" start-index="14" stop-index="26">
- <table-bound>
- <original-database name="foo_db_1" />
- <original-schema name="SYS" />
- <original-table name="ALL_SEQUENCES" />
- </table-bound>
- </simple-table>
- </from>
- </select>
-
- <select sql-case-id="select_oracle_all_synonyms_unqualified">
- <projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
- </projections>
- <from start-index="14" stop-index="25">
- <simple-table name="ALL_SYNONYMS" start-index="14" stop-index="25">
- <table-bound>
- <original-database name="foo_db_1" />
- <original-schema name="SYS" />
- <original-table name="ALL_SYNONYMS" />
- </table-bound>
- </simple-table>
- </from>
- </select>
</sql-parser-test-cases>
diff --git a/test/it/binder/src/test/resources/sqls/dml/select.xml b/test/it/binder/src/test/resources/sqls/dml/select.xml
index 2b5a81129fb..3f161f36136 100644
--- a/test/it/binder/src/test/resources/sqls/dml/select.xml
+++ b/test/it/binder/src/test/resources/sqls/dml/select.xml
@@ -29,8 +29,4 @@
<sql-case id="select_with_current_select_projection_reference" value="SELECT order_id AS orderId, (SELECT orderId) AS tempOrderId FROM t_order" db-types="MySQL"/>
<sql-case id="select_with_subquery_table_alias_columns_and_order_by" value="SELECT * FROM (SELECT user_id, user_name FROM t_user WHERE user_id <= 10 UNION SELECT merchant_id, merchant_name FROM t_merchant WHERE merchant_id <= 5) AS combined(id, name) ORDER BY id" db-types="MySQL"/>
<sql-case id="select_with_outer_join_operator" value="SELECT o.order_id FROM t_order o, t_order_item i WHERE o.order_id = i.order_id(+)" db-types="Oracle"/>
- <sql-case id="select_oracle_all_tables_with_column" value="SELECT OWNER FROM ALL_TABLES" db-types="Oracle" />
- <sql-case id="select_oracle_all_tables_unqualified" value="SELECT * FROM ALL_TABLES" db-types="Oracle" />
- <sql-case id="select_oracle_all_sequences_unqualified" value="SELECT * FROM ALL_SEQUENCES" db-types="Oracle" />
- <sql-case id="select_oracle_all_synonyms_unqualified" value="SELECT * FROM ALL_SYNONYMS" db-types="Oracle" />
</sql-cases>
diff --git a/test/it/parser/src/main/resources/case/dml/select.xml b/test/it/parser/src/main/resources/case/dml/select.xml
index 68d0f04d3dd..d41d24ca8c5 100644
--- a/test/it/parser/src/main/resources/case/dml/select.xml
+++ b/test/it/parser/src/main/resources/case/dml/select.xml
@@ -14448,13 +14448,4 @@
<simple-table name="table_a" start-index="14" stop-index="20" />
</from>
</select>
-
- <select sql-case-id="select_oracle_all_tables_unqualified">
- <projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
- </projections>
- <from start-index="14" stop-index="23">
- <simple-table name="ALL_TABLES" start-index="14" stop-index="23" />
- </from>
- </select>
</sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/select.xml b/test/it/parser/src/main/resources/sql/supported/dml/select.xml
index d004caa48b4..6bbad212261 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/select.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/select.xml
@@ -539,5 +539,4 @@
<sql-case id="select_group_by_match_against_with_rollup" value="SELECT 1 FROM t GROUP BY a, MATCH (a) AGAINST ('abc') WITH ROLLUP;" db-types="MySQL" />
<sql-case id="select_for_system_time_as_of_hive" value="SELECT * FROM table_a FOR SYSTEM_TIME AS OF '2021-08-09 10:35:57';" db-types="Hive" />
<sql-case id="select_for_system_version_as_of_hive" value="SELECT * FROM table_a FOR SYSTEM_VERSION AS OF 1234567;" db-types="Hive" />
- <sql-case id="select_oracle_all_tables_unqualified" value="SELECT * FROM ALL_TABLES" db-types="Oracle" />
</sql-cases>