You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/11/04 04:48:09 UTC
[shardingsphere] branch master updated: Add cursor transaction test case (#21924)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new fe99a8706f4 Add cursor transaction test case (#21924)
fe99a8706f4 is described below
commit fe99a8706f4c656da22d23e89570fd2508f2708c
Author: ZhangCheng <fl...@outlook.com>
AuthorDate: Fri Nov 4 12:48:02 2022 +0800
Add cursor transaction test case (#21924)
* Add cursor in transaction test case
* fix
* Fix
* Fix
* Fix
* Fix
* Fix
* Fix
* Fix
* Fix
* Fix
* Fix
* Fix
* Fix
---
.../cases/cursor/OpenGaussCursorTestCase.java | 159 +++++++++++++++++++++
.../transaction/engine/base/BaseITCase.java | 24 +---
.../engine/base/BaseTransactionITCase.java | 34 -----
.../engine/command/CursorSQLCommand.java | 51 +++++++
.../container/compose/BaseContainerComposer.java | 4 +-
.../container/compose/DockerContainerComposer.java | 1 +
.../container/compose/NativeContainerComposer.java | 1 +
.../src/test/resources/env/common/command.xml | 2 +-
.../test/resources/env/common/cursor-command.xml | 66 +++++++++
.../src/test/resources/env/it-env.properties | 2 +-
.../env/scenario/cursor/data/actual/databases.xml | 23 +++
.../env/scenario/cursor/data/actual/dataset.xml | 19 +++
.../data/actual/init-sql/mysql/01-actual-init.sql | 36 +++++
.../actual/init-sql/opengauss/01-actual-init.sql | 107 ++++++++++++++
.../actual/init-sql/postgresql/01-actual-init.sql | 36 +++++
.../scenario/cursor/data/expected/databases.xml | 21 +++
.../env/scenario/cursor/data/expected/dataset.xml | 19 +++
.../expected/init-sql/mysql/01-expected-init.sql | 30 ++++
.../init-sql/opengauss/01-expected-init.sql | 30 ++++
.../init-sql/postgresql/01-expected-init.sql | 30 ++++
.../proxy/conf/mysql}/rule.yaml | 40 ++----
.../proxy/conf/opengauss/config-sharding.yaml} | 54 +++++--
.../proxy/conf/postgresql}/rule.yaml | 5 -
.../data/actual/init-sql/mysql/01-actual-init.sql | 26 +++-
.../actual/init-sql/opengauss/01-actual-init.sql | 31 +++-
.../actual/init-sql/postgresql/01-actual-init.sql | 31 +++-
.../rule.yaml => mysql/config-sharding.yaml} | 24 +++-
.../rule.yaml => opengauss/config-sharding.yaml} | 24 +++-
.../rule.yaml => postgresql/config-sharding.yaml} | 24 +++-
29 files changed, 825 insertions(+), 129 deletions(-)
diff --git a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/cursor/OpenGaussCursorTestCase.java b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/cursor/OpenGaussCursorTestCase.java
new file mode 100644
index 00000000000..121f7cfb717
--- /dev/null
+++ b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/cursor/OpenGaussCursorTestCase.java
@@ -0,0 +1,159 @@
+/*
+ * 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.integration.transaction.cases.cursor;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.integration.transaction.cases.base.BaseTransactionTestCase;
+import org.apache.shardingsphere.integration.transaction.engine.base.BaseITCase;
+import org.apache.shardingsphere.integration.transaction.engine.base.BaseTransactionITCase;
+import org.apache.shardingsphere.integration.transaction.engine.base.TransactionTestCase;
+import org.apache.shardingsphere.integration.transaction.engine.command.CursorSQLCommand;
+import org.apache.shardingsphere.integration.transaction.engine.constants.TransactionTestConstants;
+import org.apache.shardingsphere.test.integration.env.container.atomic.constants.AdapterContainerConstants;
+
+import javax.sql.DataSource;
+import javax.xml.bind.JAXB;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Objects;
+
+import static org.junit.Assert.fail;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.CoreMatchers.is;
+
+/**
+ * OpenGauss cursor transaction integration test.
+ */
+@TransactionTestCase(dbTypes = {TransactionTestConstants.OPENGAUSS}, adapters = {AdapterContainerConstants.PROXY}, scenario = "cursor")
+@Slf4j
+public final class OpenGaussCursorTestCase extends BaseTransactionTestCase {
+
+ private final CursorSQLCommand cursorSQLCommand;
+
+ public OpenGaussCursorTestCase(final BaseTransactionITCase baseTransactionITCase, final DataSource dataSource) {
+ super(baseTransactionITCase, dataSource);
+ this.cursorSQLCommand = loadCursorSQLCommand();
+ }
+
+ private CursorSQLCommand loadCursorSQLCommand() {
+ return JAXB.unmarshal(Objects.requireNonNull(BaseITCase.class.getClassLoader().getResource("env/common/cursor-command.xml")), CursorSQLCommand.class);
+ }
+
+ @Override
+ protected void beforeTest() throws SQLException {
+ super.beforeTest();
+ Connection conn = getDataSource().getConnection();
+ executeWithLog(conn, "CREATE OR REPLACE VIEW t_order_view AS SELECT * FROM t_order;");
+ }
+
+ @Override
+ public void executeTest() throws SQLException {
+ Connection conn = getDataSource().getConnection();
+ broadcastTableCursorTest(conn);
+ broadcastTableCursorTest2(conn);
+ broadcastAndSingleTablesCursorTest(conn);
+ broadcastAndSingleTablesCursorTest2(conn);
+ viewCursorTest(conn);
+ }
+
+ private void broadcastTableCursorTest(final Connection conn) throws SQLException {
+ executeWithLog(conn, "start transaction;");
+ executeWithLog(conn, cursorSQLCommand.getBroadcastTablesCursor());
+ executeWithLog(conn, "close test;");
+ executeWithLog(conn, cursorSQLCommand.getBroadcastTablesCursor());
+ fetch(conn, 10101);
+ fetch(conn, 10102);
+ fetch(conn, 10201);
+ fetch(conn, 10202);
+ fetchOver(conn);
+ fetchOver(conn);
+ executeWithLog(conn, "rollback;");
+ }
+
+ private void broadcastTableCursorTest2(final Connection conn) throws SQLException {
+ executeWithLog(conn, "start transaction;");
+ executeWithLog(conn, cursorSQLCommand.getBroadcastTablesCursor2());
+ executeWithLog(conn, "close test;");
+ executeWithLog(conn, cursorSQLCommand.getBroadcastTablesCursor2());
+ fetch(conn, 10101);
+ fetch(conn, 10102);
+ fetch(conn, 10201);
+ fetch(conn, 10202);
+ fetchOver(conn);
+ fetchOver(conn);
+ executeWithLog(conn, "rollback;");
+ }
+
+ private void broadcastAndSingleTablesCursorTest(final Connection conn) throws SQLException {
+ executeWithLog(conn, "start transaction;");
+ executeWithLog(conn, cursorSQLCommand.getBroadcastAndSingleTablesCursor());
+ executeWithLog(conn, "close test;");
+ executeWithLog(conn, cursorSQLCommand.getBroadcastAndSingleTablesCursor());
+ fetch(conn, 1);
+ fetch(conn, 2);
+ fetch(conn, 3);
+ fetch(conn, 4);
+ fetchOver(conn);
+ fetchOver(conn);
+ executeWithLog(conn, "rollback;");
+ }
+
+ private void broadcastAndSingleTablesCursorTest2(final Connection conn) throws SQLException {
+ executeWithLog(conn, "start transaction;");
+ executeWithLog(conn, cursorSQLCommand.getBroadcastTablesCursor2());
+ executeWithLog(conn, "close test;");
+ executeWithLog(conn, cursorSQLCommand.getBroadcastTablesCursor2());
+ fetch(conn, 10101);
+ fetch(conn, 10102);
+ fetch(conn, 10201);
+ fetch(conn, 10202);
+ fetchOver(conn);
+ fetchOver(conn);
+ executeWithLog(conn, "rollback;");
+ }
+
+ private void viewCursorTest(final Connection conn) throws SQLException {
+ executeWithLog(conn, "start transaction;");
+ executeWithLog(conn, cursorSQLCommand.getViewCursor());
+ executeWithLog(conn, "close test;");
+ executeWithLog(conn, cursorSQLCommand.getViewCursor());
+ fetch(conn, 1);
+ fetch(conn, 2);
+ fetch(conn, 3);
+ fetch(conn, 4);
+ fetchOver(conn);
+ fetchOver(conn);
+ executeWithLog(conn, "rollback;");
+ }
+
+ private void fetch(final Connection conn, final int expectedId) throws SQLException {
+ ResultSet rs = executeQueryWithLog(conn, "fetch test;");
+ while (rs.next()) {
+ int id = rs.getInt("id");
+ assertThat(id, is(expectedId));
+ }
+ }
+
+ private void fetchOver(final Connection conn) throws SQLException {
+ ResultSet rs = executeQueryWithLog(conn, "fetch test;");
+ while (rs.next()) {
+ fail("Expected fetch nothing.");
+ }
+ }
+}
diff --git a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
index f6da2a97985..e3af063da9e 100644
--- a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
+++ b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
@@ -107,7 +107,7 @@ public abstract class BaseITCase {
log.info("Load transaction test case classes time consume: {}.", System.currentTimeMillis() - startTime);
}
- public BaseITCase(final TransactionParameterized parameterized) throws SQLException {
+ public BaseITCase(final TransactionParameterized parameterized) {
databaseType = parameterized.getDatabaseType();
adapter = parameterized.getAdapter();
containerComposer = initializeContainerComposer(parameterized);
@@ -131,30 +131,10 @@ public abstract class BaseITCase {
return parameterized.getAdapter().equalsIgnoreCase(AdapterContainerConstants.PROXY);
}
- private ProxyDataSource createProxyDataSource() throws SQLException {
- initProxyDatabase();
+ private ProxyDataSource createProxyDataSource() {
return new ProxyDataSource(containerComposer, SHARDING_DB, ENV.getProxyUserName(), ENV.getProxyPassword());
}
- private void initProxyDatabase() throws SQLException {
- String jdbcUrl = getProxyJdbcUrl(databaseType);
- try (Connection connection = DriverManager.getConnection(jdbcUrl, ENV.getProxyUserName(), ENV.getProxyPassword())) {
- executeWithLog(connection, "CREATE DATABASE " + SHARDING_DB);
- }
- }
-
- private String getProxyJdbcUrl(final DatabaseType databaseType) {
- String defaultDatabaseName = "";
- if (DatabaseTypeUtil.isPostgreSQL(databaseType) || DatabaseTypeUtil.isOpenGauss(databaseType)) {
- defaultDatabaseName = "postgres";
- }
- String result = containerComposer.getProxyJdbcUrl(defaultDatabaseName);
- if (DatabaseTypeUtil.isPostgreSQL(databaseType) || DatabaseTypeUtil.isOpenGauss(databaseType)) {
- result = JDBC_URL_APPENDER.appendQueryProperties(result, getPostgreSQLQueryProperties());
- }
- return result;
- }
-
private Properties getPostgreSQLQueryProperties() {
Properties result = new Properties();
result.put("preferQueryMode", "extendedForPrepared");
diff --git a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
index ae2bc5211e0..80435443873 100644
--- a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
+++ b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
@@ -43,28 +43,6 @@ public abstract class BaseTransactionITCase extends BaseITCase {
public BaseTransactionITCase(final TransactionParameterized parameterized) throws SQLException {
super(parameterized);
- if (isProxyAdapter(parameterized)) {
- initProxyConfig();
- } else {
- initJdbcConfig();
- }
- }
-
- private void initProxyConfig() throws SQLException {
- addResources();
- createTables();
- }
-
- private void initJdbcConfig() throws SQLException {
- createTables();
- }
-
- private void createTables() throws SQLException {
- Connection conn = getProxyConnection();
- createOrderTable(conn);
- createOrderItemTable(conn);
- createAccountTable(conn);
- createAddressTable(conn);
}
/**
@@ -87,18 +65,6 @@ public abstract class BaseTransactionITCase extends BaseITCase {
executeWithLog(connection, "drop table if exists account;");
}
- private void createOrderItemTable(final Connection connection) throws SQLException {
- executeWithLog(connection, getCommonSQLCommand().getCreateOrderItemTable());
- }
-
- private void createAddressTable(final Connection connection) throws SQLException {
- executeWithLog(connection, getCommonSQLCommand().getCreateAddressTable());
- }
-
- private void createOrderTable(final Connection connection) throws SQLException {
- executeWithLog(connection, getCommonSQLCommand().getCreateOrderTable());
- }
-
private void alterLocalTransactionRule() throws SQLException {
Connection connection = getProxyConnection();
if (isExpectedTransactionRule(connection, TransactionType.LOCAL, "")) {
diff --git a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/command/CursorSQLCommand.java b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/command/CursorSQLCommand.java
new file mode 100644
index 00000000000..bd058fdb54c
--- /dev/null
+++ b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/command/CursorSQLCommand.java
@@ -0,0 +1,51 @@
+/*
+ * 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.integration.transaction.engine.command;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "command")
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class CursorSQLCommand {
+
+ @XmlElement(name = "broadcast-tables-cursor")
+ private String broadcastTablesCursor;
+
+ @XmlElement(name = "broadcast-tables-cursor2")
+ private String broadcastTablesCursor2;
+
+ @XmlElement(name = "broadcast-and-sharding-tables-cursor")
+ private String broadcastAndShardingTablesCursor;
+
+ @XmlElement(name = "broadcast-and-single-tables-cursor")
+ private String broadcastAndSingleTablesCursor;
+
+ @XmlElement(name = "broadcast-and-single-tables-cursor2")
+ private String broadcastAndSingleTablesCursor2;
+
+ @XmlElement(name = "view-cursor")
+ private String viewCursor;
+}
diff --git a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/BaseContainerComposer.java b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/BaseContainerComposer.java
index 03642a4d3c2..be2350c1847 100644
--- a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/BaseContainerComposer.java
+++ b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/BaseContainerComposer.java
@@ -26,8 +26,8 @@ public abstract class BaseContainerComposer implements Startable {
@Getter
private final ITContainers containers;
- public BaseContainerComposer() {
- this.containers = new ITContainers("");
+ public BaseContainerComposer(final String scenario) {
+ this.containers = new ITContainers(scenario);
}
/**
diff --git a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/DockerContainerComposer.java b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/DockerContainerComposer.java
index 0c56fd6f382..a3a10ba07c7 100644
--- a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/DockerContainerComposer.java
+++ b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/DockerContainerComposer.java
@@ -55,6 +55,7 @@ public final class DockerContainerComposer extends BaseContainerComposer {
private final DockerStorageContainer storageContainer;
public DockerContainerComposer(final TransactionParameterized parameterized) {
+ super(parameterized.getScenario());
this.databaseType = parameterized.getDatabaseType();
governanceContainer = getContainers().registerContainer(new ZookeeperContainer());
storageContainer =
diff --git a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/NativeContainerComposer.java b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/NativeContainerComposer.java
index 20b6653789a..2f6741f45f4 100644
--- a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/NativeContainerComposer.java
+++ b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/NativeContainerComposer.java
@@ -28,6 +28,7 @@ public final class NativeContainerComposer extends BaseContainerComposer {
private final DatabaseType databaseType;
public NativeContainerComposer(final DatabaseType databaseType) {
+ super("");
this.databaseType = databaseType;
}
diff --git a/test/integration-test/transaction/src/test/resources/env/common/command.xml b/test/integration-test/transaction/src/test/resources/env/common/command.xml
index 8389bf49f1d..c73555a57d8 100644
--- a/test/integration-test/transaction/src/test/resources/env/common/command.xml
+++ b/test/integration-test/transaction/src/test/resources/env/common/command.xml
@@ -125,7 +125,7 @@
</create-order-item-table>
<create-address-table>
- CREATE TABLE IF NOT EXISTS t_address
+ CREATE TABLE t_address
(
id BIGINT NOT NULL,
code VARCHAR(36) DEFAULT NULL,
diff --git a/test/integration-test/transaction/src/test/resources/env/common/cursor-command.xml b/test/integration-test/transaction/src/test/resources/env/common/cursor-command.xml
new file mode 100644
index 00000000000..cd07044335e
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/common/cursor-command.xml
@@ -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.
+ -->
+
+<command>
+ <broadcast-tables-cursor>
+ cursor test for
+ select t_province.province_id, t_province.province_name, t_city.city_id as id, t_city.city_name
+ from t_city, t_province
+ where t_province.province_id = t_city.province_id
+ order by id;
+ </broadcast-tables-cursor>
+
+ <broadcast-tables-cursor2>
+ cursor test for
+ select b.province_id, b.province_name, a.city_id as id, a.city_name, c.country_id
+ from t_city a, t_province b, t_country c
+ where b.province_id = a.province_id
+ and a.country_id in (select country_id from t_country)
+ order by id;
+ </broadcast-tables-cursor2>
+
+ <broadcast-and-sharding-tables-cursor>
+ cursor test for
+ select a.address_id as id, a.address, b.city_name
+ from t_address a, t_city b
+ where b.city_id = a.city_id
+ and a.address_id in (select address_id from t_order)
+ order by id;
+ </broadcast-and-sharding-tables-cursor>
+
+ <broadcast-and-single-tables-cursor>
+ cursor test for
+ select a.address_id as id, a.address, b.city_name
+ from t_address a, t_city b
+ where b.city_id = a.city_id
+ and a.address_id in (select address_id from t_product)
+ order by id;
+ </broadcast-and-single-tables-cursor>
+
+ <broadcast-and-single-tables-cursor2>
+ cursor test for
+ select a.city_id as id, a.city_name, b.province_id, b.province_name
+ from t_city a, t_province b
+ where a.province_id = b.province_id
+ and a.city_id in (select c.city_id from t_address c, t_product d where c.address_id = d.address_id)
+ order by id;
+ </broadcast-and-single-tables-cursor2>
+
+ <view-cursor>
+ cursor test for select * from t_order_view;
+ </view-cursor>
+</command>
diff --git a/test/integration-test/transaction/src/test/resources/env/it-env.properties b/test/integration-test/transaction/src/test/resources/env/it-env.properties
index 8210ca71416..fac4d6e9534 100644
--- a/test/integration-test/transaction/src/test/resources/env/it-env.properties
+++ b/test/integration-test/transaction/src/test/resources/env/it-env.properties
@@ -17,7 +17,7 @@
# transaction.it.type=NONE,DOCKER,NATIVE
transaction.it.env.type=NONE
# transaction.it.env.cases= MySQLAutoCommitTestCase, PostgresSQLAutoCommitTestCase, ClassicTransferTestCase, MultiTableCommitAndRollbackTestCase, SingleTableCommitAndRollbackTestCase, MySQLSetReadOnlyTestCase, MySQLSavePointTestCase, PostgreSQLSavePointTestCase
-transaction.it.env.cases=BroadcastTableTransactionTestCase, ExceptionInTransactionTestCase, MultiTableCommitAndRollbackTestCase, SingleTableCommitAndRollbackTestCase, MySQLSetReadOnlyTestCase, MySQLSavePointTestCase, MySQLLocalTruncateTestCase, MySQLXATruncateTestCase
+transaction.it.env.cases=BroadcastTableTransactionTestCase, ExceptionInTransactionTestCase, MultiTableCommitAndRollbackTestCase, SingleTableCommitAndRollbackTestCase, MySQLSetReadOnlyTestCase, MySQLSavePointTestCase, MySQLLocalTruncateTestCase, MySQLXATruncateTestCase, OpenGaussCursorTestCase
# transaction.it.env.transtypes=LOCAL, XA, BASE
transaction.it.env.transtypes=LOCAL, XA
# transaction.it.env.xa.providers=Atomikos, Bitronix, Narayana
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/databases.xml b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/databases.xml
new file mode 100644
index 00000000000..0299da53ea9
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/databases.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<databases>
+ <database>transaction_it_0</database>
+ <database>transaction_it_1</database>
+ <database>transaction_it_2</database>
+</databases>
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/dataset.xml b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/dataset.xml
new file mode 100644
index 00000000000..8046c1c861f
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/dataset.xml
@@ -0,0 +1,19 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+</dataset>
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/mysql/01-actual-init.sql b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/mysql/01-actual-init.sql
new file mode 100644
index 00000000000..093677cc45c
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/mysql/01-actual-init.sql
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+--
+--
+-- 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.
+--
+
+DROP DATABASE IF EXISTS transaction_it_0;
+CREATE DATABASE transaction_it_0;
+
+DROP DATABASE IF EXISTS transaction_it_1;
+CREATE DATABASE transaction_it_1;
+
+DROP DATABASE IF EXISTS transaction_it_2;
+CREATE DATABASE transaction_it_2;
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/opengauss/01-actual-init.sql b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/opengauss/01-actual-init.sql
new file mode 100644
index 00000000000..655516bf8d2
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/opengauss/01-actual-init.sql
@@ -0,0 +1,107 @@
+/*
+ * 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.
+ */
+
+--
+--
+-- 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.
+--
+
+DROP DATABASE IF EXISTS transaction_it_0;
+DROP DATABASE IF EXISTS transaction_it_1;
+DROP DATABASE IF EXISTS transaction_it_2;
+
+CREATE DATABASE transaction_it_0;
+CREATE DATABASE transaction_it_1;
+CREATE DATABASE transaction_it_2;
+
+GRANT ALL PRIVILEGES ON DATABASE transaction_it_0 TO test_user;
+GRANT ALL PRIVILEGES ON DATABASE transaction_it_1 TO test_user;
+GRANT ALL PRIVILEGES ON DATABASE transaction_it_2 TO test_user;
+
+\c transaction_it_0;
+
+CREATE TABLE "t_product" ("product_id" INT NOT NULL, "address_id" INT, "product_name" varchar, "category_id" INT NOT NULL, "price" numeric NOT NULL, "status" varchar, "creation_date" date);
+CREATE TABLE "t_order_0" ("order_id" INT PRIMARY KEY, "address_id" INT, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_1" ("order_id" INT PRIMARY KEY, "address_id" INT, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_item_0" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "t_order_item_1" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "account_0"("ID" BIGINT, "BALANCE" FLOAT, "TRANSACTION_ID" INT);
+CREATE TABLE "account_1"("ID" BIGINT, "BALANCE" FLOAT, "TRANSACTION_ID" INT);
+CREATE TABLE "t_address" ("address_id" INT PRIMARY KEY, "code" VARCHAR(36) DEFAULT NULL, "address" VARCHAR(36) DEFAULT NULL, "city_id" INT, "province_id" INT, "country_id" INT);
+CREATE TABLE "t_country" ("country_id" INT PRIMARY KEY, "country_name" VARCHAR, "continent_name" VARCHAR, "creation_date" DATE NOT NULL);
+CREATE TABLE "t_province" ("province_id" INT PRIMARY KEY, "country_id" INT, "province_name" VARCHAR, "creation_date" DATE NOT NULL);
+CREATE TABLE "t_city" ("city_id" INT PRIMARY KEY, "province_id" INT, "country_id" INT, "city_name" VARCHAR, "creation_date" DATE NOT NULL);
+
+INSERT INTO "t_address" ("address_id", "code", "address", "city_id", "province_id", "country_id") VALUES (1, '1', 'address1', 10101, 101, 1);
+INSERT INTO "t_address" ("address_id", "code", "address", "city_id", "province_id", "country_id") VALUES (2, '2', 'address2', 10102, 101, 1);
+INSERT INTO "t_address" ("address_id", "code", "address", "city_id", "province_id", "country_id") VALUES (3, '3', 'address3', 10201, 102, 1);
+INSERT INTO "t_address" ("address_id", "code", "address", "city_id", "province_id", "country_id") VALUES (4, '4', 'address4', 10202, 102, 1);
+
+INSERT INTO "t_city" ("city_id", "province_id", "country_id", "city_name", "creation_date") VALUES (10101, 101, 1, 'NanJing', '2022-11-02');
+INSERT INTO "t_city" ("city_id", "province_id", "country_id", "city_name", "creation_date") VALUES (10102, 101, 1, 'SuZhou', '2022-11-02');
+INSERT INTO "t_city" ("city_id", "province_id", "country_id", "city_name", "creation_date") VALUES (10201, 102, 1, 'HangZhou', '2022-11-02');
+INSERT INTO "t_city" ("city_id", "province_id", "country_id", "city_name", "creation_date") VALUES (10202, 102, 1, 'NingBo', '2022-11-02');
+
+INSERT INTO "t_province" ("province_id", "country_id", "province_name", "creation_date") VALUES (101, 1, 'JiangSu', '2022-11-01');
+INSERT INTO "t_province" ("province_id", "country_id", "province_name", "creation_date") VALUES (102, 1, 'ZheJiang', '2022-11-01');
+
+INSERT INTO "t_country" ("country_id", "country_name", "continent_name", "creation_date") VALUES (1, 'China', 'Asia', '2022-11-01');
+
+INSERT INTO "t_order_0" ("order_id", "address_id", "user_id", "status") VALUES (2, 1, 2, 'OK');
+INSERT INTO "t_order_1" ("order_id", "address_id", "user_id", "status") VALUES (1, 2, 2, 'OK');
+
+INSERT INTO "t_product" ("product_id", "address_id", "product_name", "category_id", "price", "status", "creation_date") VALUES (1, 1, 'product1', 1, 1, 'OK', '2022-11-02');
+INSERT INTO "t_product" ("product_id", "address_id", "product_name", "category_id", "price", "status", "creation_date") VALUES (2, 2, 'product2', 2, 2, 'OK', '2022-11-02');
+INSERT INTO "t_product" ("product_id", "address_id", "product_name", "category_id", "price", "status", "creation_date") VALUES (3, 3, 'product3', 3, 3, 'OK', '2022-11-02');
+INSERT INTO "t_product" ("product_id", "address_id", "product_name", "category_id", "price", "status", "creation_date") VALUES (4, 4, 'product4', 4, 4, 'OK', '2022-11-02');
+
+\c transaction_it_1;
+
+CREATE TABLE "t_order_0" ("order_id" INT PRIMARY KEY, "address_id" INT, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_1" ("order_id" INT PRIMARY KEY, "address_id" INT, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_item_0" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "t_order_item_1" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "account_0"("ID" BIGINT, "BALANCE" FLOAT, "TRANSACTION_ID" INT);
+CREATE TABLE "account_1"("ID" BIGINT, "BALANCE" FLOAT, "TRANSACTION_ID" INT);
+CREATE TABLE "t_address" ("address_id" INT PRIMARY KEY, "code" VARCHAR(36) DEFAULT NULL, "address" VARCHAR(36) DEFAULT NULL, "city_id" INT, "province_id" INT, "country_id" INT);
+CREATE TABLE "t_country" ("country_id" INT PRIMARY KEY, "country_name" VARCHAR, "continent_name" VARCHAR, "creation_date" DATE NOT NULL);
+CREATE TABLE "t_province" ("province_id" INT PRIMARY KEY, "country_id" INT, "province_name" VARCHAR, "creation_date" DATE NOT NULL);
+CREATE TABLE "t_city" ("city_id" INT PRIMARY KEY, "province_id" INT, "country_id" INT, "city_name" VARCHAR, "creation_date" DATE NOT NULL);
+
+INSERT INTO "t_address" ("address_id", "code", "address", "city_id", "province_id", "country_id") VALUES (1, '1', 'address1', 10101, 101, 1);
+INSERT INTO "t_address" ("address_id", "code", "address", "city_id", "province_id", "country_id") VALUES (2, '2', 'address2', 10102, 101, 1);
+INSERT INTO "t_address" ("address_id", "code", "address", "city_id", "province_id", "country_id") VALUES (3, '3', 'address3', 10201, 102, 1);
+INSERT INTO "t_address" ("address_id", "code", "address", "city_id", "province_id", "country_id") VALUES (4, '4', 'address4', 10202, 102, 1);
+
+INSERT INTO "t_city" ("city_id", "province_id", "country_id", "city_name", "creation_date") VALUES (10101, 101, 1, 'NanJing', '2022-11-02');
+INSERT INTO "t_city" ("city_id", "province_id", "country_id", "city_name", "creation_date") VALUES (10102, 101, 1, 'SuZhou', '2022-11-02');
+INSERT INTO "t_city" ("city_id", "province_id", "country_id", "city_name", "creation_date") VALUES (10201, 102, 1, 'HangZhou', '2022-11-02');
+INSERT INTO "t_city" ("city_id", "province_id", "country_id", "city_name", "creation_date") VALUES (10202, 102, 1, 'NingBo', '2022-11-02');
+
+INSERT INTO "t_province" ("province_id", "country_id", "province_name", "creation_date") VALUES (101, 1, 'JiangSu', '2022-11-01');
+INSERT INTO "t_province" ("province_id", "country_id", "province_name", "creation_date") VALUES (102, 1, 'ZheJiang', '2022-11-01');
+
+INSERT INTO "t_country" ("country_id", "country_name", "continent_name", "creation_date") VALUES (1, 'China', 'Asia', '2022-11-01');
+
+INSERT INTO "t_order_0" ("order_id", "address_id", "user_id", "status") VALUES (2, 3, 1, 'OK');
+INSERT INTO "t_order_1" ("order_id", "address_id", "user_id", "status") VALUES (1, 4, 1, 'OK');
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/postgresql/01-actual-init.sql b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/postgresql/01-actual-init.sql
new file mode 100644
index 00000000000..093677cc45c
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/postgresql/01-actual-init.sql
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+--
+--
+-- 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.
+--
+
+DROP DATABASE IF EXISTS transaction_it_0;
+CREATE DATABASE transaction_it_0;
+
+DROP DATABASE IF EXISTS transaction_it_1;
+CREATE DATABASE transaction_it_1;
+
+DROP DATABASE IF EXISTS transaction_it_2;
+CREATE DATABASE transaction_it_2;
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/databases.xml b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/databases.xml
new file mode 100644
index 00000000000..a98d7b55e9d
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/databases.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<databases>
+ <database>dataset</database>
+</databases>
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/dataset.xml b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/dataset.xml
new file mode 100644
index 00000000000..8046c1c861f
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/dataset.xml
@@ -0,0 +1,19 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+</dataset>
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/init-sql/mysql/01-expected-init.sql b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/init-sql/mysql/01-expected-init.sql
new file mode 100644
index 00000000000..9cf9e275c26
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/init-sql/mysql/01-expected-init.sql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+--
+--
+-- 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.
+--
+
+DROP DATABASE IF EXISTS dataset;
+CREATE DATABASE dataset;
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/init-sql/opengauss/01-expected-init.sql b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/init-sql/opengauss/01-expected-init.sql
new file mode 100644
index 00000000000..9cf9e275c26
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/init-sql/opengauss/01-expected-init.sql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+--
+--
+-- 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.
+--
+
+DROP DATABASE IF EXISTS dataset;
+CREATE DATABASE dataset;
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/init-sql/postgresql/01-expected-init.sql b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/init-sql/postgresql/01-expected-init.sql
new file mode 100644
index 00000000000..9cf9e275c26
--- /dev/null
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/expected/init-sql/postgresql/01-expected-init.sql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+--
+--
+-- 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.
+--
+
+DROP DATABASE IF EXISTS dataset;
+CREATE DATABASE dataset;
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/opengauss/rule.yaml b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/proxy/conf/mysql/rule.yaml
similarity index 79%
copy from test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/opengauss/rule.yaml
copy to test/integration-test/transaction/src/test/resources/env/scenario/cursor/proxy/conf/mysql/rule.yaml
index b59153145dd..e4bad6b0062 100644
--- a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/opengauss/rule.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/proxy/conf/mysql/rule.yaml
@@ -23,8 +23,6 @@
databaseName: sharding_db
rules:
- - !TRANSACTION
- defaultType: LOCAL
- !SHARDING
tables:
t_order:
@@ -36,32 +34,31 @@ rules:
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
- t_order_item:
- actualDataNodes: ds_${0..1}.t_order_item_${0..1}
+ t_order_view:
+ actualDataNodes: ds_${0..1}.t_order_${0..1}
tableStrategy:
standard:
shardingColumn: order_id
- shardingAlgorithmName: t_order_item_inline
+ shardingAlgorithmName: t_order_inline
keyGenerateStrategy:
- column: order_item_id
+ column: order_id
keyGeneratorName: snowflake
- account:
- actualDataNodes: ds_${0..1}.account_${0..1}
- databaseStrategy:
- standard:
- shardingColumn: id
- shardingAlgorithmName: database_id_inline
+ t_order_item:
+ actualDataNodes: ds_${0..1}.t_order_item_${0..1}
tableStrategy:
standard:
- shardingColumn: id
- shardingAlgorithmName: account_inline
+ shardingColumn: order_id
+ shardingAlgorithmName: t_order_item_inline
keyGenerateStrategy:
- column: id
+ column: order_item_id
keyGeneratorName: snowflake
bindingTables:
- - t_order,t_order_item
+ - t_order,t_order_item,t_order_view
broadcastTables:
- t_address
+ - t_city
+ - t_province
+ - t_country
defaultDatabaseStrategy:
standard:
shardingColumn: user_id
@@ -74,10 +71,6 @@ rules:
type: INLINE
props:
algorithm-expression: ds_${user_id % 2}
- database_id_inline:
- type: INLINE
- props:
- algorithm-expression: ds_${id % 2}
t_order_inline:
type: INLINE
props:
@@ -86,14 +79,7 @@ rules:
type: INLINE
props:
algorithm-expression: t_order_item_${order_id % 2}
- account_inline:
- type: INLINE
- props:
- algorithm-expression: account_${Math.floorMod(Math.floorDiv(id.longValue(), 2L), 2L)}
keyGenerators:
snowflake:
type: SNOWFLAKE
-
-props:
- sql-show: false
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/rule.yaml b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/proxy/conf/opengauss/config-sharding.yaml
similarity index 68%
copy from test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/rule.yaml
copy to test/integration-test/transaction/src/test/resources/env/scenario/cursor/proxy/conf/opengauss/config-sharding.yaml
index b59153145dd..7df692d3a41 100644
--- a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/rule.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/proxy/conf/opengauss/config-sharding.yaml
@@ -22,13 +22,34 @@
######################################################################################################
databaseName: sharding_db
+dataSources:
+ ds_0:
+ url: jdbc:opengauss://opengauss.cursor.host:5432/transaction_it_0
+ username: test_user
+ password: Test@123
+ connectionTimeoutMilliseconds: 30000
+ idleTimeoutMilliseconds: 60000
+ maxLifetimeMilliseconds: 1800000
+ maxPoolSize: 2
+ minPoolSize: 2
+ ds_1:
+ url: jdbc:opengauss://opengauss.cursor.host:5432/transaction_it_1
+ username: test_user
+ password: Test@123
+ connectionTimeoutMilliseconds: 30000
+ idleTimeoutMilliseconds: 60000
+ maxLifetimeMilliseconds: 1800000
+ maxPoolSize: 2
+ minPoolSize: 2
rules:
- - !TRANSACTION
- defaultType: LOCAL
- !SHARDING
tables:
t_order:
actualDataNodes: ds_${0..1}.t_order_${0..1}
+ databaseStrategy:
+ standard:
+ shardingColumn: user_id
+ shardingAlgorithmName: database_inline
tableStrategy:
standard:
shardingColumn: order_id
@@ -36,8 +57,22 @@ rules:
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
+ t_order_view:
+ actualDataNodes: ds_${0..1}.t_order_view_${0..1}
+ databaseStrategy:
+ standard:
+ shardingColumn: user_id
+ shardingAlgorithmName: database_inline
+ tableStrategy:
+ standard:
+ shardingColumn: order_id
+ shardingAlgorithmName: t_order_view_inline
t_order_item:
actualDataNodes: ds_${0..1}.t_order_item_${0..1}
+ databaseStrategy:
+ standard:
+ shardingColumn: user_id
+ shardingAlgorithmName: database_inline
tableStrategy:
standard:
shardingColumn: order_id
@@ -59,13 +94,11 @@ rules:
column: id
keyGeneratorName: snowflake
bindingTables:
- - t_order,t_order_item
+ - t_order,t_order_item,t_order_view
broadcastTables:
- - t_address
+ - t_address,t_country,t_province,t_city
defaultDatabaseStrategy:
- standard:
- shardingColumn: user_id
- shardingAlgorithmName: database_inline
+ none:
defaultTableStrategy:
none:
@@ -82,6 +115,10 @@ rules:
type: INLINE
props:
algorithm-expression: t_order_${order_id % 2}
+ t_order_view_inline:
+ type: INLINE
+ props:
+ algorithm-expression: t_order_view_${order_id % 2}
t_order_item_inline:
type: INLINE
props:
@@ -94,6 +131,3 @@ rules:
keyGenerators:
snowflake:
type: SNOWFLAKE
-
-props:
- sql-show: false
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/opengauss/rule.yaml b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/proxy/conf/postgresql/rule.yaml
similarity index 97%
rename from test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/opengauss/rule.yaml
rename to test/integration-test/transaction/src/test/resources/env/scenario/cursor/proxy/conf/postgresql/rule.yaml
index b59153145dd..518962661b6 100644
--- a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/opengauss/rule.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/proxy/conf/postgresql/rule.yaml
@@ -23,8 +23,6 @@
databaseName: sharding_db
rules:
- - !TRANSACTION
- defaultType: LOCAL
- !SHARDING
tables:
t_order:
@@ -94,6 +92,3 @@ rules:
keyGenerators:
snowflake:
type: SNOWFLAKE
-
-props:
- sql-show: false
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/mysql/01-actual-init.sql b/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/mysql/01-actual-init.sql
index a0431f9fa45..e6ae91a2977 100644
--- a/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/mysql/01-actual-init.sql
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/mysql/01-actual-init.sql
@@ -15,11 +15,29 @@
-- limitations under the License.
--
-DROP DATABASE IF EXISTS transaction_it_0;
-CREATE DATABASE transaction_it_0;
+SET character_set_database='utf8';
+SET character_set_server='utf8';
+DROP DATABASE IF EXISTS transaction_it_0;
DROP DATABASE IF EXISTS transaction_it_1;
-CREATE DATABASE transaction_it_1;
-
DROP DATABASE IF EXISTS transaction_it_2;
+
+CREATE DATABASE transaction_it_0;
+CREATE DATABASE transaction_it_1;
CREATE DATABASE transaction_it_2;
+
+CREATE TABLE transaction_it_0.`t_order_0` (`order_id` INT PRIMARY KEY, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL);
+CREATE TABLE transaction_it_0.`t_order_1` (`order_id` INT PRIMARY KEY, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL);
+CREATE TABLE transaction_it_0.`t_order_item_0` (`item_id` INT PRIMARY KEY, `order_id` int NOT NULL, `user_id` int NOT NULL, `status` varchar(50) DEFAULT NULL);
+CREATE TABLE transaction_it_0.`t_order_item_1` (`item_id` INT PRIMARY KEY, `order_id` int NOT NULL, `user_id` int NOT NULL, `status` varchar(50) DEFAULT NULL);
+CREATE TABLE transaction_it_0.`account_0`(`ID` BIGINT, `BALANCE` FLOAT, `TRANSACTION_ID` INT);
+CREATE TABLE transaction_it_0.`account_1`(`ID` BIGINT, `BALANCE` FLOAT, `TRANSACTION_ID` INT);
+CREATE TABLE transaction_it_0.`t_address` (`id` INT PRIMARY KEY, `code` VARCHAR(36) DEFAULT NULL, `address` VARCHAR(36) DEFAULT NULL);
+
+CREATE TABLE transaction_it_1.`t_order_0` (`order_id` INT PRIMARY KEY, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL);
+CREATE TABLE transaction_it_1.`t_order_1` (`order_id` INT PRIMARY KEY, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL);
+CREATE TABLE transaction_it_1.`t_order_item_0` (`item_id` INT PRIMARY KEY, `order_id` int NOT NULL, `user_id` int NOT NULL, `status` varchar(50) DEFAULT NULL);
+CREATE TABLE transaction_it_1.`t_order_item_1` (`item_id` INT PRIMARY KEY, `order_id` int NOT NULL, `user_id` int NOT NULL, `status` varchar(50) DEFAULT NULL);
+CREATE TABLE transaction_it_1.`account_0`(`ID` BIGINT, `BALANCE` FLOAT, `TRANSACTION_ID` INT);
+CREATE TABLE transaction_it_1.`account_1`(`ID` BIGINT, `BALANCE` FLOAT, `TRANSACTION_ID` INT);
+CREATE TABLE transaction_it_1.`t_address` (`id` INT PRIMARY KEY, `code` VARCHAR(36) DEFAULT NULL, `address` VARCHAR(36) DEFAULT NULL);
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/opengauss/01-actual-init.sql b/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/opengauss/01-actual-init.sql
index a0431f9fa45..8b92ab114b6 100644
--- a/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/opengauss/01-actual-init.sql
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/opengauss/01-actual-init.sql
@@ -16,10 +16,33 @@
--
DROP DATABASE IF EXISTS transaction_it_0;
-CREATE DATABASE transaction_it_0;
-
DROP DATABASE IF EXISTS transaction_it_1;
-CREATE DATABASE transaction_it_1;
-
DROP DATABASE IF EXISTS transaction_it_2;
+
+CREATE DATABASE transaction_it_0;
+CREATE DATABASE transaction_it_1;
CREATE DATABASE transaction_it_2;
+
+GRANT ALL PRIVILEGES ON DATABASE transaction_it_0 TO test_user;
+GRANT ALL PRIVILEGES ON DATABASE transaction_it_1 TO test_user;
+GRANT ALL PRIVILEGES ON DATABASE transaction_it_2 TO test_user;
+
+\c transaction_it_0;
+
+CREATE TABLE "t_order_0" ("order_id" INT PRIMARY KEY, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_1" ("order_id" INT PRIMARY KEY, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_item_0" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "t_order_item_1" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "account_0"("id" INT, "balance" FLOAT, "transaction_id" INT);
+CREATE TABLE "account_1"("id" INT, "balance" FLOAT, "transaction_id" INT);
+CREATE TABLE "t_address" ("id" INT PRIMARY KEY, "code" VARCHAR(36) DEFAULT NULL, "address" VARCHAR(36) DEFAULT NULL);
+
+\c transaction_it_1;
+
+CREATE TABLE "t_order_0" ("order_id" INT PRIMARY KEY, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_1" ("order_id" INT PRIMARY KEY, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_item_0" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "t_order_item_1" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "account_0"("id" INT, "balance" FLOAT, "transaction_id" INT);
+CREATE TABLE "account_1"("id" INT, "balance" FLOAT, "transaction_id" INT);
+CREATE TABLE "t_address" ("id" INT PRIMARY KEY, "code" VARCHAR(36) DEFAULT NULL, "address" VARCHAR(36) DEFAULT NULL);
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/postgresql/01-actual-init.sql b/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/postgresql/01-actual-init.sql
index a0431f9fa45..8b92ab114b6 100644
--- a/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/postgresql/01-actual-init.sql
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/default/data/actual/init-sql/postgresql/01-actual-init.sql
@@ -16,10 +16,33 @@
--
DROP DATABASE IF EXISTS transaction_it_0;
-CREATE DATABASE transaction_it_0;
-
DROP DATABASE IF EXISTS transaction_it_1;
-CREATE DATABASE transaction_it_1;
-
DROP DATABASE IF EXISTS transaction_it_2;
+
+CREATE DATABASE transaction_it_0;
+CREATE DATABASE transaction_it_1;
CREATE DATABASE transaction_it_2;
+
+GRANT ALL PRIVILEGES ON DATABASE transaction_it_0 TO test_user;
+GRANT ALL PRIVILEGES ON DATABASE transaction_it_1 TO test_user;
+GRANT ALL PRIVILEGES ON DATABASE transaction_it_2 TO test_user;
+
+\c transaction_it_0;
+
+CREATE TABLE "t_order_0" ("order_id" INT PRIMARY KEY, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_1" ("order_id" INT PRIMARY KEY, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_item_0" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "t_order_item_1" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "account_0"("id" INT, "balance" FLOAT, "transaction_id" INT);
+CREATE TABLE "account_1"("id" INT, "balance" FLOAT, "transaction_id" INT);
+CREATE TABLE "t_address" ("id" INT PRIMARY KEY, "code" VARCHAR(36) DEFAULT NULL, "address" VARCHAR(36) DEFAULT NULL);
+
+\c transaction_it_1;
+
+CREATE TABLE "t_order_0" ("order_id" INT PRIMARY KEY, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_1" ("order_id" INT PRIMARY KEY, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
+CREATE TABLE "t_order_item_0" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "t_order_item_1" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE TABLE "account_0"("id" INT, "balance" FLOAT, "transaction_id" INT);
+CREATE TABLE "account_1"("id" INT, "balance" FLOAT, "transaction_id" INT);
+CREATE TABLE "t_address" ("id" INT PRIMARY KEY, "code" VARCHAR(36) DEFAULT NULL, "address" VARCHAR(36) DEFAULT NULL);
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/rule.yaml b/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/mysql/config-sharding.yaml
similarity index 82%
copy from test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/rule.yaml
copy to test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/mysql/config-sharding.yaml
index b59153145dd..a30a9b5817f 100644
--- a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/rule.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/mysql/config-sharding.yaml
@@ -22,9 +22,26 @@
######################################################################################################
databaseName: sharding_db
+dataSources:
+ ds_0:
+ url: jdbc:mysql://mysql.default.host:3306/transaction_it_0?serverTimezone=UTC&useSSL=false&characterEncoding=utf-8
+ username: test_user
+ password: Test@123
+ connectionTimeoutMilliseconds: 30000
+ idleTimeoutMilliseconds: 60000
+ maxLifetimeMilliseconds: 1800000
+ maxPoolSize: 2
+ minPoolSize: 2
+ ds_1:
+ url: jdbc:mysql://mysql.default.host:3306/transaction_it_1?serverTimezone=UTC&useSSL=false&characterEncoding=utf-8
+ username: test_user
+ password: Test@123
+ connectionTimeoutMilliseconds: 30000
+ idleTimeoutMilliseconds: 60000
+ maxLifetimeMilliseconds: 1800000
+ maxPoolSize: 2
+ minPoolSize: 2
rules:
- - !TRANSACTION
- defaultType: LOCAL
- !SHARDING
tables:
t_order:
@@ -94,6 +111,3 @@ rules:
keyGenerators:
snowflake:
type: SNOWFLAKE
-
-props:
- sql-show: false
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/rule.yaml b/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/opengauss/config-sharding.yaml
similarity index 84%
rename from test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/rule.yaml
rename to test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/opengauss/config-sharding.yaml
index b59153145dd..b3a5edec9b4 100644
--- a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/rule.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/opengauss/config-sharding.yaml
@@ -22,9 +22,26 @@
######################################################################################################
databaseName: sharding_db
+dataSources:
+ ds_0:
+ url: jdbc:opengauss://opengauss.default.host:5432/transaction_it_0
+ username: test_user
+ password: Test@123
+ connectionTimeoutMilliseconds: 30000
+ idleTimeoutMilliseconds: 60000
+ maxLifetimeMilliseconds: 1800000
+ maxPoolSize: 2
+ minPoolSize: 2
+ ds_1:
+ url: jdbc:opengauss://opengauss.default.host:5432/transaction_it_1
+ username: test_user
+ password: Test@123
+ connectionTimeoutMilliseconds: 30000
+ idleTimeoutMilliseconds: 60000
+ maxLifetimeMilliseconds: 1800000
+ maxPoolSize: 2
+ minPoolSize: 2
rules:
- - !TRANSACTION
- defaultType: LOCAL
- !SHARDING
tables:
t_order:
@@ -94,6 +111,3 @@ rules:
keyGenerators:
snowflake:
type: SNOWFLAKE
-
-props:
- sql-show: false
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/mysql/rule.yaml b/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/config-sharding.yaml
similarity index 84%
rename from test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/mysql/rule.yaml
rename to test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/config-sharding.yaml
index b59153145dd..71d8a6418c2 100644
--- a/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/mysql/rule.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/default/proxy/conf/postgresql/config-sharding.yaml
@@ -22,9 +22,26 @@
######################################################################################################
databaseName: sharding_db
+dataSources:
+ ds_0:
+ url: jdbc:postgresql://postgresql.default.host:5432/transaction_it_0
+ username: test_user
+ password: Test@123
+ connectionTimeoutMilliseconds: 30000
+ idleTimeoutMilliseconds: 60000
+ maxLifetimeMilliseconds: 1800000
+ maxPoolSize: 2
+ minPoolSize: 2
+ ds_1:
+ url: jdbc:postgresql://postgresql.default.host:5432/transaction_it_1
+ username: test_user
+ password: Test@123
+ connectionTimeoutMilliseconds: 30000
+ idleTimeoutMilliseconds: 60000
+ maxLifetimeMilliseconds: 1800000
+ maxPoolSize: 2
+ minPoolSize: 2
rules:
- - !TRANSACTION
- defaultType: LOCAL
- !SHARDING
tables:
t_order:
@@ -94,6 +111,3 @@ rules:
keyGenerators:
snowflake:
type: SNOWFLAKE
-
-props:
- sql-show: false