You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2025/04/13 10:29:58 UTC
(shardingsphere) branch master updated: Rename DialectDatabaseJoinOrderOption and DialectDatabaseTransactionOption (#35181)
This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 deba7114382 Rename DialectDatabaseJoinOrderOption and DialectDatabaseTransactionOption (#35181)
deba7114382 is described below
commit deba7114382d6dfed61270142427506629c447e8
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sun Apr 13 18:29:53 2025 +0800
Rename DialectDatabaseJoinOrderOption and DialectDatabaseTransactionOption (#35181)
---
.../engine/segment/dml/from/type/JoinTableSegmentBinder.java | 6 +++---
.../core/metadata/database/DialectDatabaseMetaData.java | 12 ++++++------
...nOrderOption.java => DialectDatabaseJoinOrderOption.java} | 4 ++--
...tionOption.java => DialectDatabaseTransactionOption.java} | 4 ++--
.../firebird/metadata/database/FirebirdDatabaseMetaData.java | 6 +++---
.../mysql/metadata/database/MySQLDatabaseMetaData.java | 12 ++++++------
.../metadata/database/OpenGaussDatabaseMetaData.java | 6 +++---
.../metadata/database/PostgreSQLDatabaseMetaData.java | 6 +++---
.../pushdown/jdbc/DriverJDBCPushDownExecuteExecutor.java | 4 ++--
.../jdbc/DriverJDBCPushDownExecuteUpdateExecutor.java | 4 ++--
.../proxy/backend/connector/ProxySQLExecutor.java | 4 ++--
11 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/dml/from/type/JoinTableSegmentBinder.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/dml/from/type/JoinTableSegmentBinder.java
index 5eddce65a75..af176c86aa7 100644
--- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/dml/from/type/JoinTableSegmentBinder.java
+++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/dml/from/type/JoinTableSegmentBinder.java
@@ -29,7 +29,7 @@ import org.apache.shardingsphere.infra.binder.engine.segment.dml.expression.type
import org.apache.shardingsphere.infra.binder.engine.segment.dml.from.TableSegmentBinder;
import org.apache.shardingsphere.infra.binder.engine.segment.dml.from.context.TableSegmentBinderContext;
import org.apache.shardingsphere.infra.binder.engine.statement.SQLStatementBinderContext;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.JoinOrderOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseJoinOrderOption;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
@@ -114,7 +114,7 @@ public final class JoinTableSegmentBinder {
private static Collection<ProjectionSegment> getDerivedJoinTableProjectionSegments(final JoinTableSegment segment, final DatabaseType databaseType,
final Map<String, ProjectionSegment> usingColumnsByNaturalJoin,
final Multimap<CaseInsensitiveString, TableSegmentBinderContext> tableBinderContexts) {
- JoinOrderOption joinOrderOption = new DatabaseTypeRegistry(databaseType).getDialectDatabaseMetaData().getJoinOrderOption();
+ DialectDatabaseJoinOrderOption joinOrderOption = new DatabaseTypeRegistry(databaseType).getDialectDatabaseMetaData().getJoinOrderOption();
Collection<ProjectionSegment> projectionSegments = getProjectionSegments(segment, joinOrderOption, tableBinderContexts);
if (segment.getUsing().isEmpty() && !segment.isNatural()) {
return projectionSegments;
@@ -129,7 +129,7 @@ public final class JoinTableSegmentBinder {
return result;
}
- private static Collection<ProjectionSegment> getProjectionSegments(final JoinTableSegment segment, final JoinOrderOption joinOrderOption,
+ private static Collection<ProjectionSegment> getProjectionSegments(final JoinTableSegment segment, final DialectDatabaseJoinOrderOption joinOrderOption,
final Multimap<CaseInsensitiveString, TableSegmentBinderContext> tableBinderContexts) {
Collection<ProjectionSegment> result = new LinkedList<>();
if (joinOrderOption.isRightColumnsByFirstOrder() && JoinType.RIGHT.name().equalsIgnoreCase(segment.getJoinType()) && (!segment.getUsing().isEmpty() || segment.isNatural())) {
diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/DialectDatabaseMetaData.java b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/DialectDatabaseMetaData.java
index 335babd1ffc..ab0d76db45e 100644
--- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/DialectDatabaseMetaData.java
+++ b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/DialectDatabaseMetaData.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.infra.database.core.metadata.database;
import org.apache.shardingsphere.infra.database.core.metadata.database.enums.NullsOrderType;
import org.apache.shardingsphere.infra.database.core.metadata.database.enums.QuoteCharacter;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.JoinOrderOption;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.TransactionOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseJoinOrderOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseTransactionOption;
import org.apache.shardingsphere.infra.database.core.spi.DatabaseTypedSPI;
import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
@@ -137,8 +137,8 @@ public interface DialectDatabaseMetaData extends DatabaseTypedSPI {
*
* @return transaction option
*/
- default TransactionOption getTransactionOption() {
- return new TransactionOption(false, false, false, false, true);
+ default DialectDatabaseTransactionOption getTransactionOption() {
+ return new DialectDatabaseTransactionOption(false, false, false, false, true);
}
/**
@@ -146,7 +146,7 @@ public interface DialectDatabaseMetaData extends DatabaseTypedSPI {
*
* @return join order option
*/
- default JoinOrderOption getJoinOrderOption() {
- return new JoinOrderOption(false, false);
+ default DialectDatabaseJoinOrderOption getJoinOrderOption() {
+ return new DialectDatabaseJoinOrderOption(false, false);
}
}
diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/JoinOrderOption.java b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/DialectDatabaseJoinOrderOption.java
similarity index 92%
rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/JoinOrderOption.java
rename to infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/DialectDatabaseJoinOrderOption.java
index 9a42a6e620d..4ffc83473f4 100644
--- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/JoinOrderOption.java
+++ b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/DialectDatabaseJoinOrderOption.java
@@ -21,11 +21,11 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
- * Join order option.
+ * Dialect database join order option.
*/
@RequiredArgsConstructor
@Getter
-public final class JoinOrderOption {
+public final class DialectDatabaseJoinOrderOption {
private final boolean isUsingColumnsByProjectionOrder;
diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/TransactionOption.java b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/DialectDatabaseTransactionOption.java
similarity index 94%
rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/TransactionOption.java
rename to infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/DialectDatabaseTransactionOption.java
index e0f388f7498..8efdbcd7af1 100644
--- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/TransactionOption.java
+++ b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/database/option/DialectDatabaseTransactionOption.java
@@ -21,11 +21,11 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
- * Transaction option.
+ * Dialect database transaction option.
*/
@RequiredArgsConstructor
@Getter
-public final class TransactionOption {
+public final class DialectDatabaseTransactionOption {
private final boolean isSupportGlobalCSN;
diff --git a/infra/database/type/firebird/src/main/java/org/apache/shardingsphere/infra/database/firebird/metadata/database/FirebirdDatabaseMetaData.java b/infra/database/type/firebird/src/main/java/org/apache/shardingsphere/infra/database/firebird/metadata/database/FirebirdDatabaseMetaData.java
index f43a641ecbe..fa2986a268a 100644
--- a/infra/database/type/firebird/src/main/java/org/apache/shardingsphere/infra/database/firebird/metadata/database/FirebirdDatabaseMetaData.java
+++ b/infra/database/type/firebird/src/main/java/org/apache/shardingsphere/infra/database/firebird/metadata/database/FirebirdDatabaseMetaData.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.infra.database.firebird.metadata.database;
import org.apache.shardingsphere.infra.database.core.metadata.database.DialectDatabaseMetaData;
import org.apache.shardingsphere.infra.database.core.metadata.database.enums.NullsOrderType;
import org.apache.shardingsphere.infra.database.core.metadata.database.enums.QuoteCharacter;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.TransactionOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseTransactionOption;
/**
* Database metadata of Firebird.
@@ -43,8 +43,8 @@ public final class FirebirdDatabaseMetaData implements DialectDatabaseMetaData {
}
@Override
- public TransactionOption getTransactionOption() {
- return new TransactionOption(false, true, false, false, true);
+ public DialectDatabaseTransactionOption getTransactionOption() {
+ return new DialectDatabaseTransactionOption(false, true, false, false, true);
}
@Override
diff --git a/infra/database/type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql/metadata/database/MySQLDatabaseMetaData.java b/infra/database/type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql/metadata/database/MySQLDatabaseMetaData.java
index 7c70c6d03e9..47c079a1444 100644
--- a/infra/database/type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql/metadata/database/MySQLDatabaseMetaData.java
+++ b/infra/database/type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql/metadata/database/MySQLDatabaseMetaData.java
@@ -20,8 +20,8 @@ package org.apache.shardingsphere.infra.database.mysql.metadata.database;
import org.apache.shardingsphere.infra.database.core.metadata.database.DialectDatabaseMetaData;
import org.apache.shardingsphere.infra.database.core.metadata.database.enums.NullsOrderType;
import org.apache.shardingsphere.infra.database.core.metadata.database.enums.QuoteCharacter;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.JoinOrderOption;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.TransactionOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseJoinOrderOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseTransactionOption;
import java.math.BigInteger;
import java.sql.Types;
@@ -85,13 +85,13 @@ public final class MySQLDatabaseMetaData implements DialectDatabaseMetaData {
}
@Override
- public TransactionOption getTransactionOption() {
- return new TransactionOption(false, false, true, false, true);
+ public DialectDatabaseTransactionOption getTransactionOption() {
+ return new DialectDatabaseTransactionOption(false, false, true, false, true);
}
@Override
- public JoinOrderOption getJoinOrderOption() {
- return new JoinOrderOption(true, true);
+ public DialectDatabaseJoinOrderOption getJoinOrderOption() {
+ return new DialectDatabaseJoinOrderOption(true, true);
}
@Override
diff --git a/infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/metadata/database/OpenGaussDatabaseMetaData.java b/infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/metadata/database/OpenGaussDatabaseMetaData.java
index fa869c2cd78..1556bd435e2 100644
--- a/infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/metadata/database/OpenGaussDatabaseMetaData.java
+++ b/infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/metadata/database/OpenGaussDatabaseMetaData.java
@@ -21,7 +21,7 @@ import com.cedarsoftware.util.CaseInsensitiveMap;
import org.apache.shardingsphere.infra.database.core.metadata.database.DialectDatabaseMetaData;
import org.apache.shardingsphere.infra.database.core.metadata.database.enums.NullsOrderType;
import org.apache.shardingsphere.infra.database.core.metadata.database.enums.QuoteCharacter;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.TransactionOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseTransactionOption;
import java.sql.Types;
import java.util.Map;
@@ -68,8 +68,8 @@ public final class OpenGaussDatabaseMetaData implements DialectDatabaseMetaData
}
@Override
- public TransactionOption getTransactionOption() {
- return new TransactionOption(true, false, false, true, false);
+ public DialectDatabaseTransactionOption getTransactionOption() {
+ return new DialectDatabaseTransactionOption(true, false, false, true, false);
}
@Override
diff --git a/infra/database/type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql/metadata/database/PostgreSQLDatabaseMetaData.java b/infra/database/type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql/metadata/database/PostgreSQLDatabaseMetaData.java
index 5ca211aa756..73dc6d4af64 100644
--- a/infra/database/type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql/metadata/database/PostgreSQLDatabaseMetaData.java
+++ b/infra/database/type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql/metadata/database/PostgreSQLDatabaseMetaData.java
@@ -21,7 +21,7 @@ import com.cedarsoftware.util.CaseInsensitiveMap;
import org.apache.shardingsphere.infra.database.core.metadata.database.DialectDatabaseMetaData;
import org.apache.shardingsphere.infra.database.core.metadata.database.enums.NullsOrderType;
import org.apache.shardingsphere.infra.database.core.metadata.database.enums.QuoteCharacter;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.TransactionOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseTransactionOption;
import java.sql.Types;
import java.util.Map;
@@ -81,8 +81,8 @@ public final class PostgreSQLDatabaseMetaData implements DialectDatabaseMetaData
}
@Override
- public TransactionOption getTransactionOption() {
- return new TransactionOption(false, false, false, true, false);
+ public DialectDatabaseTransactionOption getTransactionOption() {
+ return new DialectDatabaseTransactionOption(false, false, false, true, false);
}
@Override
diff --git a/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/engine/pushdown/jdbc/DriverJDBCPushDownExecuteExecutor.java b/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/engine/pushdown/jdbc/DriverJDBCPushDownExecuteExecutor.java
index a5b937b3512..f601d0a7dbf 100644
--- a/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/engine/pushdown/jdbc/DriverJDBCPushDownExecuteExecutor.java
+++ b/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/engine/pushdown/jdbc/DriverJDBCPushDownExecuteExecutor.java
@@ -27,7 +27,7 @@ import org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConne
import org.apache.shardingsphere.driver.jdbc.core.resultset.ShardingSphereResultSet;
import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.binder.context.statement.dml.SelectStatementContext;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.TransactionOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseTransactionOption;
import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup;
import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext;
@@ -132,7 +132,7 @@ public final class DriverJDBCPushDownExecuteExecutor {
}
private boolean isNeedImplicitCommit(final SQLStatementContext sqlStatementContext) {
- TransactionOption transactionOption = new DatabaseTypeRegistry(sqlStatementContext.getDatabaseType()).getDialectDatabaseMetaData().getTransactionOption();
+ DialectDatabaseTransactionOption transactionOption = new DatabaseTypeRegistry(sqlStatementContext.getDatabaseType()).getDialectDatabaseMetaData().getTransactionOption();
return !connection.getAutoCommit() && sqlStatementContext.getSqlStatement() instanceof DDLStatement && transactionOption.isDDLNeedImplicitCommit();
}
diff --git a/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/engine/pushdown/jdbc/DriverJDBCPushDownExecuteUpdateExecutor.java b/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/engine/pushdown/jdbc/DriverJDBCPushDownExecuteUpdateExecutor.java
index 169c9b262e1..2c44d3a35c7 100644
--- a/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/engine/pushdown/jdbc/DriverJDBCPushDownExecuteUpdateExecutor.java
+++ b/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/engine/pushdown/jdbc/DriverJDBCPushDownExecuteUpdateExecutor.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConne
import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.binder.context.type.TableAvailable;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.TransactionOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseTransactionOption;
import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup;
import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext;
@@ -139,7 +139,7 @@ public final class DriverJDBCPushDownExecuteUpdateExecutor {
}
private boolean isNeedImplicitCommit(final SQLStatementContext sqlStatementContext) {
- TransactionOption transactionOption = new DatabaseTypeRegistry(sqlStatementContext.getDatabaseType()).getDialectDatabaseMetaData().getTransactionOption();
+ DialectDatabaseTransactionOption transactionOption = new DatabaseTypeRegistry(sqlStatementContext.getDatabaseType()).getDialectDatabaseMetaData().getTransactionOption();
return !connection.getAutoCommit() && sqlStatementContext.getSqlStatement() instanceof DDLStatement && transactionOption.isDDLNeedImplicitCommit();
}
diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutor.java
index 96e490801d5..883a3d1daa6 100644
--- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutor.java
+++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutor.java
@@ -22,7 +22,7 @@ import lombok.Getter;
import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.binder.context.type.TableAvailable;
import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
-import org.apache.shardingsphere.infra.database.core.metadata.database.option.TransactionOption;
+import org.apache.shardingsphere.infra.database.core.metadata.database.option.DialectDatabaseTransactionOption;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
@@ -137,7 +137,7 @@ public final class ProxySQLExecutor {
}
private boolean isSupportDDLInTransaction(final DDLStatement sqlStatement) {
- TransactionOption transactionOption = new DatabaseTypeRegistry(sqlStatement.getDatabaseType()).getDialectDatabaseMetaData().getTransactionOption();
+ DialectDatabaseTransactionOption transactionOption = new DatabaseTypeRegistry(sqlStatement.getDatabaseType()).getDialectDatabaseMetaData().getTransactionOption();
boolean isDDLWithoutMetaDataChanged = isDDLWithoutMetaDataChanged(sqlStatement);
if (isInXATransaction()) {
return transactionOption.isSupportDDLInXATransaction() && (isDDLWithoutMetaDataChanged || transactionOption.isSupportMetaDataRefreshInTransaction());