From d86c4380c7d36ed5c3e698fcbae561b7d5c3586e Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 18 Jul 2023 15:05:19 +0800 Subject: [PATCH 1/3] Add shardingsphere-infra-database-mysql module --- .../proxy/ProxyMetaDataInfoExporterTest.java | 2 +- ...lemetryJDBCExecutorCallbackAdviceTest.java | 2 +- ...ncryptShowCreateTableMergedResultTest.java | 2 +- ...ncryptShowCreateTableMergedResultTest.java | 2 +- .../ShardingStatisticsTableCollector.java | 2 +- .../dal/ShardingDALResultMergerTest.java | 2 +- .../token/IndexTokenGeneratorTest.java | 2 +- ...sertClauseShardingConditionEngineTest.java | 2 +- ...ardingTableBroadcastRoutingEngineTest.java | 2 +- .../assertion/ShardingRouteAssert.java | 2 +- .../sharding/rule/ShardingRuleTest.java | 2 +- .../projection/engine/ProjectionEngine.java | 2 +- infra/common/pom.xml | 2 +- .../database/DatabaseTypeEngineTest.java | 2 +- .../metadata/ShardingSphereMetaDataTest.java | 2 +- .../builder/SystemSchemaBuilderRuleTest.java | 2 +- .../builder/SystemSchemaBuilderTest.java | 2 +- .../common/SchemaMetaDataLoaderTest.java | 2 +- .../schema/util/IndexMetaDataUtilsTest.java | 2 +- .../schema/util/SystemSchemaUtilsTest.java | 2 +- .../global/GlobalRulesBuilderTest.java | 2 +- ...dingsphere.infra.database.spi.DatabaseType | 1 - infra/database/pom.xml | 1 + infra/database/type/mysql/pom.xml | 43 ++++++++++++ .../mysql}/MySQLDataSourceMetaData.java | 2 +- .../database/mysql}/MySQLDatabaseType.java | 3 +- ...dingsphere.infra.database.spi.DatabaseType | 18 +++++ .../mysql/MySQLDataSourceMetaDataTest.java | 66 +++++++++++++++++++ .../mysql}/MySQLDatabaseTypeTest.java | 7 +- infra/database/type/pom.xml | 33 ++++++++++ .../memory/JDBCMemoryQueryResultTest.java | 2 +- .../infra/rewrite/SQLRewriteEntryTest.java | 2 +- .../ShardingSpherePreparedStatement.java | 2 +- .../statement/ShardingSphereStatement.java | 2 +- .../adapter/PreparedStatementAdapterTest.java | 2 +- ...pportedOperationPreparedStatementTest.java | 2 +- .../driver/state/DriverStateContextTest.java | 2 +- .../common/util/JDBCStreamQueryUtils.java | 2 +- ...atchDataConsistencyCalculateAlgorithm.java | 2 +- .../pipeline/core/dumper/InventoryDumper.java | 2 +- .../InventoryRecordsCountCalculator.java | 2 +- .../cdc/util/CDCSchemaTableUtilsTest.java | 2 +- .../SingleSQLFederationDeciderTest.java | 2 +- .../LoadSingleTableStatementUpdaterTest.java | 2 +- .../util/SQLFederationDataTypeUtils.java | 2 +- .../engine/SQLFederationEngineTest.java | 2 +- .../rule/SQLTranslatorRuleTest.java | 2 +- .../ConnectionSavepointManager.java | 2 +- .../mode/manager/ContextManagerTest.java | 2 +- .../ClusterModeContextManagerTest.java | 2 +- .../ProcessListChangedSubscriberTest.java | 2 +- .../ConfigurationChangedSubscriberTest.java | 2 +- ...ResourceMetaDataChangedSubscriberTest.java | 2 +- .../StateChangedSubscriberTest.java | 2 +- .../DataSourceSegmentsConverterTest.java | 2 +- .../TransactionBackendHandler.java | 2 +- .../connector/ProxySQLExecutorTest.java | 2 +- .../DefaultDatabaseMetaDataExecutorTest.java | 2 +- ...abaseOperateBackendHandlerFactoryTest.java | 2 +- .../ConvertYamlConfigurationExecutorTest.java | 2 +- ...ariableUpdatableRALBackendHandlerTest.java | 2 +- .../RuleDefinitionBackendHandlerTest.java | 2 +- .../AlterStorageUnitBackendHandlerTest.java | 2 +- ...RegisterStorageUnitBackendHandlerTest.java | 2 +- .../rul/sql/FormatSQLExecutorTest.java | 2 +- .../rul/sql/ParseDistSQLExecutorTest.java | 2 +- .../session/ConnectionSessionTest.java | 2 +- .../ShowCreateDatabaseExecutorTest.java | 2 +- .../executor/ShowDatabasesExecutorTest.java | 2 +- .../ShowFunctionStatusExecutorTest.java | 2 +- .../ShowProcedureStatusExecutorTest.java | 2 +- .../executor/ShowProcessListExecutorTest.java | 2 +- .../executor/ShowTablesExecutorTest.java | 2 +- ...SelectInformationSchemataExecutorTest.java | 2 +- ...TransactionIsolationValueProviderTest.java | 2 +- .../TransactionReadOnlyValueProviderTest.java | 2 +- .../provider/VersionValueProviderTest.java | 2 +- .../FrontDatabaseProtocolTypeFactoryTest.java | 2 +- .../MySQLComStmtExecuteExecutorTest.java | 2 +- .../MySQLComStmtPrepareExecutorTest.java | 2 +- .../MySQLComQueryPacketExecutorTest.java | 2 +- .../MySQLMultiStatementsHandlerTest.java | 2 +- .../cases/PipelineContainerComposer.java | 2 +- .../e2e/data/pipeline/cases/cdc/CDCE2EIT.java | 2 +- .../CreateTableSQLGeneratorIT.java | 2 +- .../general/MySQLMigrationGeneralE2EIT.java | 2 +- .../general/MySQLTimeTypesMigrationE2EIT.java | 2 +- .../general/RulesMigrationE2EIT.java | 2 +- .../primarykey/IndexesMigrationE2EIT.java | 2 +- .../primarykey/MariaDBMigrationE2EIT.java | 2 +- .../TextPrimaryKeyMigrationE2EIT.java | 2 +- .../cases/task/E2EIncrementalTask.java | 2 +- .../compose/DockerContainerComposer.java | 2 +- ...yClusterContainerConfigurationFactory.java | 2 +- .../framework/helper/PipelineCaseHelper.java | 2 +- .../engine/ShowProcessListE2EIT.java | 4 +- .../engine/base/TransactionBaseE2EIT.java | 2 +- .../dump/ColumnValueReaderEngineTest.java | 2 +- 98 files changed, 256 insertions(+), 98 deletions(-) create mode 100644 infra/database/type/mysql/pom.xml rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql}/MySQLDataSourceMetaData.java (97%) rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql}/MySQLDatabaseType.java (97%) create mode 100644 infra/database/type/mysql/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType create mode 100644 infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/MySQLDataSourceMetaDataTest.java rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql}/MySQLDatabaseTypeTest.java (88%) create mode 100644 infra/database/type/pom.xml diff --git a/agent/plugins/metrics/core/src/test/java/org/apache/shardingsphere/agent/plugin/metrics/core/exporter/impl/proxy/ProxyMetaDataInfoExporterTest.java b/agent/plugins/metrics/core/src/test/java/org/apache/shardingsphere/agent/plugin/metrics/core/exporter/impl/proxy/ProxyMetaDataInfoExporterTest.java index 01e7f71e245bb..25f11f9614ad2 100644 --- a/agent/plugins/metrics/core/src/test/java/org/apache/shardingsphere/agent/plugin/metrics/core/exporter/impl/proxy/ProxyMetaDataInfoExporterTest.java +++ b/agent/plugins/metrics/core/src/test/java/org/apache/shardingsphere/agent/plugin/metrics/core/exporter/impl/proxy/ProxyMetaDataInfoExporterTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.agent.plugin.metrics.core.config.MetricCollectorType; import org.apache.shardingsphere.agent.plugin.metrics.core.config.MetricConfiguration; import org.apache.shardingsphere.agent.plugin.metrics.core.fixture.collector.MetricsCollectorFixture; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.metadata.persist.MetaDataPersistService; diff --git a/agent/plugins/tracing/type/opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/OpenTelemetryJDBCExecutorCallbackAdviceTest.java b/agent/plugins/tracing/type/opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/OpenTelemetryJDBCExecutorCallbackAdviceTest.java index a02b02e84b456..3e8578a169c81 100644 --- a/agent/plugins/tracing/type/opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/OpenTelemetryJDBCExecutorCallbackAdviceTest.java +++ b/agent/plugins/tracing/type/opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/OpenTelemetryJDBCExecutorCallbackAdviceTest.java @@ -34,7 +34,7 @@ import org.apache.shardingsphere.agent.plugin.tracing.opentelemetry.constant.OpenTelemetryConstants; import org.apache.shardingsphere.agent.plugin.tracing.opentelemetry.fixture.JDBCExecutorCallbackFixture; import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.context.ExecutionUnit; import org.apache.shardingsphere.infra.executor.sql.context.SQLUnit; import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit; diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/DecoratedEncryptShowCreateTableMergedResultTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/DecoratedEncryptShowCreateTableMergedResultTest.java index 9231e005f5d2c..959b477f700cf 100644 --- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/DecoratedEncryptShowCreateTableMergedResultTest.java +++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/DecoratedEncryptShowCreateTableMergedResultTest.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.encrypt.rule.EncryptRule; import org.apache.shardingsphere.encrypt.rule.EncryptTable; import org.apache.shardingsphere.infra.binder.statement.dal.ShowCreateTableStatementContext; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.merge.result.MergedResult; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment; diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/MergedEncryptShowCreateTableMergedResultTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/MergedEncryptShowCreateTableMergedResultTest.java index 5f2b037c852a7..3c74d5928e205 100644 --- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/MergedEncryptShowCreateTableMergedResultTest.java +++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/MergedEncryptShowCreateTableMergedResultTest.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.encrypt.rule.EncryptRule; import org.apache.shardingsphere.encrypt.rule.EncryptTable; import org.apache.shardingsphere.infra.binder.statement.dal.ShowCreateTableStatementContext; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment; diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/data/ShardingStatisticsTableCollector.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/data/ShardingStatisticsTableCollector.java index ee530147e4e8f..aa00fb1ae48d3 100644 --- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/data/ShardingStatisticsTableCollector.java +++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/data/ShardingStatisticsTableCollector.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.sharding.metadata.data; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.datanode.DataNode; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMergerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMergerTest.java index 2722c318fbcec..6746e953dd055 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMergerTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMergerTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext; import org.apache.shardingsphere.infra.session.connection.ConnectionContext; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult; import org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataMergedResult; import org.apache.shardingsphere.infra.merge.result.impl.transparent.TransparentMergedResult; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java index cf70decdec0cc..cb782fbea3d18 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.infra.binder.statement.ddl.AlterIndexStatementContext; import org.apache.shardingsphere.infra.binder.statement.ddl.CreateDatabaseStatementContext; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.SQLToken; import org.apache.shardingsphere.sharding.rewrite.token.generator.impl.IndexTokenGenerator; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/InsertClauseShardingConditionEngineTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/InsertClauseShardingConditionEngineTest.java index 62d362c1bf4c5..66e471b5d2594 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/InsertClauseShardingConditionEngineTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/InsertClauseShardingConditionEngineTest.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.binder.segment.insert.values.InsertValueContext; import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; import org.apache.shardingsphere.sharding.route.engine.condition.ShardingCondition; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/broadcast/ShardingTableBroadcastRoutingEngineTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/broadcast/ShardingTableBroadcastRoutingEngineTest.java index 3b4cec784b503..d0c7e532eb85b 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/broadcast/ShardingTableBroadcastRoutingEngineTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/broadcast/ShardingTableBroadcastRoutingEngineTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.infra.binder.statement.ddl.DropIndexStatementContext; import org.apache.shardingsphere.infra.binder.type.IndexAvailable; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.instance.InstanceContext; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/standard/assertion/ShardingRouteAssert.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/standard/assertion/ShardingRouteAssert.java index c8273faa6e83f..488e3f1484bfe 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/standard/assertion/ShardingRouteAssert.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/standard/assertion/ShardingRouteAssert.java @@ -26,7 +26,7 @@ import org.apache.shardingsphere.infra.session.connection.ConnectionContext; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java index c388f6962e196..aeb0a6b66483e 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeFactory; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.datanode.DataNode; import org.apache.shardingsphere.infra.instance.InstanceContext; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngine.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngine.java index 91d7e37d0dff8..956a21dff07d3 100644 --- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngine.java +++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngine.java @@ -30,7 +30,7 @@ import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.SubqueryProjection; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.DatabaseTypeEngine; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.exception.SchemaNotFoundException; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions; diff --git a/infra/common/pom.xml b/infra/common/pom.xml index 309291456e331..9b747125a4451 100644 --- a/infra/common/pom.xml +++ b/infra/common/pom.xml @@ -39,7 +39,7 @@ org.apache.shardingsphere - shardingsphere-infra-database-core + shardingsphere-infra-database-mysql ${project.version} diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java index 482026fad6881..5ec30ce0371a8 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.MariaDBDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.fixture.FixtureRuleConfiguration; import org.apache.shardingsphere.infra.util.exception.external.sql.type.wrapper.SQLWrapperException; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaDataTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaDataTest.java index f159f91cfd4e4..2952fd6d0a87b 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaDataTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaDataTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.infra.config.database.impl.DataSourceProvidedDatabaseConfiguration; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.instance.InstanceContext; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderRuleTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderRuleTest.java index 9f9584ecc4eef..5560ff29ada0a 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderRuleTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderRuleTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.infra.metadata.database.schema.builder; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.junit.jupiter.api.Test; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderTest.java index e291e11906399..7ffb11efe562d 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.infra.metadata.database.schema.builder; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/common/SchemaMetaDataLoaderTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/common/SchemaMetaDataLoaderTest.java index a17ca2f205827..9d8a805f87ad4 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/common/SchemaMetaDataLoaderTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/common/SchemaMetaDataLoaderTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.infra.metadata.database.schema.loader.common; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.junit.jupiter.api.BeforeEach; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/IndexMetaDataUtilsTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/IndexMetaDataUtilsTest.java index daa41fdae7f00..71ca75ae4e256 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/IndexMetaDataUtilsTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/IndexMetaDataUtilsTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.infra.database.core.DefaultDatabase; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtilsTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtilsTest.java index b76b235a02914..f2684648a6f30 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtilsTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtilsTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.infra.metadata.database.schema.util; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java index a5800c6e6fdaa..f06e76edbbb91 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.infra.rule.builder.global; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.rule.ShardingSphereRule; import org.apache.shardingsphere.infra.rule.builder.fixture.FixtureGlobalRule; diff --git a/infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType b/infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType index ada6eaaef5385..7a155e02b2b41 100644 --- a/infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType +++ b/infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType @@ -16,7 +16,6 @@ # org.apache.shardingsphere.infra.database.core.type.dialect.SQL92DatabaseType -org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType org.apache.shardingsphere.infra.database.core.type.dialect.MariaDBDatabaseType org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType diff --git a/infra/database/pom.xml b/infra/database/pom.xml index 2ddb73773d4f0..ec618ace393f9 100644 --- a/infra/database/pom.xml +++ b/infra/database/pom.xml @@ -30,5 +30,6 @@ spi core + type diff --git a/infra/database/type/mysql/pom.xml b/infra/database/type/mysql/pom.xml new file mode 100644 index 0000000000000..ee2f2f8e5416b --- /dev/null +++ b/infra/database/type/mysql/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-infra-database-type + 5.4.1-SNAPSHOT + + shardingsphere-infra-database-mysql + ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-infra-database-core + ${project.version} + + + + org.apache.shardingsphere + shardingsphere-test-util + ${project.version} + test + + + diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MySQLDataSourceMetaData.java b/infra/database/type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql/MySQLDataSourceMetaData.java similarity index 97% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MySQLDataSourceMetaData.java rename to infra/database/type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql/MySQLDataSourceMetaData.java index 053451b6894a2..15d602f9a2d5e 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MySQLDataSourceMetaData.java +++ b/infra/database/type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql/MySQLDataSourceMetaData.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.mysql; import lombok.Getter; import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/MySQLDatabaseType.java b/infra/database/type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql/MySQLDatabaseType.java similarity index 97% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/MySQLDatabaseType.java rename to infra/database/type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql/MySQLDatabaseType.java index 840fdb564b66b..03dc279bc6a75 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/MySQLDatabaseType.java +++ b/infra/database/type/mysql/src/main/java/org/apache/shardingsphere/infra/database/mysql/MySQLDatabaseType.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.mysql; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.MySQLDataSourceMetaData; import org.apache.shardingsphere.infra.database.core.type.TrunkDatabaseType; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; diff --git a/infra/database/type/mysql/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType b/infra/database/type/mysql/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType new file mode 100644 index 0000000000000..b044670499384 --- /dev/null +++ b/infra/database/type/mysql/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType @@ -0,0 +1,18 @@ +# +# 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.infra.database.mysql.MySQLDatabaseType diff --git a/infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/MySQLDataSourceMetaDataTest.java b/infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/MySQLDataSourceMetaDataTest.java new file mode 100644 index 0000000000000..4ce0d3fab536a --- /dev/null +++ b/infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/MySQLDataSourceMetaDataTest.java @@ -0,0 +1,66 @@ +/* + * 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.infra.database.mysql; + +import org.apache.shardingsphere.infra.database.core.metadata.UnrecognizedDatabaseURLException; +import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; +import org.apache.shardingsphere.test.util.PropertiesBuilder; +import org.apache.shardingsphere.test.util.PropertiesBuilder.Property; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.ArgumentsProvider; +import org.junit.jupiter.params.provider.ArgumentsSource; + +import java.util.Properties; +import java.util.stream.Stream; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +class MySQLDataSourceMetaDataTest { + + @ParameterizedTest(name = "{0}") + @ArgumentsSource(NewConstructorTestCaseArgumentsProvider.class) + void assertNewConstructor(final String name, final String url, final String hostname, final int port, final String catalog, final String schema, final Properties queryProps) { + DataSourceMetaData actual = new MySQLDataSourceMetaData(url); + assertThat(actual.getHostname(), is(hostname)); + assertThat(actual.getPort(), is(port)); + assertThat(actual.getCatalog(), is(catalog)); + assertThat(actual.getSchema(), is(schema)); + assertThat(actual.getQueryProperties(), is(queryProps)); + } + + @Test + void assertNewConstructorFailure() { + assertThrows(UnrecognizedDatabaseURLException.class, () -> new MySQLDataSourceMetaData("jdbc:mysql:xxxxxxxx")); + } + + private static class NewConstructorTestCaseArgumentsProvider implements ArgumentsProvider { + + @Override + public Stream provideArguments(final ExtensionContext extensionContext) { + return Stream.of( + Arguments.of("simple", "jdbc:mysql://127.0.0.1/foo_ds", "127.0.0.1", 3306, "foo_ds", null, new Properties()), + Arguments.of("complex", "jdbc:mysql:loadbalance://127.0.0.1:9999,127.0.0.2:9999/foo_ds?serverTimezone=UTC&useSSL=false", "127.0.0.1", 9999, "foo_ds", null, + PropertiesBuilder.build(new Property("serverTimezone", "UTC"), new Property("useSSL", Boolean.FALSE.toString())))); + } + } +} diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/MySQLDatabaseTypeTest.java b/infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/MySQLDatabaseTypeTest.java similarity index 88% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/MySQLDatabaseTypeTest.java rename to infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/MySQLDatabaseTypeTest.java index 2cf3482b75a85..3f0e58065043e 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/MySQLDatabaseTypeTest.java +++ b/infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/MySQLDatabaseTypeTest.java @@ -15,16 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.mysql; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.MySQLDataSourceMetaData; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; +import org.hamcrest.CoreMatchers; import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.HashSet; -import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -43,7 +42,7 @@ void assertGetJdbcUrlPrefixes() { @Test void assertGetDataSourceMetaData() { - assertThat(new MySQLDatabaseType().getDataSourceMetaData("jdbc:mysql://127.0.0.1/foo_ds", "root"), instanceOf(MySQLDataSourceMetaData.class)); + assertThat(new MySQLDatabaseType().getDataSourceMetaData("jdbc:mysql://127.0.0.1/foo_ds", "root"), CoreMatchers.instanceOf(MySQLDataSourceMetaData.class)); } @Test diff --git a/infra/database/type/pom.xml b/infra/database/type/pom.xml new file mode 100644 index 0000000000000..42a18bb43c8ab --- /dev/null +++ b/infra/database/type/pom.xml @@ -0,0 +1,33 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-infra-database + 5.4.1-SNAPSHOT + + shardingsphere-infra-database-type + pom + ${project.artifactId} + + + mysql + + diff --git a/infra/executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/memory/JDBCMemoryQueryResultTest.java b/infra/executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/memory/JDBCMemoryQueryResultTest.java index 2ebafffa79781..235dfb106a5ed 100644 --- a/infra/executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/memory/JDBCMemoryQueryResultTest.java +++ b/infra/executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/memory/JDBCMemoryQueryResultTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.infra.executor.sql.execute.result.query.impl.driver.jdbc.type.memory; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.hamcrest.core.Is; import org.junit.jupiter.api.Test; diff --git a/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/SQLRewriteEntryTest.java b/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/SQLRewriteEntryTest.java index eb0ebc1b399b8..e6eb5db360068 100644 --- a/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/SQLRewriteEntryTest.java +++ b/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/SQLRewriteEntryTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.database.core.DefaultDatabase; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.hint.HintValueContext; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java index 98f7362e01ee8..da6bf408bf59f 100644 --- a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java +++ b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java @@ -42,7 +42,7 @@ import org.apache.shardingsphere.infra.connection.kernel.KernelProcessor; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.DatabaseTypeEngine; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.audit.SQLAuditEngine; import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup; import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext; diff --git a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java index e815455e672cb..333613ee1a2b1 100644 --- a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java +++ b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java @@ -42,7 +42,7 @@ import org.apache.shardingsphere.infra.connection.kernel.KernelProcessor; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.DatabaseTypeEngine; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.audit.SQLAuditEngine; import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup; import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext; diff --git a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/PreparedStatementAdapterTest.java b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/PreparedStatementAdapterTest.java index 9d894f47e2774..0bf616767f405 100644 --- a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/PreparedStatementAdapterTest.java +++ b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/PreparedStatementAdapterTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; import org.apache.shardingsphere.parser.rule.SQLParserRule; import org.apache.shardingsphere.parser.rule.builder.DefaultSQLParserRuleConfigurationBuilder; diff --git a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationPreparedStatementTest.java b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationPreparedStatementTest.java index 97af5d5327a45..bac3a0c6eb1b2 100644 --- a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationPreparedStatementTest.java +++ b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationPreparedStatementTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; import org.apache.shardingsphere.parser.rule.SQLParserRule; import org.apache.shardingsphere.parser.rule.builder.DefaultSQLParserRuleConfigurationBuilder; diff --git a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/state/DriverStateContextTest.java b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/state/DriverStateContextTest.java index 30521512f39a9..ef32fe2f8c57c 100644 --- a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/state/DriverStateContextTest.java +++ b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/state/DriverStateContextTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/util/JDBCStreamQueryUtils.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/util/JDBCStreamQueryUtils.java index 2f0b58c9b103e..623b694096bde 100644 --- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/util/JDBCStreamQueryUtils.java +++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/util/JDBCStreamQueryUtils.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.database.core.type.BranchDatabaseType; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/algorithm/DataMatchDataConsistencyCalculateAlgorithm.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/algorithm/DataMatchDataConsistencyCalculateAlgorithm.java index a243e1853d552..883a2e2740bd2 100644 --- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/algorithm/DataMatchDataConsistencyCalculateAlgorithm.java +++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/algorithm/DataMatchDataConsistencyCalculateAlgorithm.java @@ -29,7 +29,7 @@ import org.apache.shardingsphere.data.pipeline.core.exception.PipelineSQLException; import org.apache.shardingsphere.data.pipeline.core.exception.data.PipelineTableDataConsistencyCheckLoadingFailedException; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.util.close.QuietlyCloser; import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions; import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader; diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/dumper/InventoryDumper.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/dumper/InventoryDumper.java index dbccafaa1b3a8..47e4c2ce83854 100644 --- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/dumper/InventoryDumper.java +++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/dumper/InventoryDumper.java @@ -47,7 +47,7 @@ import org.apache.shardingsphere.data.pipeline.core.exception.param.PipelineInvalidParameterException; import org.apache.shardingsphere.data.pipeline.spi.ratelimit.JobRateLimitAlgorithm; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions; import javax.sql.DataSource; diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/preparer/InventoryRecordsCountCalculator.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/preparer/InventoryRecordsCountCalculator.java index 7371637862d05..7efe0907b4fdb 100644 --- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/preparer/InventoryRecordsCountCalculator.java +++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/preparer/InventoryRecordsCountCalculator.java @@ -26,7 +26,7 @@ import org.apache.shardingsphere.data.pipeline.common.sqlbuilder.PipelineCommonSQLBuilder; import org.apache.shardingsphere.data.pipeline.core.exception.job.SplitPipelineJobByUniqueKeyException; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader; import javax.sql.DataSource; diff --git a/kernel/data-pipeline/scenario/cdc/core/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/util/CDCSchemaTableUtilsTest.java b/kernel/data-pipeline/scenario/cdc/core/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/util/CDCSchemaTableUtilsTest.java index f54ae0ca23534..0dee87e8205b5 100644 --- a/kernel/data-pipeline/scenario/cdc/core/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/util/CDCSchemaTableUtilsTest.java +++ b/kernel/data-pipeline/scenario/cdc/core/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/util/CDCSchemaTableUtilsTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.data.pipeline.cdc.util; import org.apache.shardingsphere.data.pipeline.cdc.protocol.request.StreamDataRequestBody.SchemaTable; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; diff --git a/kernel/single/core/src/test/java/org/apache/shardingsphere/single/decider/SingleSQLFederationDeciderTest.java b/kernel/single/core/src/test/java/org/apache/shardingsphere/single/decider/SingleSQLFederationDeciderTest.java index bd6aa3f85a9e4..f1061f24699ff 100644 --- a/kernel/single/core/src/test/java/org/apache/shardingsphere/single/decider/SingleSQLFederationDeciderTest.java +++ b/kernel/single/core/src/test/java/org/apache/shardingsphere/single/decider/SingleSQLFederationDeciderTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.datanode.DataNode; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; diff --git a/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/LoadSingleTableStatementUpdaterTest.java b/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/LoadSingleTableStatementUpdaterTest.java index 614c7f87c01ca..6b08b6cc55922 100644 --- a/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/LoadSingleTableStatementUpdaterTest.java +++ b/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/LoadSingleTableStatementUpdaterTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.dialect.exception.syntax.table.TableExistsException; import org.apache.shardingsphere.distsql.handler.exception.storageunit.MissingRequiredStorageUnitsException; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; import org.apache.shardingsphere.infra.rule.identifier.type.DataSourceContainedRule; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/util/SQLFederationDataTypeUtils.java b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/util/SQLFederationDataTypeUtils.java index d7d37c52474c7..0c8aaa12dc9e0 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/util/SQLFederationDataTypeUtils.java +++ b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/util/SQLFederationDataTypeUtils.java @@ -24,7 +24,7 @@ import org.apache.calcite.rel.type.RelDataTypeFactory; import org.apache.calcite.rel.type.RelDataTypeFactory.Builder; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereColumn; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/engine/SQLFederationEngineTest.java b/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/engine/SQLFederationEngineTest.java index 1f8604b01c0c9..ab89cc0d5686e 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/engine/SQLFederationEngineTest.java +++ b/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/engine/SQLFederationEngineTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.statistics.ShardingSphereStatistics; diff --git a/kernel/sql-translator/core/src/test/java/org/apache/shardingsphere/sqltranslator/rule/SQLTranslatorRuleTest.java b/kernel/sql-translator/core/src/test/java/org/apache/shardingsphere/sqltranslator/rule/SQLTranslatorRuleTest.java index 9a7d57dded253..4c64237bca300 100644 --- a/kernel/sql-translator/core/src/test/java/org/apache/shardingsphere/sqltranslator/rule/SQLTranslatorRuleTest.java +++ b/kernel/sql-translator/core/src/test/java/org/apache/shardingsphere/sqltranslator/rule/SQLTranslatorRuleTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.sqltranslator.rule; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.sqltranslator.api.config.SQLTranslatorRuleConfiguration; import org.apache.shardingsphere.sqltranslator.exception.syntax.UnsupportedTranslatedDatabaseException; diff --git a/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/ConnectionSavepointManager.java b/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/ConnectionSavepointManager.java index 9dcd59f6ffd07..0a7cfff02596c 100644 --- a/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/ConnectionSavepointManager.java +++ b/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/ConnectionSavepointManager.java @@ -20,7 +20,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeFactory; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import java.sql.Connection; import java.sql.SQLException; diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerTest.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerTest.java index 604442df3641f..41415a4943028 100644 --- a/mode/core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerTest.java +++ b/mode/core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.datanode.DataNode; import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties; import org.apache.shardingsphere.infra.instance.InstanceContext; diff --git a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManagerTest.java b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManagerTest.java index 96f355281b228..6d59b72822647 100644 --- a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManagerTest.java +++ b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManagerTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties; import org.apache.shardingsphere.infra.instance.ComputeNodeInstance; import org.apache.shardingsphere.infra.instance.InstanceContext; diff --git a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ProcessListChangedSubscriberTest.java b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ProcessListChangedSubscriberTest.java index ba14fdbaed7ed..8d6e2b9189dab 100644 --- a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ProcessListChangedSubscriberTest.java +++ b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ProcessListChangedSubscriberTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.infra.config.mode.ModeConfiguration; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.process.Process; import org.apache.shardingsphere.infra.executor.sql.process.ProcessRegistry; import org.apache.shardingsphere.infra.executor.sql.process.lock.ProcessOperationLockRegistry; diff --git a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ConfigurationChangedSubscriberTest.java b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ConfigurationChangedSubscriberTest.java index a7e6c5c870cc6..a307ee43c58c4 100644 --- a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ConfigurationChangedSubscriberTest.java +++ b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ConfigurationChangedSubscriberTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties; import org.apache.shardingsphere.infra.datasource.props.DataSourcePropertiesCreator; import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData; diff --git a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ResourceMetaDataChangedSubscriberTest.java b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ResourceMetaDataChangedSubscriberTest.java index bcbb5726eab7a..8ce0fd287bb65 100644 --- a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ResourceMetaDataChangedSubscriberTest.java +++ b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ResourceMetaDataChangedSubscriberTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.infra.config.mode.ModeConfiguration; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties; import org.apache.shardingsphere.infra.datasource.props.DataSourcePropertiesCreator; import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData; diff --git a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/StateChangedSubscriberTest.java b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/StateChangedSubscriberTest.java index 967ab962635d7..d521e8f3c29a9 100644 --- a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/StateChangedSubscriberTest.java +++ b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/StateChangedSubscriberTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.infra.config.mode.ModeConfiguration; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.datasource.state.DataSourceState; import org.apache.shardingsphere.infra.instance.ComputeNodeInstance; import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData; diff --git a/parser/distsql/statement/src/test/java/org/apache/shardingsphere/distsql/parser/segment/converter/DataSourceSegmentsConverterTest.java b/parser/distsql/statement/src/test/java/org/apache/shardingsphere/distsql/parser/segment/converter/DataSourceSegmentsConverterTest.java index 9b0af7062b696..b3b3b3c27b2a5 100644 --- a/parser/distsql/statement/src/test/java/org/apache/shardingsphere/distsql/parser/segment/converter/DataSourceSegmentsConverterTest.java +++ b/parser/distsql/statement/src/test/java/org/apache/shardingsphere/distsql/parser/segment/converter/DataSourceSegmentsConverterTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.distsql.parser.segment.DataSourceSegment; import org.apache.shardingsphere.distsql.parser.segment.HostnameAndPortBasedDataSourceSegment; import org.apache.shardingsphere.distsql.parser.segment.URLBasedDataSourceSegment; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties; import org.apache.shardingsphere.test.util.PropertiesBuilder; import org.apache.shardingsphere.test.util.PropertiesBuilder.Property; diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandler.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandler.java index 486cb7b6150ad..67982765f09fb 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandler.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandler.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.proxy.backend.handler.transaction; import org.apache.shardingsphere.dialect.exception.transaction.InTransactionException; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions; import org.apache.shardingsphere.proxy.backend.connector.TransactionManager; import org.apache.shardingsphere.proxy.backend.connector.jdbc.transaction.BackendTransactionManager; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java index 81a114302a56a..236a36056d2b0 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java @@ -27,7 +27,7 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.context.ExecutionContext; import org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.JDBCDriverType; import org.apache.shardingsphere.infra.instance.InstanceContext; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultDatabaseMetaDataExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultDatabaseMetaDataExecutorTest.java index 951c1c49fda6a..ecfbda1ca1257 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultDatabaseMetaDataExecutorTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultDatabaseMetaDataExecutorTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.authority.provider.database.model.privilege.DatabasePermittedPrivileges; import org.apache.shardingsphere.authority.rule.AuthorityRule; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/DatabaseOperateBackendHandlerFactoryTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/DatabaseOperateBackendHandlerFactoryTest.java index 45b085532ef7f..75c4dc970dae9 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/DatabaseOperateBackendHandlerFactoryTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/DatabaseOperateBackendHandlerFactoryTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.dialect.exception.syntax.database.DatabaseCreateExistsException; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationExecutorTest.java index 0773ed5fc13f3..2a53ee43cccd7 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationExecutorTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationExecutorTest.java @@ -21,7 +21,7 @@ import com.google.common.base.Strings; import lombok.SneakyThrows; import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ConvertYamlConfigurationStatement; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow; import org.apache.shardingsphere.parser.rule.SQLParserRule; import org.apache.shardingsphere.parser.rule.builder.DefaultSQLParserRuleConfigurationBuilder; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableUpdatableRALBackendHandlerTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableUpdatableRALBackendHandlerTest.java index de7ce01a98836..c02d1c4c30573 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableUpdatableRALBackendHandlerTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableUpdatableRALBackendHandlerTest.java @@ -19,7 +19,7 @@ import io.netty.util.DefaultAttributeMap; import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.SetDistVariableStatement; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.proxy.backend.exception.UnsupportedVariableException; import org.apache.shardingsphere.proxy.backend.handler.distsql.ral.UpdatableRALBackendHandler; import org.apache.shardingsphere.proxy.backend.session.ConnectionSession; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/rule/RuleDefinitionBackendHandlerTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/rule/RuleDefinitionBackendHandlerTest.java index 1a24c28f25e7e..40c8a41edb014 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/rule/RuleDefinitionBackendHandlerTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/rule/RuleDefinitionBackendHandlerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.proxy.backend.handler.distsql.rdl.rule; import io.netty.util.DefaultAttributeMap; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; import org.apache.shardingsphere.mode.manager.ContextManager; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/storage/unit/AlterStorageUnitBackendHandlerTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/storage/unit/AlterStorageUnitBackendHandlerTest.java index 0e2303997b1e3..5b465508d97f0 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/storage/unit/AlterStorageUnitBackendHandlerTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/storage/unit/AlterStorageUnitBackendHandlerTest.java @@ -26,7 +26,7 @@ import org.apache.shardingsphere.distsql.parser.segment.HostnameAndPortBasedDataSourceSegment; import org.apache.shardingsphere.distsql.parser.segment.URLBasedDataSourceSegment; import org.apache.shardingsphere.distsql.parser.statement.rdl.alter.AlterStorageUnitStatement; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; import org.apache.shardingsphere.mode.manager.ContextManager; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/storage/unit/RegisterStorageUnitBackendHandlerTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/storage/unit/RegisterStorageUnitBackendHandlerTest.java index 5d86357ca88d4..9293fb227a915 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/storage/unit/RegisterStorageUnitBackendHandlerTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/storage/unit/RegisterStorageUnitBackendHandlerTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.distsql.parser.segment.HostnameAndPortBasedDataSourceSegment; import org.apache.shardingsphere.distsql.parser.segment.URLBasedDataSourceSegment; import org.apache.shardingsphere.distsql.parser.statement.rdl.create.RegisterStorageUnitStatement; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; import org.apache.shardingsphere.infra.rule.identifier.type.DataSourceContainedRule; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/FormatSQLExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/FormatSQLExecutorTest.java index ece6e9f11fe66..de5b276da5e54 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/FormatSQLExecutorTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/FormatSQLExecutorTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.proxy.backend.handler.distsql.rul.sql; import org.apache.shardingsphere.distsql.parser.statement.rul.sql.FormatStatement; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.mode.manager.ContextManager; import org.apache.shardingsphere.proxy.backend.context.ProxyContext; import org.apache.shardingsphere.proxy.backend.handler.distsql.rul.RULBackendHandler; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/ParseDistSQLExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/ParseDistSQLExecutorTest.java index 24a5257be3867..c1b2a7f80ad57 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/ParseDistSQLExecutorTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/ParseDistSQLExecutorTest.java @@ -21,7 +21,7 @@ import com.google.gson.JsonParser; import org.apache.shardingsphere.distsql.parser.statement.rul.sql.FormatStatement; import org.apache.shardingsphere.distsql.parser.statement.rul.sql.ParseStatement; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; import org.apache.shardingsphere.mode.manager.ContextManager; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSessionTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSessionTest.java index 366fb36fcdcd7..63cd6f0cf4d12 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSessionTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSessionTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.proxy.backend.session; import org.apache.shardingsphere.infra.session.query.QueryContext; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; import org.apache.shardingsphere.mode.manager.ContextManager; import org.apache.shardingsphere.proxy.backend.connector.ProxyDatabaseConnectionManager; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowCreateDatabaseExecutorTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowCreateDatabaseExecutorTest.java index 739a79a70a872..f09ac4ebc292e 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowCreateDatabaseExecutorTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowCreateDatabaseExecutorTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowDatabasesExecutorTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowDatabasesExecutorTest.java index 54f711e9674b0..8ffaa0e45ecdc 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowDatabasesExecutorTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowDatabasesExecutorTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.authority.provider.simple.model.privilege.AllPrivilegesPermittedShardingSpherePrivileges; import org.apache.shardingsphere.authority.rule.AuthorityRule; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowFunctionStatusExecutorTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowFunctionStatusExecutorTest.java index 05d481972a37f..628aabe43650b 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowFunctionStatusExecutorTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowFunctionStatusExecutorTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcedureStatusExecutorTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcedureStatusExecutorTest.java index bca444bc50498..f0c2da5031885 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcedureStatusExecutorTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcedureStatusExecutorTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutorTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutorTest.java index 0f8e11d46c19c..85dbdac9aa2ec 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutorTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutorTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor; import io.netty.util.DefaultAttributeMap; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.process.Process; import org.apache.shardingsphere.infra.merge.result.MergedResult; import org.apache.shardingsphere.mode.manager.ContextManager; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutorTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutorTest.java index 4f552e3c460d5..1d218aff3d26d 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutorTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutorTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeFactory; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResultMetaData; import org.apache.shardingsphere.infra.merge.result.MergedResult; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/information/SelectInformationSchemataExecutorTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/information/SelectInformationSchemataExecutorTest.java index 5d0be18133c48..a2360c351832b 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/information/SelectInformationSchemataExecutorTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/information/SelectInformationSchemataExecutorTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.authority.provider.database.model.privilege.DatabasePermittedPrivileges; import org.apache.shardingsphere.authority.rule.AuthorityRule; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/TransactionIsolationValueProviderTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/TransactionIsolationValueProviderTest.java index 87db219a2ada9..084b0231958f4 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/TransactionIsolationValueProviderTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/TransactionIsolationValueProviderTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.provider; import io.netty.util.DefaultAttributeMap; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.Scope; import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.MySQLSystemVariable; import org.apache.shardingsphere.proxy.backend.session.ConnectionSession; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/TransactionReadOnlyValueProviderTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/TransactionReadOnlyValueProviderTest.java index 2e8f5e5d00de8..282d6b473d1a2 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/TransactionReadOnlyValueProviderTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/TransactionReadOnlyValueProviderTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.provider; import io.netty.util.DefaultAttributeMap; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.Scope; import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.MySQLSystemVariable; import org.apache.shardingsphere.proxy.backend.session.ConnectionSession; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/VersionValueProviderTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/VersionValueProviderTest.java index 45cb2c33482b5..e2afbc67745d2 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/VersionValueProviderTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/sysvar/provider/VersionValueProviderTest.java @@ -20,7 +20,7 @@ import io.netty.util.DefaultAttributeMap; import org.apache.shardingsphere.db.protocol.constant.DatabaseProtocolServerInfo; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader; import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.MySQLSystemVariable; import org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.sysvar.Scope; diff --git a/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/protocol/FrontDatabaseProtocolTypeFactoryTest.java b/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/protocol/FrontDatabaseProtocolTypeFactoryTest.java index 474afcd7a104d..9686b9b5c3458 100644 --- a/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/protocol/FrontDatabaseProtocolTypeFactoryTest.java +++ b/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/protocol/FrontDatabaseProtocolTypeFactoryTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.instance.InstanceContext; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; diff --git a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutorTest.java b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutorTest.java index 0ba624832376f..78e67a0d1fee7 100644 --- a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutorTest.java +++ b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutorTest.java @@ -32,7 +32,7 @@ import org.apache.shardingsphere.infra.binder.statement.UnknownSQLStatementContext; import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext; import org.apache.shardingsphere.infra.binder.statement.dml.UpdateStatementContext; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.hint.HintValueContext; import org.apache.shardingsphere.infra.session.query.QueryContext; import org.apache.shardingsphere.proxy.backend.connector.ProxyDatabaseConnectionManager; diff --git a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutorTest.java b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutorTest.java index c10d8e603b796..7f48cfce33445 100644 --- a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutorTest.java +++ b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutorTest.java @@ -32,7 +32,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext; import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext; import org.apache.shardingsphere.infra.binder.statement.dml.UpdateStatementContext; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; diff --git a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java index 7e85738928d19..f95e0f59d9acc 100644 --- a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java +++ b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLOKPacket; import org.apache.shardingsphere.db.protocol.packet.DatabasePacket; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; import org.apache.shardingsphere.logging.rule.LoggingRule; diff --git a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLMultiStatementsHandlerTest.java b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLMultiStatementsHandlerTest.java index 673a99fd384d0..695294d8e16bf 100644 --- a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLMultiStatementsHandlerTest.java +++ b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLMultiStatementsHandlerTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode; import org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineContainerComposer.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineContainerComposer.java index f534f937ec3cf..6392287249e90 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineContainerComposer.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineContainerComposer.java @@ -28,7 +28,7 @@ import org.apache.shardingsphere.data.pipeline.common.job.type.JobType; import org.apache.shardingsphere.infra.database.core.metadata.url.JdbcUrlAppender; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java index bcdc196aafeb8..1c4b8e4ce3c4a 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java @@ -36,7 +36,7 @@ import org.apache.shardingsphere.data.pipeline.core.consistencycheck.SingleTableInventoryDataConsistencyChecker; import org.apache.shardingsphere.data.pipeline.core.consistencycheck.algorithm.DataMatchDataConsistencyCalculateAlgorithm; import org.apache.shardingsphere.data.pipeline.core.consistencycheck.result.DataConsistencyCheckResult; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateAlgorithm; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java index b2e592427eedb..aa3e9e5ff44c9 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.data.pipeline.spi.ddlgenerator.CreateTableSQLGenerator; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.spi.DatabaseTypedSPILoader; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLMigrationGeneralE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLMigrationGeneralE2EIT.java index fe11c1d0c8ee7..9ded13104a19c 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLMigrationGeneralE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLMigrationGeneralE2EIT.java @@ -20,7 +20,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.tuple.Pair; import org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateAlgorithm; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLTimeTypesMigrationE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLTimeTypesMigrationE2EIT.java index 5f89b3754af40..2f2fd24ad5812 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLTimeTypesMigrationE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLTimeTypesMigrationE2EIT.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.general; import org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT; import org.apache.shardingsphere.test.e2e.data.pipeline.framework.param.PipelineE2ECondition; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/RulesMigrationE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/RulesMigrationE2EIT.java index 950eb97d21ae5..72ba608f9e008 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/RulesMigrationE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/RulesMigrationE2EIT.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.general; import org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.sharding.algorithm.keygen.UUIDKeyGenerateAlgorithm; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java index e5901d7a75bfe..bd4a75e757aab 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java @@ -20,7 +20,7 @@ import lombok.SneakyThrows; import org.apache.commons.codec.binary.Hex; import org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.util.exception.external.sql.type.wrapper.SQLWrapperException; import org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateAlgorithm; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/MariaDBMigrationE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/MariaDBMigrationE2EIT.java index 30b89c9103fba..43eef5c2f92b4 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/MariaDBMigrationE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/MariaDBMigrationE2EIT.java @@ -19,7 +19,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.sharding.algorithm.keygen.UUIDKeyGenerateAlgorithm; import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java index 49eab8703fc36..53d7fa26cb24b 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.primarykey; import org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.sharding.algorithm.keygen.UUIDKeyGenerateAlgorithm; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/task/E2EIncrementalTask.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/task/E2EIncrementalTask.java index 2d15d723c13ad..559d37f6780c2 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/task/E2EIncrementalTask.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/task/E2EIncrementalTask.java @@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.digest.DigestUtils; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/compose/DockerContainerComposer.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/compose/DockerContainerComposer.java index 079953864a7c4..4dcd0c58d19c9 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/compose/DockerContainerComposer.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/compose/DockerContainerComposer.java @@ -19,7 +19,7 @@ import lombok.Getter; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.test.e2e.data.pipeline.framework.container.config.proxy.PipelineProxyClusterContainerConfigurationFactory; import org.apache.shardingsphere.test.e2e.data.pipeline.util.DockerImageVersion; import org.apache.shardingsphere.test.e2e.env.container.atomic.adapter.AdapterContainerFactory; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java index 1eb2c7e807b89..b0cfafbb06829 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java @@ -20,7 +20,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.test.e2e.env.container.atomic.adapter.config.AdaptorContainerConfiguration; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/helper/PipelineCaseHelper.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/helper/PipelineCaseHelper.java index b223062972d88..84c3e4a6c76c1 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/helper/PipelineCaseHelper.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/helper/PipelineCaseHelper.java @@ -25,7 +25,7 @@ import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.tuple.Pair; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm; diff --git a/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/showprocesslist/engine/ShowProcessListE2EIT.java b/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/showprocesslist/engine/ShowProcessListE2EIT.java index 6d49933226aaf..8b8b84e151a0c 100644 --- a/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/showprocesslist/engine/ShowProcessListE2EIT.java +++ b/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/showprocesslist/engine/ShowProcessListE2EIT.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.test.e2e.showprocesslist.engine; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.test.e2e.showprocesslist.container.composer.ClusterShowProcessListContainerComposer; import org.apache.shardingsphere.test.e2e.showprocesslist.env.ShowProcessListEnvironment; import org.apache.shardingsphere.test.e2e.showprocesslist.env.enums.ShowProcessListEnvTypeEnum; @@ -54,7 +54,7 @@ class ShowProcessListE2EIT { @ParameterizedTest(name = "{0}") @EnabledIf("isEnabled") @ArgumentsSource(TestCaseArgumentsProvider.class) - void assertShowProcessList(final ShowProcessListTestParameter testParam) throws SQLException, InterruptedException { + void assertShowProcessList(final ShowProcessListTestParameter testParam) throws SQLException { try (ClusterShowProcessListContainerComposer containerComposer = new ClusterShowProcessListContainerComposer(testParam)) { containerComposer.start(); CompletableFuture executeSelectSleep = CompletableFuture.runAsync(getExecuteSleepThread("proxy", containerComposer)); diff --git a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/engine/base/TransactionBaseE2EIT.java b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/engine/base/TransactionBaseE2EIT.java index 3f0c729a68240..1bb88e4b5f00e 100644 --- a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/engine/base/TransactionBaseE2EIT.java +++ b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/engine/base/TransactionBaseE2EIT.java @@ -21,7 +21,7 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; import org.apache.shardingsphere.test.e2e.env.container.atomic.enums.AdapterType; diff --git a/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/dump/ColumnValueReaderEngineTest.java b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/dump/ColumnValueReaderEngineTest.java index a3d9d9658c638..60e80984ce2b6 100644 --- a/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/dump/ColumnValueReaderEngineTest.java +++ b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/dump/ColumnValueReaderEngineTest.java @@ -20,7 +20,7 @@ import com.zaxxer.hikari.HikariDataSource; import org.apache.commons.lang3.RandomStringUtils; import org.apache.shardingsphere.data.pipeline.core.dumper.ColumnValueReaderEngine; -import org.apache.shardingsphere.infra.database.core.type.dialect.MySQLDatabaseType; +import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.junit.jupiter.api.Test; import java.sql.Connection; From 4fa70b8074d6478d778940da6c3a8c5a3d40b3e8 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 18 Jul 2023 15:12:57 +0800 Subject: [PATCH 2/3] Add shardingsphere-infra-database-mariadb module --- infra/common/pom.xml | 6 +++ ...dingsphere.infra.database.spi.DatabaseType | 1 - infra/database/type/mariadb/pom.xml | 43 +++++++++++++++++++ .../mariadb}/MariaDBDataSourceMetaData.java | 2 +- .../mariadb}/MariaDBDatabaseType.java | 3 +- ...dingsphere.infra.database.spi.DatabaseType | 18 ++++++++ .../MariaDBDataSourceMetaDataTest.java | 19 ++++---- .../mariadb}/MariaDBDatabaseTypeTest.java | 3 +- infra/database/type/pom.xml | 1 + 9 files changed, 82 insertions(+), 14 deletions(-) create mode 100644 infra/database/type/mariadb/pom.xml rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/mariadb/src/main/java/org/apache/shardingsphere/infra/database/mariadb}/MariaDBDataSourceMetaData.java (97%) rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/mariadb/src/main/java/org/apache/shardingsphere/infra/database/mariadb}/MariaDBDatabaseType.java (93%) create mode 100644 infra/database/type/mariadb/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/mariadb/src/test/java/org/apache/shardingsphere/infra/database/mariadb}/MariaDBDataSourceMetaDataTest.java (81%) rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/mariadb/src/test/java/org/apache/shardingsphere/infra/database/mariadb}/MariaDBDatabaseTypeTest.java (92%) diff --git a/infra/common/pom.xml b/infra/common/pom.xml index 9b747125a4451..204e156440065 100644 --- a/infra/common/pom.xml +++ b/infra/common/pom.xml @@ -37,11 +37,17 @@ shardingsphere-infra-util ${project.version} + org.apache.shardingsphere shardingsphere-infra-database-mysql ${project.version} + + org.apache.shardingsphere + shardingsphere-infra-database-mariadb + ${project.version} + org.apache.shardingsphere diff --git a/infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType b/infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType index 7a155e02b2b41..3ab558097c77d 100644 --- a/infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType +++ b/infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType @@ -16,7 +16,6 @@ # org.apache.shardingsphere.infra.database.core.type.dialect.SQL92DatabaseType -org.apache.shardingsphere.infra.database.core.type.dialect.MariaDBDatabaseType org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType org.apache.shardingsphere.infra.database.core.type.dialect.OracleDatabaseType diff --git a/infra/database/type/mariadb/pom.xml b/infra/database/type/mariadb/pom.xml new file mode 100644 index 0000000000000..55b3938f297e0 --- /dev/null +++ b/infra/database/type/mariadb/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-infra-database-type + 5.4.1-SNAPSHOT + + shardingsphere-infra-database-mariadb + ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-infra-database-core + ${project.version} + + + + org.apache.shardingsphere + shardingsphere-test-util + ${project.version} + test + + + diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MariaDBDataSourceMetaData.java b/infra/database/type/mariadb/src/main/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDataSourceMetaData.java similarity index 97% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MariaDBDataSourceMetaData.java rename to infra/database/type/mariadb/src/main/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDataSourceMetaData.java index 4dfe7fcd39be6..8d5570cdb9bbd 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MariaDBDataSourceMetaData.java +++ b/infra/database/type/mariadb/src/main/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDataSourceMetaData.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.mariadb; import lombok.Getter; import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/MariaDBDatabaseType.java b/infra/database/type/mariadb/src/main/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDatabaseType.java similarity index 93% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/MariaDBDatabaseType.java rename to infra/database/type/mariadb/src/main/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDatabaseType.java index 2f5db435a247a..655d86ac95f5c 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/MariaDBDatabaseType.java +++ b/infra/database/type/mariadb/src/main/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDatabaseType.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.mariadb; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.MariaDBDataSourceMetaData; import org.apache.shardingsphere.infra.database.core.type.BranchDatabaseType; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader; diff --git a/infra/database/type/mariadb/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType b/infra/database/type/mariadb/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType new file mode 100644 index 0000000000000..22e1f6627f617 --- /dev/null +++ b/infra/database/type/mariadb/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType @@ -0,0 +1,18 @@ +# +# 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.infra.database.mariadb.MariaDBDatabaseType diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MariaDBDataSourceMetaDataTest.java b/infra/database/type/mariadb/src/test/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDataSourceMetaDataTest.java similarity index 81% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MariaDBDataSourceMetaDataTest.java rename to infra/database/type/mariadb/src/test/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDataSourceMetaDataTest.java index b702df0662596..4a50e66da66aa 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MariaDBDataSourceMetaDataTest.java +++ b/infra/database/type/mariadb/src/test/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDataSourceMetaDataTest.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.mariadb; import org.apache.shardingsphere.infra.database.core.metadata.UnrecognizedDatabaseURLException; +import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; import org.apache.shardingsphere.test.util.PropertiesBuilder; import org.apache.shardingsphere.test.util.PropertiesBuilder.Property; import org.junit.jupiter.api.Test; @@ -30,14 +31,21 @@ import java.util.Properties; import java.util.stream.Stream; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -class MariaDBDataSourceMetaDataTest extends AbstractDataSourceMetaDataTest { +class MariaDBDataSourceMetaDataTest { @ParameterizedTest(name = "{0}") @ArgumentsSource(NewConstructorTestCaseArgumentsProvider.class) void assertNewConstructorWithSimpleJdbcUrl(final String name, final String url, final String hostname, final int port, final String catalog, final String schema, final Properties queryProps) { - assertDataSourceMetaData(url, hostname, port, catalog, schema, queryProps); + DataSourceMetaData actual = new MariaDBDataSourceMetaData(url); + assertThat(actual.getHostname(), is(hostname)); + assertThat(actual.getPort(), is(port)); + assertThat(actual.getCatalog(), is(catalog)); + assertThat(actual.getSchema(), is(schema)); + assertThat(actual.getQueryProperties(), is(queryProps)); } @Test @@ -45,11 +53,6 @@ void assertNewConstructorFailure() { assertThrows(UnrecognizedDatabaseURLException.class, () -> new MariaDBDataSourceMetaData("jdbc:mariadb:xxxxxxxx")); } - @Override - protected MariaDBDataSourceMetaData createDataSourceMetaData(final String url) { - return new MariaDBDataSourceMetaData(url); - } - private static class NewConstructorTestCaseArgumentsProvider implements ArgumentsProvider { @Override diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/MariaDBDatabaseTypeTest.java b/infra/database/type/mariadb/src/test/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDatabaseTypeTest.java similarity index 92% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/MariaDBDatabaseTypeTest.java rename to infra/database/type/mariadb/src/test/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDatabaseTypeTest.java index a11fc8fa42c25..90483bfba357e 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/MariaDBDatabaseTypeTest.java +++ b/infra/database/type/mariadb/src/test/java/org/apache/shardingsphere/infra/database/mariadb/MariaDBDatabaseTypeTest.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.mariadb; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.MariaDBDataSourceMetaData; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; import org.junit.jupiter.api.Test; diff --git a/infra/database/type/pom.xml b/infra/database/type/pom.xml index 42a18bb43c8ab..db504c345985e 100644 --- a/infra/database/type/pom.xml +++ b/infra/database/type/pom.xml @@ -29,5 +29,6 @@ mysql + mariadb From 4020225b82a853b4ec86eb3ac72360fb7f655280 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 18 Jul 2023 17:12:06 +0800 Subject: [PATCH 3/3] Add shardingsphere-infra-database-type modules --- .../ShardingStatisticsTableCollector.java | 4 +- .../impl/ProjectionsTokenGenerator.java | 2 +- .../ShardingSQLFederationDeciderTest.java | 2 +- .../projection/impl/SubqueryProjection.java | 2 +- infra/common/pom.xml | 30 ++++++ .../schema/util/SystemSchemaUtils.java | 2 +- ...greSQLShardingSphereStatisticsBuilder.java | 2 +- .../database/DatabaseTypeEngineTest.java | 6 +- .../metadata/ShardingSphereMetaDataTest.java | 2 +- .../builder/SystemSchemaBuilderRuleTest.java | 4 +- .../builder/SystemSchemaBuilderTest.java | 4 +- .../common/SchemaMetaDataLoaderTest.java | 4 +- .../schema/util/SystemSchemaUtilsTest.java | 4 +- .../core/type/DatabaseTypeFactory.java | 2 +- .../core/metadata/DataSourceMetaDataTest.java | 81 ---------------- .../AbstractDataSourceMetaDataTest.java | 39 -------- .../dialect/MySQLDataSourceMetaDataTest.java | 63 ------------ .../metadata/url/JdbcUrlAppenderTest.java | 8 +- .../core/type/DatabaseTypeFactoryTest.java | 2 +- .../fixture/DataSourceMetaDataFixture.java | 63 ++++++++++++ .../InfraBranchDatabaseTypeFixture.java | 2 +- .../InfraTrunkDatabaseTypeFixture.java | 7 +- infra/database/type/h2/pom.xml | 48 +++++++++ .../database/h2}/H2DataSourceMetaData.java | 2 +- .../infra/database/h2}/H2DatabaseType.java | 3 +- ...dingsphere.infra.database.spi.DatabaseType | 7 +- .../h2}/H2DataSourceMetaDataTest.java | 19 ++-- .../database/h2}/H2DatabaseTypeTest.java | 3 +- infra/database/type/mariadb/pom.xml | 7 +- infra/database/type/opengauss/pom.xml | 43 ++++++++ .../OpenGaussDataSourceMetaData.java | 2 +- .../opengauss}/OpenGaussDatabaseType.java | 3 +- ...dingsphere.infra.database.spi.DatabaseType | 18 ++++ .../OpenGaussDataSourceMetaDataTest.java | 21 ++-- .../opengauss/OpenGaussDatabaseTypeTest.java | 97 +++++++++++++++++++ infra/database/type/oracle/pom.xml | 43 ++++++++ .../oracle}/OracleDataSourceMetaData.java | 2 +- .../database/oracle}/OracleDatabaseType.java | 3 +- ...dingsphere.infra.database.spi.DatabaseType | 18 ++++ .../oracle}/OracleDataSourceMetaDataTest.java | 21 ++-- .../oracle}/OracleDatabaseTypeTest.java | 5 +- infra/database/type/pom.xml | 6 ++ infra/database/type/postgresql/pom.xml | 43 ++++++++ .../PostgreSQLDataSourceMetaData.java | 2 +- .../postgresql}/PostgreSQLDatabaseType.java | 3 +- ...dingsphere.infra.database.spi.DatabaseType | 18 ++++ .../PostgreSQLDataSourceMetaDataTest.java | 19 ++-- .../PostgreSQLDatabaseTypeTest.java | 3 +- infra/database/type/sql92/pom.xml | 43 ++++++++ .../sql92}/SQL92DataSourceMetaData.java | 2 +- .../database/sql92}/SQL92DatabaseType.java | 8 +- ...dingsphere.infra.database.spi.DatabaseType | 18 ++++ .../sql92}/SQL92DataSourceMetaDataTest.java | 21 ++-- .../sql92}/SQL92DatabaseTypeTest.java | 3 +- infra/database/type/sqlserver/pom.xml | 43 ++++++++ .../SQLServerDataSourceMetaData.java | 2 +- .../sqlserver}/SQLServerDatabaseType.java | 3 +- ...dingsphere.infra.database.spi.DatabaseType | 18 ++++ .../SQLServerDataSourceMetaDataTest.java | 22 +++-- .../sqlserver}/SQLServerDatabaseTypeTest.java | 3 +- .../infra/rewrite/SQLRewriteEntryTest.java | 2 +- .../SubstitutableColumnNameTokenTest.java | 2 +- .../common/util/JDBCStreamQueryUtils.java | 2 +- .../PipelineDataSourceWrapperTest.java | 2 +- ...andardPipelineTableMetaDataLoaderTest.java | 2 +- .../wal/OpenGaussLogicalReplication.java | 2 +- .../cdc/core/prepare/CDCJobPreparer.java | 2 +- .../cdc/handler/CDCBackendHandler.java | 2 +- .../cdc/util/CDCSchemaTableUtilsTest.java | 2 +- .../enumerable/EnumerableScanExecutor.java | 2 +- .../compiler/it/SQLStatementCompilerIT.java | 2 +- .../rule/SQLTranslatorRuleTest.java | 2 +- .../transaction/rule/TransactionRuleTest.java | 4 +- .../ClusterModeContextManagerTest.java | 2 +- .../DatabaseConnectorFactoryTest.java | 2 +- .../datasource/JDBCBackendDataSourceTest.java | 2 +- .../backend/context/ProxyContextTest.java | 2 +- .../UnicastDatabaseBackendHandlerTest.java | 2 +- .../rul/sql/ParseDistSQLExecutorTest.java | 2 +- .../executor/UseDatabaseExecutorTest.java | 2 +- ...ssSystemCatalogAdminQueryExecutorTest.java | 2 +- .../OpenGaussComBatchBindExecutorTest.java | 2 +- .../command/query/extended/PortalTest.java | 2 +- ...dBatchedStatementsCommandExecutorTest.java | 2 +- ...stgreSQLBatchedStatementsExecutorTest.java | 2 +- .../bind/PostgreSQLComBindExecutorTest.java | 2 +- .../PostgreSQLComDescribeExecutorTest.java | 2 +- .../parse/PostgreSQLComParseExecutorTest.java | 2 +- .../cases/PipelineContainerComposer.java | 4 +- .../e2e/data/pipeline/cases/cdc/CDCE2EIT.java | 4 +- .../CreateTableSQLGeneratorIT.java | 4 +- .../migration/AbstractMigrationE2EIT.java | 4 +- .../PostgreSQLMigrationGeneralE2EIT.java | 4 +- .../primarykey/IndexesMigrationE2EIT.java | 2 +- .../TextPrimaryKeyMigrationE2EIT.java | 4 +- .../cases/task/E2EIncrementalTask.java | 4 +- ...yClusterContainerConfigurationFactory.java | 4 +- .../framework/helper/PipelineCaseHelper.java | 4 +- .../engine/base/TransactionBaseE2EIT.java | 4 +- ...yClusterContainerConfigurationFactory.java | 4 +- .../e2e/env/DataSetEnvironmentManager.java | 4 +- ...DataConsistencyCalculateAlgorithmTest.java | 2 +- 102 files changed, 735 insertions(+), 355 deletions(-) delete mode 100644 infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/DataSourceMetaDataTest.java delete mode 100644 infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/AbstractDataSourceMetaDataTest.java delete mode 100644 infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MySQLDataSourceMetaDataTest.java create mode 100644 infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/DataSourceMetaDataFixture.java create mode 100644 infra/database/type/h2/pom.xml rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2}/H2DataSourceMetaData.java (98%) rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2}/H2DatabaseType.java (93%) rename infra/database/{core => type/h2}/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType (62%) rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/h2/src/test/java/org/apache/shardingsphere/infra/database/h2}/H2DataSourceMetaDataTest.java (89%) rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/h2/src/test/java/org/apache/shardingsphere/infra/database/h2}/H2DatabaseTypeTest.java (93%) create mode 100644 infra/database/type/opengauss/pom.xml rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss}/OpenGaussDataSourceMetaData.java (96%) rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss}/OpenGaussDatabaseType.java (97%) create mode 100644 infra/database/type/opengauss/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss}/OpenGaussDataSourceMetaDataTest.java (79%) create mode 100644 infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDatabaseTypeTest.java create mode 100644 infra/database/type/oracle/pom.xml rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle}/OracleDataSourceMetaData.java (97%) rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle}/OracleDatabaseType.java (96%) create mode 100644 infra/database/type/oracle/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle}/OracleDataSourceMetaDataTest.java (86%) rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle}/OracleDatabaseTypeTest.java (94%) create mode 100644 infra/database/type/postgresql/pom.xml rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql}/PostgreSQLDataSourceMetaData.java (96%) rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql}/PostgreSQLDatabaseType.java (96%) create mode 100644 infra/database/type/postgresql/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql}/PostgreSQLDataSourceMetaDataTest.java (81%) rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql}/PostgreSQLDatabaseTypeTest.java (95%) create mode 100644 infra/database/type/sql92/pom.xml rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92}/SQL92DataSourceMetaData.java (96%) rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92}/SQL92DatabaseType.java (92%) create mode 100644 infra/database/type/sql92/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92}/SQL92DataSourceMetaDataTest.java (76%) rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92}/SQL92DatabaseTypeTest.java (92%) create mode 100644 infra/database/type/sqlserver/pom.xml rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver}/SQLServerDataSourceMetaData.java (97%) rename infra/database/{core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver}/SQLServerDatabaseType.java (92%) create mode 100644 infra/database/type/sqlserver/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect => type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver}/SQLServerDataSourceMetaDataTest.java (83%) rename infra/database/{core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect => type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver}/SQLServerDatabaseTypeTest.java (93%) diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/data/ShardingStatisticsTableCollector.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/data/ShardingStatisticsTableCollector.java index aa00fb1ae48d3..d29790c302516 100644 --- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/data/ShardingStatisticsTableCollector.java +++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/data/ShardingStatisticsTableCollector.java @@ -19,8 +19,8 @@ import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.datanode.DataNode; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ProjectionsTokenGenerator.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ProjectionsTokenGenerator.java index a644e8d198cf4..c073cbc2af1f1 100644 --- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ProjectionsTokenGenerator.java +++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ProjectionsTokenGenerator.java @@ -26,7 +26,7 @@ import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext; import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OracleDatabaseType; +import org.apache.shardingsphere.infra.database.oracle.OracleDatabaseType; import org.apache.shardingsphere.infra.rewrite.sql.token.generator.OptionalSQLTokenGenerator; import org.apache.shardingsphere.infra.rewrite.sql.token.generator.aware.RouteContextAware; import org.apache.shardingsphere.infra.route.context.RouteContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/decider/ShardingSQLFederationDeciderTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/decider/ShardingSQLFederationDeciderTest.java index 56320808c6dec..38a0443c1dbeb 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/decider/ShardingSQLFederationDeciderTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/decider/ShardingSQLFederationDeciderTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.datanode.DataNode; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/SubqueryProjection.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/SubqueryProjection.java index 725a889eb4fa4..c21aac17c1150 100644 --- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/SubqueryProjection.java +++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/SubqueryProjection.java @@ -24,7 +24,7 @@ import lombok.ToString; import org.apache.shardingsphere.infra.binder.segment.select.projection.Projection; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OracleDatabaseType; +import org.apache.shardingsphere.infra.database.oracle.OracleDatabaseType; import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue; import java.util.Optional; diff --git a/infra/common/pom.xml b/infra/common/pom.xml index 204e156440065..159df29e050ab 100644 --- a/infra/common/pom.xml +++ b/infra/common/pom.xml @@ -48,6 +48,36 @@ shardingsphere-infra-database-mariadb ${project.version} + + org.apache.shardingsphere + shardingsphere-infra-database-postgresql + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-database-opengauss + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-database-oracle + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-database-sqlserver + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-database-h2 + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-database-sql92 + ${project.version} + org.apache.shardingsphere diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtils.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtils.java index 77f5519356648..e2f3e88a397f8 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtils.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtils.java @@ -20,7 +20,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ExpressionProjectionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment; diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/statistics/builder/dialect/PostgreSQLShardingSphereStatisticsBuilder.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/statistics/builder/dialect/PostgreSQLShardingSphereStatisticsBuilder.java index d55caba5449d6..13898d44f608c 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/statistics/builder/dialect/PostgreSQLShardingSphereStatisticsBuilder.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/statistics/builder/dialect/PostgreSQLShardingSphereStatisticsBuilder.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.infra.metadata.statistics.builder.dialect; import org.apache.shardingsphere.infra.autogen.version.ShardingSphereVersion; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.statistics.ShardingSphereStatistics; import org.apache.shardingsphere.infra.metadata.statistics.ShardingSphereDatabaseData; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java index 5ec30ce0371a8..814c865b76da1 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java @@ -21,10 +21,10 @@ import org.apache.shardingsphere.infra.config.database.impl.DataSourceProvidedDatabaseConfiguration; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; -import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.MariaDBDatabaseType; +import org.apache.shardingsphere.infra.database.mariadb.MariaDBDatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.fixture.FixtureRuleConfiguration; import org.apache.shardingsphere.infra.util.exception.external.sql.type.wrapper.SQLWrapperException; import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaDataTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaDataTest.java index 2952fd6d0a87b..7a15d29170667 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaDataTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaDataTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.instance.InstanceContext; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderRuleTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderRuleTest.java index 5560ff29ada0a..46085d7789162 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderRuleTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderRuleTest.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.infra.metadata.database.schema.builder; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderTest.java index 7ffb11efe562d..8adaca48248d7 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/SystemSchemaBuilderTest.java @@ -19,8 +19,8 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; import org.junit.jupiter.api.Test; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/common/SchemaMetaDataLoaderTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/common/SchemaMetaDataLoaderTest.java index 9d8a805f87ad4..ce34154180488 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/common/SchemaMetaDataLoaderTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/common/SchemaMetaDataLoaderTest.java @@ -19,8 +19,8 @@ import org.apache.shardingsphere.infra.database.core.DefaultDatabase; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtilsTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtilsTest.java index f2684648a6f30..b5ed9991004c2 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtilsTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SystemSchemaUtilsTest.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.infra.metadata.database.schema.util; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.junit.jupiter.api.Test; diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactory.java b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactory.java index c9ab085ac91d8..9f1d5a332714c 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactory.java +++ b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactory.java @@ -41,7 +41,7 @@ public final class DatabaseTypeFactory { public static DatabaseType get(final String url) { Collection databaseTypes = ShardingSphereServiceLoader.getServiceInstances(DatabaseType.class).stream().filter(each -> matchURLs(url, each)).collect(Collectors.toList()); if (databaseTypes.isEmpty()) { - return TypedSPILoader.getService(DatabaseType.class, "SQL92"); + return TypedSPILoader.getService(DatabaseType.class, null); } for (DatabaseType each : databaseTypes) { if (each instanceof BranchDatabaseType) { diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/DataSourceMetaDataTest.java b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/DataSourceMetaDataTest.java deleted file mode 100644 index 161caed87c373..0000000000000 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/DataSourceMetaDataTest.java +++ /dev/null @@ -1,81 +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.infra.database.core.metadata; - -import org.apache.shardingsphere.infra.database.core.metadata.dialect.H2DataSourceMetaData; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.MariaDBDataSourceMetaData; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.MySQLDataSourceMetaData; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.OracleDataSourceMetaData; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.PostgreSQLDataSourceMetaData; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.SQL92DataSourceMetaData; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.SQLServerDataSourceMetaData; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -class DataSourceMetaDataTest { - - @Test - void assertIsInSameDatabaseInstanceWithH2() { - H2DataSourceMetaData actual1 = new H2DataSourceMetaData("jdbc:h2:tcp://localhost:8082/~/test1/test2;DB_CLOSE_DELAY=-1"); - H2DataSourceMetaData actual2 = new H2DataSourceMetaData("jdbc:h2:tcp://localhost:8082/~/test1/test2;DB_CLOSE_DELAY=-1"); - assertTrue(actual1.isInSameDatabaseInstance(actual2)); - } - - @Test - void assertIsInSameDatabaseInstanceWithMysql() { - MySQLDataSourceMetaData actual1 = new MySQLDataSourceMetaData("jdbc:mysql://127.0.0.1:9999/ds_1?serverTimezone=UTC&useSSL=false"); - MySQLDataSourceMetaData actual2 = new MySQLDataSourceMetaData("jdbc:mysql://127.0.0.1:9999/ds_0?serverTimezone=UTC&useSSL=false"); - assertTrue(actual1.isInSameDatabaseInstance(actual2)); - } - - @Test - void assertIsInSameDatabaseInstanceWithOracle() { - OracleDataSourceMetaData actual1 = new OracleDataSourceMetaData("jdbc:oracle:thin:@//127.0.0.1:9999/ds_0", "test"); - OracleDataSourceMetaData actual2 = new OracleDataSourceMetaData("jdbc:oracle:thin:@//127.0.0.1:9999/ds_1", "test"); - assertTrue(actual1.isInSameDatabaseInstance(actual2)); - } - - @Test - void assertIsInSameDatabaseInstanceWithMariaDB() { - MariaDBDataSourceMetaData actual1 = new MariaDBDataSourceMetaData("jdbc:mariadb://127.0.0.1:9999/ds_0?serverTimezone=UTC&useSSL=false"); - MariaDBDataSourceMetaData actual2 = new MariaDBDataSourceMetaData("jdbc:mariadb://127.0.0.1:9999/ds_1?serverTimezone=UTC&useSSL=false"); - assertTrue(actual1.isInSameDatabaseInstance(actual2)); - } - - @Test - void assertIsInSameDatabaseInstanceWithPostgreSQL() { - PostgreSQLDataSourceMetaData actual1 = new PostgreSQLDataSourceMetaData("jdbc:postgresql://127.0.0.1/ds_0"); - PostgreSQLDataSourceMetaData actual2 = new PostgreSQLDataSourceMetaData("jdbc:postgresql://127.0.0.1/ds_1"); - assertTrue(actual1.isInSameDatabaseInstance(actual2)); - } - - @Test - void assertIsInSameDatabaseInstanceWithSQL92() { - SQL92DataSourceMetaData actual1 = new SQL92DataSourceMetaData("jdbc:sql92_db:ds_0"); - SQL92DataSourceMetaData actual2 = new SQL92DataSourceMetaData("jdbc:sql92_db:ds_1"); - assertTrue(actual1.isInSameDatabaseInstance(actual2)); - } - - @Test - void assertIsInSameDatabaseInstanceWithSQLServer() { - SQLServerDataSourceMetaData actual1 = new SQLServerDataSourceMetaData("jdbc:microsoft:sqlserver://127.0.0.1:9999;DatabaseName=ds_0"); - SQLServerDataSourceMetaData actual2 = new SQLServerDataSourceMetaData("jdbc:microsoft:sqlserver://127.0.0.1:9999;DatabaseName=ds_1"); - assertTrue(actual1.isInSameDatabaseInstance(actual2)); - } -} diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/AbstractDataSourceMetaDataTest.java b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/AbstractDataSourceMetaDataTest.java deleted file mode 100644 index 0b37516d0db5c..0000000000000 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/AbstractDataSourceMetaDataTest.java +++ /dev/null @@ -1,39 +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.infra.database.core.metadata.dialect; - -import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; - -import java.util.Properties; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -abstract class AbstractDataSourceMetaDataTest { - - protected final void assertDataSourceMetaData(final String url, final String hostname, final int port, final String catalog, final String schema, final Properties queryProps) { - DataSourceMetaData actual = createDataSourceMetaData(url); - assertThat(actual.getHostname(), is(hostname)); - assertThat(actual.getPort(), is(port)); - assertThat(actual.getCatalog(), is(catalog)); - assertThat(actual.getSchema(), is(schema)); - assertThat(actual.getQueryProperties(), is(queryProps)); - } - - protected abstract DataSourceMetaData createDataSourceMetaData(String url); -} diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MySQLDataSourceMetaDataTest.java b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MySQLDataSourceMetaDataTest.java deleted file mode 100644 index def71ae951909..0000000000000 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/MySQLDataSourceMetaDataTest.java +++ /dev/null @@ -1,63 +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.infra.database.core.metadata.dialect; - -import org.apache.shardingsphere.infra.database.core.metadata.UnrecognizedDatabaseURLException; -import org.apache.shardingsphere.test.util.PropertiesBuilder; -import org.apache.shardingsphere.test.util.PropertiesBuilder.Property; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtensionContext; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.ArgumentsProvider; -import org.junit.jupiter.params.provider.ArgumentsSource; - -import java.util.Properties; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.assertThrows; - -class MySQLDataSourceMetaDataTest extends AbstractDataSourceMetaDataTest { - - @ParameterizedTest(name = "{0}") - @ArgumentsSource(NewConstructorTestCaseArgumentsProvider.class) - void assertNewConstructor(final String name, final String url, final String hostname, final int port, final String catalog, final String schema, final Properties queryProps) { - assertDataSourceMetaData(url, hostname, port, catalog, schema, queryProps); - } - - @Test - void assertNewConstructorFailure() { - assertThrows(UnrecognizedDatabaseURLException.class, () -> new MySQLDataSourceMetaData("jdbc:mysql:xxxxxxxx")); - } - - @Override - protected MySQLDataSourceMetaData createDataSourceMetaData(final String url) { - return new MySQLDataSourceMetaData(url); - } - - private static class NewConstructorTestCaseArgumentsProvider implements ArgumentsProvider { - - @Override - public Stream provideArguments(final ExtensionContext extensionContext) { - return Stream.of( - Arguments.of("simple", "jdbc:mysql://127.0.0.1/foo_ds", "127.0.0.1", 3306, "foo_ds", null, new Properties()), - Arguments.of("complex", "jdbc:mysql:loadbalance://127.0.0.1:9999,127.0.0.2:9999/foo_ds?serverTimezone=UTC&useSSL=false", "127.0.0.1", 9999, "foo_ds", null, - PropertiesBuilder.build(new Property("serverTimezone", "UTC"), new Property("useSSL", Boolean.FALSE.toString())))); - } - } -} diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/url/JdbcUrlAppenderTest.java b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/url/JdbcUrlAppenderTest.java index b882cd58788e8..a0e8eb6063b54 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/url/JdbcUrlAppenderTest.java +++ b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/url/JdbcUrlAppenderTest.java @@ -29,9 +29,9 @@ class JdbcUrlAppenderTest { @Test void assertAppendQueryPropertiesWithoutOriginalQueryProperties() { - String actual = new JdbcUrlAppender().appendQueryProperties("jdbc:mysql://192.168.0.1:3306/foo_ds", + String actual = new JdbcUrlAppender().appendQueryProperties("jdbc:infra.fixture://192.168.0.1:3306/foo_ds", PropertiesBuilder.build(new Property("useSSL", Boolean.FALSE.toString()), new Property("rewriteBatchedStatements", Boolean.TRUE.toString()))); - assertThat(actual, startsWith("jdbc:mysql://192.168.0.1:3306/foo_ds?")); + assertThat(actual, startsWith("jdbc:infra.fixture://192.168.0.1:3306/foo_ds?")); assertThat(actual, containsString("rewriteBatchedStatements=true")); assertThat(actual, containsString("useSSL=false")); } @@ -39,9 +39,9 @@ void assertAppendQueryPropertiesWithoutOriginalQueryProperties() { @Test void assertAppendQueryPropertiesWithOriginalQueryProperties() { String actual = new JdbcUrlAppender().appendQueryProperties( - "jdbc:mysql://192.168.0.1:3306/foo_ds?serverTimezone=UTC&useSSL=false&rewriteBatchedStatements=true", + "jdbc:infra.fixture://192.168.0.1:3306/foo_ds?serverTimezone=UTC&useSSL=false&rewriteBatchedStatements=true", PropertiesBuilder.build(new Property("useSSL", Boolean.FALSE.toString()), new Property("rewriteBatchedStatements", Boolean.TRUE.toString()))); - assertThat(actual, startsWith("jdbc:mysql://192.168.0.1:3306/foo_ds?")); + assertThat(actual, startsWith("jdbc:infra.fixture://192.168.0.1:3306/foo_ds?")); assertThat(actual, containsString("serverTimezone=UTC")); assertThat(actual, containsString("rewriteBatchedStatements=true")); assertThat(actual, containsString("useSSL=false")); diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactoryTest.java b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactoryTest.java index 89234bb0e0360..70744844d3731 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactoryTest.java +++ b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactoryTest.java @@ -36,6 +36,6 @@ void assertGetDatabaseTypeWithBranchURL() { @Test void assertGetDatabaseTypeWithUnrecognizedURL() { - assertThat(DatabaseTypeFactory.get("jdbc:sqlite:test").getType(), is("SQL92")); + assertThat(DatabaseTypeFactory.get("jdbc:not-existed:test").getType(), is("INFRA.TRUNK.FIXTURE")); } } diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/DataSourceMetaDataFixture.java b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/DataSourceMetaDataFixture.java new file mode 100644 index 0000000000000..1096d4626e3bf --- /dev/null +++ b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/DataSourceMetaDataFixture.java @@ -0,0 +1,63 @@ +/* + * 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.infra.database.core.type.fixture; + +import lombok.Getter; +import org.apache.shardingsphere.infra.database.core.metadata.UnrecognizedDatabaseURLException; +import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; + +import java.util.Properties; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +@Getter +public final class DataSourceMetaDataFixture implements DataSourceMetaData { + + private static final int DEFAULT_PORT = -1; + + private static final Pattern URL_PATTERN = Pattern.compile("jdbc:infra", Pattern.CASE_INSENSITIVE); + + private final String hostname; + + private final int port; + + private final String catalog; + + private final String schema; + + public DataSourceMetaDataFixture(final String url) { + Matcher matcher = URL_PATTERN.matcher(url); + if (!matcher.find()) { + throw new UnrecognizedDatabaseURLException(url, URL_PATTERN.pattern()); + } + hostname = ""; + port = DEFAULT_PORT; + catalog = ""; + schema = null; + } + + @Override + public Properties getQueryProperties() { + return new Properties(); + } + + @Override + public Properties getDefaultQueryProperties() { + return new Properties(); + } +} diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/InfraBranchDatabaseTypeFixture.java b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/InfraBranchDatabaseTypeFixture.java index 08c82b15628bb..985ec9369b203 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/InfraBranchDatabaseTypeFixture.java +++ b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/InfraBranchDatabaseTypeFixture.java @@ -42,7 +42,7 @@ public Collection getJdbcUrlPrefixes() { @Override public DataSourceMetaData getDataSourceMetaData(final String url, final String username) { - return null; + return new DataSourceMetaDataFixture(url); } @Override diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/InfraTrunkDatabaseTypeFixture.java b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/InfraTrunkDatabaseTypeFixture.java index 5f6f6732ea27d..d6d8414464898 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/InfraTrunkDatabaseTypeFixture.java +++ b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/fixture/InfraTrunkDatabaseTypeFixture.java @@ -45,7 +45,7 @@ public Collection getJdbcUrlPrefixes() { @Override public DataSourceMetaData getDataSourceMetaData(final String url, final String username) { - return null; + return new DataSourceMetaDataFixture(url); } @Override @@ -62,4 +62,9 @@ public Collection getSystemSchemas() { public String getType() { return "INFRA.TRUNK.FIXTURE"; } + + @Override + public boolean isDefault() { + return true; + } } diff --git a/infra/database/type/h2/pom.xml b/infra/database/type/h2/pom.xml new file mode 100644 index 0000000000000..2f4b33c54c004 --- /dev/null +++ b/infra/database/type/h2/pom.xml @@ -0,0 +1,48 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-infra-database-type + 5.4.1-SNAPSHOT + + shardingsphere-infra-database-h2 + ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-infra-database-core + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-database-mysql + ${project.version} + + + + org.apache.shardingsphere + shardingsphere-test-util + ${project.version} + test + + + diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/H2DataSourceMetaData.java b/infra/database/type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2/H2DataSourceMetaData.java similarity index 98% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/H2DataSourceMetaData.java rename to infra/database/type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2/H2DataSourceMetaData.java index cfb9513a40ea7..d25e2e2d98125 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/H2DataSourceMetaData.java +++ b/infra/database/type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2/H2DataSourceMetaData.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.h2; import lombok.Getter; import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/H2DatabaseType.java b/infra/database/type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2/H2DatabaseType.java similarity index 93% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/H2DatabaseType.java rename to infra/database/type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2/H2DatabaseType.java index 762cd5fb4d8ff..830fa92f6b720 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/H2DatabaseType.java +++ b/infra/database/type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2/H2DatabaseType.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.h2; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.H2DataSourceMetaData; import org.apache.shardingsphere.infra.database.core.type.BranchDatabaseType; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader; diff --git a/infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType b/infra/database/type/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType similarity index 62% rename from infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType rename to infra/database/type/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType index 3ab558097c77d..6d1291c802ce3 100644 --- a/infra/database/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType +++ b/infra/database/type/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType @@ -15,9 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.infra.database.core.type.dialect.SQL92DatabaseType -org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType -org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType -org.apache.shardingsphere.infra.database.core.type.dialect.OracleDatabaseType -org.apache.shardingsphere.infra.database.core.type.dialect.SQLServerDatabaseType -org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType +org.apache.shardingsphere.infra.database.h2.H2DatabaseType diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/H2DataSourceMetaDataTest.java b/infra/database/type/h2/src/test/java/org/apache/shardingsphere/infra/database/h2/H2DataSourceMetaDataTest.java similarity index 89% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/H2DataSourceMetaDataTest.java rename to infra/database/type/h2/src/test/java/org/apache/shardingsphere/infra/database/h2/H2DataSourceMetaDataTest.java index a8e19418cc527..2a835d8b737c1 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/H2DataSourceMetaDataTest.java +++ b/infra/database/type/h2/src/test/java/org/apache/shardingsphere/infra/database/h2/H2DataSourceMetaDataTest.java @@ -15,26 +15,32 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.h2; +import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.ArgumentsProvider; import org.junit.jupiter.params.provider.ArgumentsSource; -import java.util.Properties; import java.util.stream.Stream; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; -class H2DataSourceMetaDataTest extends AbstractDataSourceMetaDataTest { +class H2DataSourceMetaDataTest { @ParameterizedTest(name = "{0}") @ArgumentsSource(NewConstructorTestCaseArgumentsProvider.class) void assertNewConstructor(final String name, final String url, final String hostname, final int port, final String catalog, final String schema) { - assertDataSourceMetaData(url, hostname, port, catalog, schema, new Properties()); + DataSourceMetaData actual = new H2DataSourceMetaData(url); + assertThat(actual.getHostname(), is(hostname)); + assertThat(actual.getPort(), is(port)); + assertThat(actual.getCatalog(), is(catalog)); + assertThat(actual.getSchema(), is(schema)); + assertTrue(actual.getQueryProperties().isEmpty()); } @ParameterizedTest(name = "{0}") @@ -45,11 +51,6 @@ void assertIsInSameDatabaseInstance(final String name, final String url1, final assertThat(actual1.isInSameDatabaseInstance(actual2), is(isSame)); } - @Override - protected H2DataSourceMetaData createDataSourceMetaData(final String url) { - return new H2DataSourceMetaData(url); - } - private static class NewConstructorTestCaseArgumentsProvider implements ArgumentsProvider { @Override diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/H2DatabaseTypeTest.java b/infra/database/type/h2/src/test/java/org/apache/shardingsphere/infra/database/h2/H2DatabaseTypeTest.java similarity index 93% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/H2DatabaseTypeTest.java rename to infra/database/type/h2/src/test/java/org/apache/shardingsphere/infra/database/h2/H2DatabaseTypeTest.java index ed5cfa541a1c6..8ecc9ce595b01 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/H2DatabaseTypeTest.java +++ b/infra/database/type/h2/src/test/java/org/apache/shardingsphere/infra/database/h2/H2DatabaseTypeTest.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.h2; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.H2DataSourceMetaData; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; import org.junit.jupiter.api.Test; diff --git a/infra/database/type/mariadb/pom.xml b/infra/database/type/mariadb/pom.xml index 55b3938f297e0..e0bfdf806d372 100644 --- a/infra/database/type/mariadb/pom.xml +++ b/infra/database/type/mariadb/pom.xml @@ -32,7 +32,12 @@ shardingsphere-infra-database-core ${project.version} - + + org.apache.shardingsphere + shardingsphere-infra-database-mysql + ${project.version} + + org.apache.shardingsphere shardingsphere-test-util diff --git a/infra/database/type/opengauss/pom.xml b/infra/database/type/opengauss/pom.xml new file mode 100644 index 0000000000000..441e65060097b --- /dev/null +++ b/infra/database/type/opengauss/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-infra-database-type + 5.4.1-SNAPSHOT + + shardingsphere-infra-database-opengauss + ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-infra-database-core + ${project.version} + + + + org.apache.shardingsphere + shardingsphere-test-util + ${project.version} + test + + + diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OpenGaussDataSourceMetaData.java b/infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDataSourceMetaData.java similarity index 96% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OpenGaussDataSourceMetaData.java rename to infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDataSourceMetaData.java index dbb2a5efb1de5..554bf4973f5bf 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OpenGaussDataSourceMetaData.java +++ b/infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDataSourceMetaData.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.opengauss; import lombok.Getter; import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/OpenGaussDatabaseType.java b/infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDatabaseType.java similarity index 97% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/OpenGaussDatabaseType.java rename to infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDatabaseType.java index 4bca5ed380db5..8b4a465f5e797 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/OpenGaussDatabaseType.java +++ b/infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDatabaseType.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.opengauss; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.OpenGaussDataSourceMetaData; import org.apache.shardingsphere.infra.database.core.type.TrunkDatabaseType; import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; diff --git a/infra/database/type/opengauss/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType b/infra/database/type/opengauss/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType new file mode 100644 index 0000000000000..03e3b0ac02303 --- /dev/null +++ b/infra/database/type/opengauss/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType @@ -0,0 +1,18 @@ +# +# 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.infra.database.opengauss.OpenGaussDatabaseType diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OpenGaussDataSourceMetaDataTest.java b/infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDataSourceMetaDataTest.java similarity index 79% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OpenGaussDataSourceMetaDataTest.java rename to infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDataSourceMetaDataTest.java index 95ec4f1ebbfcb..49f516da63cf8 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OpenGaussDataSourceMetaDataTest.java +++ b/infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDataSourceMetaDataTest.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.opengauss; import org.apache.shardingsphere.infra.database.core.metadata.UnrecognizedDatabaseURLException; +import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; import org.apache.shardingsphere.test.util.PropertiesBuilder; import org.apache.shardingsphere.test.util.PropertiesBuilder.Property; import org.junit.jupiter.api.Test; @@ -30,24 +31,26 @@ import java.util.Properties; import java.util.stream.Stream; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -class OpenGaussDataSourceMetaDataTest extends AbstractDataSourceMetaDataTest { +class OpenGaussDataSourceMetaDataTest { @ParameterizedTest(name = "{0}") @ArgumentsSource(NewConstructorTestCaseArgumentsProvider.class) void assertNewConstructor(final String name, final String url, final String hostname, final int port, final String catalog, final String schema, final Properties queryProps) { - assertDataSourceMetaData(url, hostname, port, catalog, schema, queryProps); + DataSourceMetaData actual = new OpenGaussDataSourceMetaData(url); + assertThat(actual.getHostname(), is(hostname)); + assertThat(actual.getPort(), is(port)); + assertThat(actual.getCatalog(), is(catalog)); + assertThat(actual.getSchema(), is(schema)); + assertThat(actual.getQueryProperties(), is(queryProps)); } @Test void assertNewConstructorFailure() { - assertThrows(UnrecognizedDatabaseURLException.class, () -> new PostgreSQLDataSourceMetaData("jdbc:opengauss:xxxxxxxx")); - } - - @Override - protected OpenGaussDataSourceMetaData createDataSourceMetaData(final String url) { - return new OpenGaussDataSourceMetaData(url); + assertThrows(UnrecognizedDatabaseURLException.class, () -> new OpenGaussDataSourceMetaData("jdbc:opengauss:xxxxxxxx")); } private static class NewConstructorTestCaseArgumentsProvider implements ArgumentsProvider { diff --git a/infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDatabaseTypeTest.java b/infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDatabaseTypeTest.java new file mode 100644 index 0000000000000..013ca275bf885 --- /dev/null +++ b/infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/OpenGaussDatabaseTypeTest.java @@ -0,0 +1,97 @@ +/* + * 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.infra.database.opengauss; + +import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; +import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement; +import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.CommitStatement; +import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.RollbackStatement; +import org.junit.jupiter.api.Test; + +import java.sql.SQLFeatureNotSupportedException; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Optional; + +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; + +class OpenGaussDatabaseTypeTest { + + @Test + void assertGetQuoteCharacter() { + assertThat(new OpenGaussDatabaseType().getQuoteCharacter(), is(QuoteCharacter.QUOTE)); + } + + @Test + void assertGetJdbcUrlPrefixes() { + assertThat(new OpenGaussDatabaseType().getJdbcUrlPrefixes(), is(Collections.singleton("jdbc:opengauss:"))); + } + + @Test + void assertGetDataSourceMetaData() { + assertThat(new OpenGaussDatabaseType().getDataSourceMetaData("jdbc:opengauss://localhost:5432/demo_ds_0", "postgres"), instanceOf(OpenGaussDataSourceMetaData.class)); + } + + @Test + void assertHandleRollbackOnlyForNotRollbackOnly() { + assertDoesNotThrow(() -> new OpenGaussDatabaseType().handleRollbackOnly(false, mock(CommitStatement.class))); + } + + @Test + void assertHandleRollbackOnlyForRollbackOnlyAndCommitStatement() { + assertDoesNotThrow(() -> new OpenGaussDatabaseType().handleRollbackOnly(true, mock(CommitStatement.class))); + } + + @Test + void assertHandleRollbackOnlyForRollbackOnlyAndRollbackStatement() { + assertDoesNotThrow(() -> new OpenGaussDatabaseType().handleRollbackOnly(true, mock(RollbackStatement.class))); + } + + @Test + void assertHandleRollbackOnlyForRollbackOnlyAndNotTCLStatement() { + assertThrows(SQLFeatureNotSupportedException.class, () -> new OpenGaussDatabaseType().handleRollbackOnly(true, mock(SelectStatement.class))); + } + + @Test + void assertGetSystemDatabases() { + assertTrue(new OpenGaussDatabaseType().getSystemDatabaseSchemaMap().containsKey("postgres")); + } + + @Test + void assertGetSystemSchemas() { + assertThat(new OpenGaussDatabaseType().getSystemSchemas(), is(new HashSet<>(Arrays.asList("information_schema", "pg_catalog", "blockchain", + "cstore", "db4ai", "dbe_perf", "dbe_pldebugger", "gaussdb", "oracle", "pkg_service", "snapshot", "sqladvisor", "dbe_pldeveloper", "pg_toast", "pkg_util", "shardingsphere")))); + } + + @Test + void assertIsSchemaAvailable() { + assertTrue(new OpenGaussDatabaseType().isSchemaAvailable()); + } + + @Test + void assertGetDefaultSchema() { + assertThat(new OpenGaussDatabaseType().getDefaultSchema(), is(Optional.of("public"))); + } +} diff --git a/infra/database/type/oracle/pom.xml b/infra/database/type/oracle/pom.xml new file mode 100644 index 0000000000000..319d383a508b3 --- /dev/null +++ b/infra/database/type/oracle/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-infra-database-type + 5.4.1-SNAPSHOT + + shardingsphere-infra-database-oracle + ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-infra-database-core + ${project.version} + + + + org.apache.shardingsphere + shardingsphere-test-util + ${project.version} + test + + + diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OracleDataSourceMetaData.java b/infra/database/type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle/OracleDataSourceMetaData.java similarity index 97% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OracleDataSourceMetaData.java rename to infra/database/type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle/OracleDataSourceMetaData.java index a45969075c6e0..562bd1878564b 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OracleDataSourceMetaData.java +++ b/infra/database/type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle/OracleDataSourceMetaData.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.oracle; import com.google.common.base.Strings; import lombok.Getter; diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/OracleDatabaseType.java b/infra/database/type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle/OracleDatabaseType.java similarity index 96% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/OracleDatabaseType.java rename to infra/database/type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle/OracleDatabaseType.java index ef86d8eba02e9..f6783006e40e1 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/OracleDatabaseType.java +++ b/infra/database/type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle/OracleDatabaseType.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.oracle; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.OracleDataSourceMetaData; import org.apache.shardingsphere.infra.database.core.type.TrunkDatabaseType; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; diff --git a/infra/database/type/oracle/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType b/infra/database/type/oracle/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType new file mode 100644 index 0000000000000..de7eb34dfd9c9 --- /dev/null +++ b/infra/database/type/oracle/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType @@ -0,0 +1,18 @@ +# +# 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.infra.database.oracle.OracleDatabaseType diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OracleDataSourceMetaDataTest.java b/infra/database/type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle/OracleDataSourceMetaDataTest.java similarity index 86% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OracleDataSourceMetaDataTest.java rename to infra/database/type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle/OracleDataSourceMetaDataTest.java index e42adf6f1a679..0daf24055be75 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/OracleDataSourceMetaDataTest.java +++ b/infra/database/type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle/OracleDataSourceMetaDataTest.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.oracle; import org.apache.shardingsphere.infra.database.core.metadata.UnrecognizedDatabaseURLException; +import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; @@ -25,17 +26,24 @@ import org.junit.jupiter.params.provider.ArgumentsProvider; import org.junit.jupiter.params.provider.ArgumentsSource; -import java.util.Properties; import java.util.stream.Stream; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; -class OracleDataSourceMetaDataTest extends AbstractDataSourceMetaDataTest { +class OracleDataSourceMetaDataTest { @ParameterizedTest(name = "{0}") @ArgumentsSource(NewConstructorTestCaseArgumentsProvider.class) void assertNewConstructor(final String name, final String url, final String hostname, final int port, final String catalog, final String schema) { - assertDataSourceMetaData(url, hostname, port, catalog, schema, new Properties()); + DataSourceMetaData actual = new OracleDataSourceMetaData(url, "test"); + assertThat(actual.getHostname(), is(hostname)); + assertThat(actual.getPort(), is(port)); + assertThat(actual.getCatalog(), is(catalog)); + assertThat(actual.getSchema(), is(schema)); + assertTrue(actual.getQueryProperties().isEmpty()); } @Test @@ -43,11 +51,6 @@ void assertNewConstructorFailure() { assertThrows(UnrecognizedDatabaseURLException.class, () -> new OracleDataSourceMetaData("jdbc:oracle:xxxxxxxx", "test")); } - @Override - protected OracleDataSourceMetaData createDataSourceMetaData(final String url) { - return new OracleDataSourceMetaData(url, "test"); - } - private static class NewConstructorTestCaseArgumentsProvider implements ArgumentsProvider { @Override diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/OracleDatabaseTypeTest.java b/infra/database/type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle/OracleDatabaseTypeTest.java similarity index 94% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/OracleDatabaseTypeTest.java rename to infra/database/type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle/OracleDatabaseTypeTest.java index 298af909d683d..20adce4ea4a0f 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/OracleDatabaseTypeTest.java +++ b/infra/database/type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle/OracleDatabaseTypeTest.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.oracle; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.OracleDataSourceMetaData; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; import org.junit.jupiter.api.Test; @@ -27,8 +26,8 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.jupiter.api.Assertions.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +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; diff --git a/infra/database/type/pom.xml b/infra/database/type/pom.xml index db504c345985e..6306cbc04cd21 100644 --- a/infra/database/type/pom.xml +++ b/infra/database/type/pom.xml @@ -30,5 +30,11 @@ mysql mariadb + postgresql + opengauss + oracle + sqlserver + h2 + sql92 diff --git a/infra/database/type/postgresql/pom.xml b/infra/database/type/postgresql/pom.xml new file mode 100644 index 0000000000000..f68ea9ef8a967 --- /dev/null +++ b/infra/database/type/postgresql/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-infra-database-type + 5.4.1-SNAPSHOT + + shardingsphere-infra-database-postgresql + ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-infra-database-core + ${project.version} + + + + org.apache.shardingsphere + shardingsphere-test-util + ${project.version} + test + + + diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/PostgreSQLDataSourceMetaData.java b/infra/database/type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDataSourceMetaData.java similarity index 96% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/PostgreSQLDataSourceMetaData.java rename to infra/database/type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDataSourceMetaData.java index 9763f6c89bc32..11d1abd905d06 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/PostgreSQLDataSourceMetaData.java +++ b/infra/database/type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDataSourceMetaData.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.postgresql; import lombok.Getter; import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/PostgreSQLDatabaseType.java b/infra/database/type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDatabaseType.java similarity index 96% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/PostgreSQLDatabaseType.java rename to infra/database/type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDatabaseType.java index 1360ffbe700b5..7f1a3353f3365 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/PostgreSQLDatabaseType.java +++ b/infra/database/type/postgresql/src/main/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDatabaseType.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.postgresql; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.PostgreSQLDataSourceMetaData; import org.apache.shardingsphere.infra.database.core.type.TrunkDatabaseType; import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; diff --git a/infra/database/type/postgresql/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType b/infra/database/type/postgresql/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType new file mode 100644 index 0000000000000..152fd5be632e4 --- /dev/null +++ b/infra/database/type/postgresql/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType @@ -0,0 +1,18 @@ +# +# 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.infra.database.postgresql.PostgreSQLDatabaseType diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/PostgreSQLDataSourceMetaDataTest.java b/infra/database/type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDataSourceMetaDataTest.java similarity index 81% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/PostgreSQLDataSourceMetaDataTest.java rename to infra/database/type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDataSourceMetaDataTest.java index f6309d72b539e..defaea230d968 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/PostgreSQLDataSourceMetaDataTest.java +++ b/infra/database/type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDataSourceMetaDataTest.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.postgresql; import org.apache.shardingsphere.infra.database.core.metadata.UnrecognizedDatabaseURLException; +import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; import org.apache.shardingsphere.test.util.PropertiesBuilder; import org.apache.shardingsphere.test.util.PropertiesBuilder.Property; import org.junit.jupiter.api.Test; @@ -30,14 +31,21 @@ import java.util.Properties; import java.util.stream.Stream; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -class PostgreSQLDataSourceMetaDataTest extends AbstractDataSourceMetaDataTest { +class PostgreSQLDataSourceMetaDataTest { @ParameterizedTest(name = "{0}") @ArgumentsSource(NewConstructorTestCaseArgumentsProvider.class) void assertNewConstructor(final String name, final String url, final String hostname, final int port, final String catalog, final String schema, final Properties queryProps) { - assertDataSourceMetaData(url, hostname, port, catalog, schema, queryProps); + DataSourceMetaData actual = new PostgreSQLDataSourceMetaData(url); + assertThat(actual.getHostname(), is(hostname)); + assertThat(actual.getPort(), is(port)); + assertThat(actual.getCatalog(), is(catalog)); + assertThat(actual.getSchema(), is(schema)); + assertThat(actual.getQueryProperties(), is(queryProps)); } @Test @@ -45,11 +53,6 @@ void assertNewConstructorFailure() { assertThrows(UnrecognizedDatabaseURLException.class, () -> new PostgreSQLDataSourceMetaData("jdbc:postgresql:xxxxxxxx")); } - @Override - protected PostgreSQLDataSourceMetaData createDataSourceMetaData(final String url) { - return new PostgreSQLDataSourceMetaData(url); - } - private static class NewConstructorTestCaseArgumentsProvider implements ArgumentsProvider { @Override diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/PostgreSQLDatabaseTypeTest.java b/infra/database/type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDatabaseTypeTest.java similarity index 95% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/PostgreSQLDatabaseTypeTest.java rename to infra/database/type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDatabaseTypeTest.java index 5fe9b84676150..44b4758bbea90 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/PostgreSQLDatabaseTypeTest.java +++ b/infra/database/type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql/PostgreSQLDatabaseTypeTest.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.postgresql; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.PostgreSQLDataSourceMetaData; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement; import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.CommitStatement; diff --git a/infra/database/type/sql92/pom.xml b/infra/database/type/sql92/pom.xml new file mode 100644 index 0000000000000..fc737de2ddf3b --- /dev/null +++ b/infra/database/type/sql92/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-infra-database-type + 5.4.1-SNAPSHOT + + shardingsphere-infra-database-sql92 + ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-infra-database-core + ${project.version} + + + + org.apache.shardingsphere + shardingsphere-test-util + ${project.version} + test + + + diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQL92DataSourceMetaData.java b/infra/database/type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92/SQL92DataSourceMetaData.java similarity index 96% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQL92DataSourceMetaData.java rename to infra/database/type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92/SQL92DataSourceMetaData.java index 9f9f09eddb211..81a73c26d49a4 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQL92DataSourceMetaData.java +++ b/infra/database/type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92/SQL92DataSourceMetaData.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.sql92; import lombok.Getter; import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQL92DatabaseType.java b/infra/database/type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92/SQL92DatabaseType.java similarity index 92% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQL92DatabaseType.java rename to infra/database/type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92/SQL92DatabaseType.java index 93282d0efe9a1..2b996af3dbe74 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQL92DatabaseType.java +++ b/infra/database/type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92/SQL92DatabaseType.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.sql92; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.SQL92DataSourceMetaData; import org.apache.shardingsphere.infra.database.core.type.TrunkDatabaseType; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; @@ -59,4 +58,9 @@ public Collection getSystemSchemas() { public String getType() { return "SQL92"; } + + @Override + public boolean isDefault() { + return true; + } } diff --git a/infra/database/type/sql92/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType b/infra/database/type/sql92/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType new file mode 100644 index 0000000000000..caf4100a778e3 --- /dev/null +++ b/infra/database/type/sql92/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType @@ -0,0 +1,18 @@ +# +# 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.infra.database.sql92.SQL92DatabaseType diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQL92DataSourceMetaDataTest.java b/infra/database/type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92/SQL92DataSourceMetaDataTest.java similarity index 76% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQL92DataSourceMetaDataTest.java rename to infra/database/type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92/SQL92DataSourceMetaDataTest.java index a40a7015a8d9f..1bd114c0dd755 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQL92DataSourceMetaDataTest.java +++ b/infra/database/type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92/SQL92DataSourceMetaDataTest.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.sql92; import org.apache.shardingsphere.infra.database.core.metadata.UnrecognizedDatabaseURLException; +import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; @@ -25,17 +26,24 @@ import org.junit.jupiter.params.provider.ArgumentsProvider; import org.junit.jupiter.params.provider.ArgumentsSource; -import java.util.Properties; import java.util.stream.Stream; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; -class SQL92DataSourceMetaDataTest extends AbstractDataSourceMetaDataTest { +class SQL92DataSourceMetaDataTest { @ParameterizedTest(name = "{0}") @ArgumentsSource(NewConstructorTestCaseArgumentsProvider.class) void assertNewConstructor(final String name, final String url, final String hostname, final int port, final String catalog, final String schema) { - assertDataSourceMetaData(url, hostname, port, catalog, schema, new Properties()); + DataSourceMetaData actual = new SQL92DataSourceMetaData(url); + assertThat(actual.getHostname(), is(hostname)); + assertThat(actual.getPort(), is(port)); + assertThat(actual.getCatalog(), is(catalog)); + assertThat(actual.getSchema(), is(schema)); + assertTrue(actual.getQueryProperties().isEmpty()); } @Test @@ -43,11 +51,6 @@ void assertNewConstructorFailure() { assertThrows(UnrecognizedDatabaseURLException.class, () -> new SQL92DataSourceMetaData("xxx:xxxx:xxxxxxxx")); } - @Override - protected SQL92DataSourceMetaData createDataSourceMetaData(final String url) { - return new SQL92DataSourceMetaData(url); - } - private static class NewConstructorTestCaseArgumentsProvider implements ArgumentsProvider { @Override diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQL92DatabaseTypeTest.java b/infra/database/type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92/SQL92DatabaseTypeTest.java similarity index 92% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQL92DatabaseTypeTest.java rename to infra/database/type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92/SQL92DatabaseTypeTest.java index 969d7441e8af0..e2d72ea39004f 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQL92DatabaseTypeTest.java +++ b/infra/database/type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92/SQL92DatabaseTypeTest.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.sql92; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.SQL92DataSourceMetaData; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; import org.junit.jupiter.api.Test; diff --git a/infra/database/type/sqlserver/pom.xml b/infra/database/type/sqlserver/pom.xml new file mode 100644 index 0000000000000..859ebbf484528 --- /dev/null +++ b/infra/database/type/sqlserver/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-infra-database-type + 5.4.1-SNAPSHOT + + shardingsphere-infra-database-sqlserver + ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-infra-database-core + ${project.version} + + + + org.apache.shardingsphere + shardingsphere-test-util + ${project.version} + test + + + diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQLServerDataSourceMetaData.java b/infra/database/type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDataSourceMetaData.java similarity index 97% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQLServerDataSourceMetaData.java rename to infra/database/type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDataSourceMetaData.java index d35ecb5f80198..d93f2aa3cd644 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQLServerDataSourceMetaData.java +++ b/infra/database/type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDataSourceMetaData.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.sqlserver; import com.google.common.base.Strings; import lombok.Getter; diff --git a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQLServerDatabaseType.java b/infra/database/type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDatabaseType.java similarity index 92% rename from infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQLServerDatabaseType.java rename to infra/database/type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDatabaseType.java index c62bfc46cd7d7..a95d5cad6230e 100644 --- a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQLServerDatabaseType.java +++ b/infra/database/type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDatabaseType.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.sqlserver; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.SQLServerDataSourceMetaData; import org.apache.shardingsphere.infra.database.core.type.TrunkDatabaseType; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; diff --git a/infra/database/type/sqlserver/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType b/infra/database/type/sqlserver/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType new file mode 100644 index 0000000000000..a77b97b2858f3 --- /dev/null +++ b/infra/database/type/sqlserver/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.database.spi.DatabaseType @@ -0,0 +1,18 @@ +# +# 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.infra.database.sqlserver.SQLServerDatabaseType diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQLServerDataSourceMetaDataTest.java b/infra/database/type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDataSourceMetaDataTest.java similarity index 83% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQLServerDataSourceMetaDataTest.java rename to infra/database/type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDataSourceMetaDataTest.java index 26242129743b9..1d015f42e1670 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/metadata/dialect/SQLServerDataSourceMetaDataTest.java +++ b/infra/database/type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDataSourceMetaDataTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.metadata.dialect; +package org.apache.shardingsphere.infra.database.sqlserver; -import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; import org.apache.shardingsphere.infra.database.core.metadata.UnrecognizedDatabaseURLException; +import org.apache.shardingsphere.infra.database.spi.DataSourceMetaData; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; @@ -26,17 +26,24 @@ import org.junit.jupiter.params.provider.ArgumentsProvider; import org.junit.jupiter.params.provider.ArgumentsSource; -import java.util.Properties; import java.util.stream.Stream; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; -class SQLServerDataSourceMetaDataTest extends AbstractDataSourceMetaDataTest { +class SQLServerDataSourceMetaDataTest { @ParameterizedTest(name = "{0}") @ArgumentsSource(NewConstructorTestCaseArgumentsProvider.class) void assertNewConstructor(final String name, final String url, final String hostname, final int port, final String catalog, final String schema) { - assertDataSourceMetaData(url, hostname, port, catalog, schema, new Properties()); + DataSourceMetaData actual = new SQLServerDataSourceMetaData(url); + assertThat(actual.getHostname(), is(hostname)); + assertThat(actual.getPort(), is(port)); + assertThat(actual.getCatalog(), is(catalog)); + assertThat(actual.getSchema(), is(schema)); + assertTrue(actual.getQueryProperties().isEmpty()); } @Test @@ -44,11 +51,6 @@ void assertNewConstructorFailure() { assertThrows(UnrecognizedDatabaseURLException.class, () -> new SQLServerDataSourceMetaData("jdbc:sqlserver:xxxxxxxx")); } - @Override - protected DataSourceMetaData createDataSourceMetaData(final String url) { - return new SQLServerDataSourceMetaData(url); - } - private static class NewConstructorTestCaseArgumentsProvider implements ArgumentsProvider { @Override diff --git a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQLServerDatabaseTypeTest.java b/infra/database/type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDatabaseTypeTest.java similarity index 93% rename from infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQLServerDatabaseTypeTest.java rename to infra/database/type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDatabaseTypeTest.java index ae54b4da183c9..c2868381b5e90 100644 --- a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/dialect/SQLServerDatabaseTypeTest.java +++ b/infra/database/type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver/SQLServerDatabaseTypeTest.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.database.core.type.dialect; +package org.apache.shardingsphere.infra.database.sqlserver; -import org.apache.shardingsphere.infra.database.core.metadata.dialect.SQLServerDataSourceMetaData; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; import org.junit.jupiter.api.Test; diff --git a/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/SQLRewriteEntryTest.java b/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/SQLRewriteEntryTest.java index e6eb5db360068..7795159db09a6 100644 --- a/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/SQLRewriteEntryTest.java +++ b/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/SQLRewriteEntryTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.hint.HintValueContext; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; diff --git a/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameTokenTest.java b/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameTokenTest.java index ed737360c9947..549a84d6491cc 100644 --- a/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameTokenTest.java +++ b/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameTokenTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.infra.binder.segment.select.projection.Projection; import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.ColumnProjection; import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.SubqueryProjection; -import org.apache.shardingsphere.infra.database.core.type.dialect.OracleDatabaseType; +import org.apache.shardingsphere.infra.database.oracle.OracleDatabaseType; import org.apache.shardingsphere.infra.route.context.RouteUnit; import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter; import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue; diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/util/JDBCStreamQueryUtils.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/util/JDBCStreamQueryUtils.java index 623b694096bde..129af2ec2d0e1 100644 --- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/util/JDBCStreamQueryUtils.java +++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/util/JDBCStreamQueryUtils.java @@ -22,7 +22,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.infra.database.core.type.BranchDatabaseType; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import java.sql.Connection; diff --git a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/datasource/PipelineDataSourceWrapperTest.java b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/datasource/PipelineDataSourceWrapperTest.java index 45003fe2de24d..c469ee9fd30d1 100644 --- a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/datasource/PipelineDataSourceWrapperTest.java +++ b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/datasource/PipelineDataSourceWrapperTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.data.pipeline.common.datasource; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/metadata/loader/StandardPipelineTableMetaDataLoaderTest.java b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/metadata/loader/StandardPipelineTableMetaDataLoaderTest.java index 5d7a6729855f7..9bd9e9550588b 100644 --- a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/metadata/loader/StandardPipelineTableMetaDataLoaderTest.java +++ b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/metadata/loader/StandardPipelineTableMetaDataLoaderTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.data.pipeline.api.metadata.model.PipelineIndexMetaData; import org.apache.shardingsphere.data.pipeline.api.metadata.model.PipelineTableMetaData; import org.apache.shardingsphere.data.pipeline.common.datasource.PipelineDataSourceWrapper; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.test.fixture.jdbc.MockedDataSource; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/data-pipeline/dialect/opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/OpenGaussLogicalReplication.java b/kernel/data-pipeline/dialect/opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/OpenGaussLogicalReplication.java index 704c772ea980d..dd0185b831024 100644 --- a/kernel/data-pipeline/dialect/opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/OpenGaussLogicalReplication.java +++ b/kernel/data-pipeline/dialect/opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/OpenGaussLogicalReplication.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.data.pipeline.postgresql.ingest.wal.decode.BaseLogSequenceNumber; import org.apache.shardingsphere.infra.database.core.metadata.url.JdbcUrl; import org.apache.shardingsphere.infra.database.core.metadata.url.StandardJdbcUrlParser; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; import org.opengauss.PGProperty; import org.opengauss.jdbc.PgConnection; import org.opengauss.replication.LogSequenceNumber; diff --git a/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/core/prepare/CDCJobPreparer.java b/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/core/prepare/CDCJobPreparer.java index 74b342dfb2f59..2aed186e9f310 100644 --- a/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/core/prepare/CDCJobPreparer.java +++ b/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/core/prepare/CDCJobPreparer.java @@ -47,7 +47,7 @@ import org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.IncrementalDumperCreator; import org.apache.shardingsphere.infra.spi.DatabaseTypedSPILoader; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; import java.sql.SQLException; import java.util.Collection; diff --git a/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/handler/CDCBackendHandler.java b/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/handler/CDCBackendHandler.java index 2e6a76adb005a..20cc739eaaf2c 100644 --- a/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/handler/CDCBackendHandler.java +++ b/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/handler/CDCBackendHandler.java @@ -47,7 +47,7 @@ import org.apache.shardingsphere.data.pipeline.core.exception.job.PipelineJobNotFoundException; import org.apache.shardingsphere.data.pipeline.core.exception.param.PipelineInvalidParameterException; import org.apache.shardingsphere.data.pipeline.core.job.PipelineJobCenter; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.datanode.DataNode; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions; diff --git a/kernel/data-pipeline/scenario/cdc/core/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/util/CDCSchemaTableUtilsTest.java b/kernel/data-pipeline/scenario/cdc/core/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/util/CDCSchemaTableUtilsTest.java index 0dee87e8205b5..9a4ac1b4ab04b 100644 --- a/kernel/data-pipeline/scenario/cdc/core/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/util/CDCSchemaTableUtilsTest.java +++ b/kernel/data-pipeline/scenario/cdc/core/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/util/CDCSchemaTableUtilsTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.data.pipeline.cdc.protocol.request.StreamDataRequestBody.SchemaTable; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java index d8f0e01f4a3d5..5ddb1c969b861 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java +++ b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java @@ -28,7 +28,7 @@ import org.apache.shardingsphere.infra.connection.kernel.KernelProcessor; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.DatabaseTypeEngine; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup; import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext; import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupReportContext; diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/SQLStatementCompilerIT.java b/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/SQLStatementCompilerIT.java index 9c70bb9982cd8..e42366a6585ab 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/SQLStatementCompilerIT.java +++ b/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/SQLStatementCompilerIT.java @@ -29,7 +29,7 @@ import org.apache.calcite.sql2rel.SqlToRelConverter; import org.apache.shardingsphere.infra.database.DatabaseTypeEngine; import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeFactory; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereColumn; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; diff --git a/kernel/sql-translator/core/src/test/java/org/apache/shardingsphere/sqltranslator/rule/SQLTranslatorRuleTest.java b/kernel/sql-translator/core/src/test/java/org/apache/shardingsphere/sqltranslator/rule/SQLTranslatorRuleTest.java index 4c64237bca300..ca00985083ed8 100644 --- a/kernel/sql-translator/core/src/test/java/org/apache/shardingsphere/sqltranslator/rule/SQLTranslatorRuleTest.java +++ b/kernel/sql-translator/core/src/test/java/org/apache/shardingsphere/sqltranslator/rule/SQLTranslatorRuleTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.sqltranslator.rule; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.sqltranslator.api.config.SQLTranslatorRuleConfiguration; import org.apache.shardingsphere.sqltranslator.exception.syntax.UnsupportedTranslatedDatabaseException; import org.junit.jupiter.api.Test; diff --git a/kernel/transaction/core/src/test/java/org/apache/shardingsphere/transaction/rule/TransactionRuleTest.java b/kernel/transaction/core/src/test/java/org/apache/shardingsphere/transaction/rule/TransactionRuleTest.java index 92cf42a400052..d104d63df13bd 100644 --- a/kernel/transaction/core/src/test/java/org/apache/shardingsphere/transaction/rule/TransactionRuleTest.java +++ b/kernel/transaction/core/src/test/java/org/apache/shardingsphere/transaction/rule/TransactionRuleTest.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.transaction.rule; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; import org.apache.shardingsphere.test.fixture.jdbc.MockedDataSource; diff --git a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManagerTest.java b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManagerTest.java index 6d59b72822647..7357fe9ea53e2 100644 --- a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManagerTest.java +++ b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManagerTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.infra.config.mode.ModeConfiguration; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties; import org.apache.shardingsphere.infra.instance.ComputeNodeInstance; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnectorFactoryTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnectorFactoryTest.java index 3c7b79de40de9..2db3620bdcb6b 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnectorFactoryTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnectorFactoryTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.infra.session.query.QueryContext; import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/jdbc/datasource/JDBCBackendDataSourceTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/jdbc/datasource/JDBCBackendDataSourceTest.java index a7f17a421adc3..752072247feb0 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/jdbc/datasource/JDBCBackendDataSourceTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/jdbc/datasource/JDBCBackendDataSourceTest.java @@ -20,7 +20,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.infra.exception.OverallConnectionNotEnoughException; import org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java index ad45c10eb2c3a..e89c95c15a321 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.dialect.exception.syntax.database.NoDatabaseSelectedException; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.infra.instance.InstanceContext; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/data/impl/UnicastDatabaseBackendHandlerTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/data/impl/UnicastDatabaseBackendHandlerTest.java index 89e099b69c2e9..61824f6160a9c 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/data/impl/UnicastDatabaseBackendHandlerTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/data/impl/UnicastDatabaseBackendHandlerTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.session.query.QueryContext; import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/ParseDistSQLExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/ParseDistSQLExecutorTest.java index c1b2a7f80ad57..492449bd57f33 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/ParseDistSQLExecutorTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/ParseDistSQLExecutorTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.distsql.parser.statement.rul.sql.FormatStatement; import org.apache.shardingsphere.distsql.parser.statement.rul.sql.ParseStatement; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; import org.apache.shardingsphere.mode.manager.ContextManager; import org.apache.shardingsphere.parser.rule.SQLParserRule; diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/UseDatabaseExecutorTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/UseDatabaseExecutorTest.java index ff19b16ea0b00..2ff9e90625969 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/UseDatabaseExecutorTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/UseDatabaseExecutorTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.dialect.exception.syntax.database.UnknownDatabaseException; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData; diff --git a/proxy/backend/type/opengauss/src/test/java/org/apache/shardingsphere/proxy/backend/opengauss/handler/admin/OpenGaussSystemCatalogAdminQueryExecutorTest.java b/proxy/backend/type/opengauss/src/test/java/org/apache/shardingsphere/proxy/backend/opengauss/handler/admin/OpenGaussSystemCatalogAdminQueryExecutorTest.java index 42bf8b52cc558..0fb98bf1d067c 100644 --- a/proxy/backend/type/opengauss/src/test/java/org/apache/shardingsphere/proxy/backend/opengauss/handler/admin/OpenGaussSystemCatalogAdminQueryExecutorTest.java +++ b/proxy/backend/type/opengauss/src/test/java/org/apache/shardingsphere/proxy/backend/opengauss/handler/admin/OpenGaussSystemCatalogAdminQueryExecutorTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResultMetaData; import org.apache.shardingsphere.infra.merge.result.MergedResult; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; diff --git a/proxy/frontend/type/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/command/query/extended/bind/OpenGaussComBatchBindExecutorTest.java b/proxy/frontend/type/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/command/query/extended/bind/OpenGaussComBatchBindExecutorTest.java index d305682476250..64ddbbb922324 100644 --- a/proxy/frontend/type/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/command/query/extended/bind/OpenGaussComBatchBindExecutorTest.java +++ b/proxy/frontend/type/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/command/query/extended/bind/OpenGaussComBatchBindExecutorTest.java @@ -25,7 +25,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; import org.apache.shardingsphere.infra.executor.sql.context.ExecutionUnit; import org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode; import org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption; diff --git a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PortalTest.java b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PortalTest.java index 640d122d3a0d0..e835429ccd731 100644 --- a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PortalTest.java +++ b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PortalTest.java @@ -33,7 +33,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext; import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.hint.HintValueContext; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.session.query.QueryContext; diff --git a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PostgreSQLAggregatedBatchedStatementsCommandExecutorTest.java b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PostgreSQLAggregatedBatchedStatementsCommandExecutorTest.java index e949da8e780e7..4fe6e82c73091 100644 --- a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PostgreSQLAggregatedBatchedStatementsCommandExecutorTest.java +++ b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PostgreSQLAggregatedBatchedStatementsCommandExecutorTest.java @@ -30,7 +30,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.context.ExecutionUnit; import org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode; import org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption; diff --git a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PostgreSQLBatchedStatementsExecutorTest.java b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PostgreSQLBatchedStatementsExecutorTest.java index 919ada2c3a320..44a59d80e0b43 100644 --- a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PostgreSQLBatchedStatementsExecutorTest.java +++ b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PostgreSQLBatchedStatementsExecutorTest.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.context.ExecutionUnit; import org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode; import org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption; diff --git a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/bind/PostgreSQLComBindExecutorTest.java b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/bind/PostgreSQLComBindExecutorTest.java index f157c24419b3f..12ff375d15474 100644 --- a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/bind/PostgreSQLComBindExecutorTest.java +++ b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/bind/PostgreSQLComBindExecutorTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.extended.bind.PostgreSQLBindCompletePacket; import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.extended.bind.PostgreSQLComBindPacket; import org.apache.shardingsphere.infra.binder.statement.UnknownSQLStatementContext; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.hint.HintValueContext; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.mode.manager.ContextManager; diff --git a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutorTest.java b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutorTest.java index d2e9765acede0..d15543950c9de 100644 --- a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutorTest.java +++ b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutorTest.java @@ -31,7 +31,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext; import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext; import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode; import org.apache.shardingsphere.infra.hint.HintValueContext; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; diff --git a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutorTest.java b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutorTest.java index 7cbf8466de9c0..452d1f4fa759c 100644 --- a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutorTest.java +++ b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutorTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowDistVariableStatement; import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext; import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData; import org.apache.shardingsphere.mode.manager.ContextManager; import org.apache.shardingsphere.parser.rule.SQLParserRule; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineContainerComposer.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineContainerComposer.java index 6392287249e90..4e6134be9c9b3 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineContainerComposer.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineContainerComposer.java @@ -29,8 +29,8 @@ import org.apache.shardingsphere.infra.database.core.metadata.url.JdbcUrlAppender; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions; import org.apache.shardingsphere.infra.util.yaml.YamlEngine; import org.apache.shardingsphere.infra.yaml.config.pojo.YamlRootConfiguration; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java index 1c4b8e4ce3c4a..b89598b7feafa 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java @@ -37,8 +37,8 @@ import org.apache.shardingsphere.data.pipeline.core.consistencycheck.algorithm.DataMatchDataConsistencyCalculateAlgorithm; import org.apache.shardingsphere.data.pipeline.core.consistencycheck.result.DataConsistencyCheckResult; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateAlgorithm; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.task.E2EIncrementalTask; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java index aa3e9e5ff44c9..d0a925a622e61 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java @@ -20,8 +20,8 @@ import org.apache.shardingsphere.data.pipeline.spi.ddlgenerator.CreateTableSQLGenerator; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.spi.DatabaseTypedSPILoader; import org.apache.shardingsphere.test.e2e.data.pipeline.entity.CreateTableSQLGeneratorAssertionEntity; import org.apache.shardingsphere.test.e2e.data.pipeline.entity.CreateTableSQLGeneratorAssertionsRootEntity; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/AbstractMigrationE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/AbstractMigrationE2EIT.java index b6bc302c7e2ce..d49d7f5021586 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/AbstractMigrationE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/AbstractMigrationE2EIT.java @@ -20,8 +20,8 @@ import com.google.common.base.Strings; import lombok.Getter; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer; import org.apache.shardingsphere.test.e2e.data.pipeline.command.MigrationDistSQLCommand; import org.apache.shardingsphere.test.e2e.data.pipeline.env.PipelineE2EEnvironment; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/PostgreSQLMigrationGeneralE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/PostgreSQLMigrationGeneralE2EIT.java index ce17df8cb0216..3b3e28e20ed49 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/PostgreSQLMigrationGeneralE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/PostgreSQLMigrationGeneralE2EIT.java @@ -20,8 +20,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.tuple.Pair; import org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateAlgorithm; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java index bd4a75e757aab..00dadc2bc2d62 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java @@ -21,7 +21,7 @@ import org.apache.commons.codec.binary.Hex; import org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.util.exception.external.sql.type.wrapper.SQLWrapperException; import org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateAlgorithm; import org.apache.shardingsphere.sharding.algorithm.keygen.UUIDKeyGenerateAlgorithm; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java index 53d7fa26cb24b..1a14f000a5cfc 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java @@ -19,8 +19,8 @@ import org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.sharding.algorithm.keygen.UUIDKeyGenerateAlgorithm; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/task/E2EIncrementalTask.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/task/E2EIncrementalTask.java index 559d37f6780c2..7943ee4f2f06d 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/task/E2EIncrementalTask.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/task/E2EIncrementalTask.java @@ -22,8 +22,8 @@ import org.apache.commons.codec.digest.DigestUtils; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm; import org.apache.shardingsphere.test.e2e.data.pipeline.cases.base.BaseIncrementTask; import org.apache.shardingsphere.test.e2e.data.pipeline.framework.helper.PipelineCaseHelper; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java index b0cfafbb06829..f4b1a15bde4e7 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java @@ -21,8 +21,8 @@ import lombok.NoArgsConstructor; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.test.e2e.env.container.atomic.adapter.config.AdaptorContainerConfiguration; import org.apache.shardingsphere.test.e2e.env.container.atomic.adapter.config.ProxyClusterContainerConfigurationFactory; import org.apache.shardingsphere.test.e2e.env.container.atomic.constants.ProxyContainerConstants; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/helper/PipelineCaseHelper.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/helper/PipelineCaseHelper.java index 84c3e4a6c76c1..13afab60011c3 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/helper/PipelineCaseHelper.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/helper/PipelineCaseHelper.java @@ -26,8 +26,8 @@ import org.apache.commons.lang3.tuple.Pair; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm; import org.apache.shardingsphere.test.e2e.data.pipeline.util.AutoIncrementKeyGenerateAlgorithm; diff --git a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/engine/base/TransactionBaseE2EIT.java b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/engine/base/TransactionBaseE2EIT.java index 1bb88e4b5f00e..e9bf2b9afc337 100644 --- a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/engine/base/TransactionBaseE2EIT.java +++ b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/engine/base/TransactionBaseE2EIT.java @@ -22,8 +22,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.database.mysql.MySQLDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.test.e2e.env.container.atomic.enums.AdapterType; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.DockerStorageContainer; import org.apache.shardingsphere.test.e2e.env.runtime.DataSourceEnvironment; diff --git a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/framework/container/config/proxy/ProxyClusterContainerConfigurationFactory.java b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/framework/container/config/proxy/ProxyClusterContainerConfigurationFactory.java index dab0ce7eec46e..add0e54c73e42 100644 --- a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/framework/container/config/proxy/ProxyClusterContainerConfigurationFactory.java +++ b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/framework/container/config/proxy/ProxyClusterContainerConfigurationFactory.java @@ -20,8 +20,8 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.test.e2e.env.container.atomic.adapter.config.AdaptorContainerConfiguration; import org.apache.shardingsphere.test.e2e.env.container.atomic.constants.ProxyContainerConstants; import org.apache.shardingsphere.test.e2e.env.container.atomic.util.AdapterContainerUtils; diff --git a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/env/DataSetEnvironmentManager.java b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/env/DataSetEnvironmentManager.java index 23e854061ba76..267c09d52d167 100644 --- a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/env/DataSetEnvironmentManager.java +++ b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/env/DataSetEnvironmentManager.java @@ -20,8 +20,8 @@ import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeFactory; -import org.apache.shardingsphere.infra.database.core.type.dialect.OpenGaussDatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.PostgreSQLDatabaseType; +import org.apache.shardingsphere.infra.database.opengauss.OpenGaussDatabaseType; +import org.apache.shardingsphere.infra.database.postgresql.PostgreSQLDatabaseType; import org.apache.shardingsphere.infra.database.spi.DatabaseType; import org.apache.shardingsphere.infra.datanode.DataNode; import org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine; diff --git a/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/consistencycheck/algorithm/DataMatchDataConsistencyCalculateAlgorithmTest.java b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/consistencycheck/algorithm/DataMatchDataConsistencyCalculateAlgorithmTest.java index 0f0c09a4c497a..9a3cf929a8129 100644 --- a/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/consistencycheck/algorithm/DataMatchDataConsistencyCalculateAlgorithmTest.java +++ b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/consistencycheck/algorithm/DataMatchDataConsistencyCalculateAlgorithmTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.data.pipeline.core.consistencycheck.algorithm.DataMatchDataConsistencyCalculateAlgorithm; import org.apache.shardingsphere.data.pipeline.core.consistencycheck.result.DataConsistencyCalculatedResult; import org.apache.shardingsphere.infra.database.spi.DatabaseType; -import org.apache.shardingsphere.infra.database.core.type.dialect.H2DatabaseType; +import org.apache.shardingsphere.infra.database.h2.H2DatabaseType; import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader; import org.apache.shardingsphere.test.util.PropertiesBuilder; import org.apache.shardingsphere.test.util.PropertiesBuilder.Property;