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/08/15 08:28:12 UTC
[shardingsphere] branch master updated: Fix transaction IT distsql syntax error (#20187)
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 898934fb883 Fix transaction IT distsql syntax error (#20187)
898934fb883 is described below
commit 898934fb883b7dac059253b2e4969c0c1bc71d3d
Author: ZhangCheng <fl...@outlook.com>
AuthorDate: Mon Aug 15 16:28:03 2022 +0800
Fix transaction IT distsql syntax error (#20187)
---
.../engine/base/BaseTransactionITCase.java | 1 +
.../src/test/resources/env/common/command.xml | 36 +++++++++++-----------
2 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
index 52a86f32521..334b89c6e96 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
@@ -173,6 +173,7 @@ public abstract class BaseTransactionITCase extends BaseITCase {
}
protected boolean waitExpectedTransactionRule(final TransactionType expectedTransType, final String expectedProviderType, final int maxWaitTimes) {
+ ThreadUtil.sleep(5, TimeUnit.SECONDS);
Connection connection = getProxyConnection();
int waitTimes = 0;
do {
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/common/command.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/common/command.xml
index 8900393776a..d0f3e59e0bc 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/common/command.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/common/command.xml
@@ -18,74 +18,74 @@
<command>
<create-database-sharding-algorithm>
CREATE SHARDING ALGORITHM database_inline (
- TYPE(NAME=INLINE,PROPERTIES("algorithm-expression"="ds_${user_id % 2}"))
+ TYPE(NAME='INLINE',PROPERTIES("algorithm-expression"="ds_${user_id % 2}"))
)
</create-database-sharding-algorithm>
<create-database-id-sharding-algorithm>
CREATE SHARDING ALGORITHM database_id_inline (
- TYPE(NAME=INLINE,PROPERTIES("algorithm-expression"="ds_${id % 2}"))
+ TYPE(NAME='INLINE',PROPERTIES("algorithm-expression"="ds_${id % 2}"))
)
</create-database-id-sharding-algorithm>
<create-order-sharding-algorithm>
CREATE SHARDING ALGORITHM t_order_inline (
- TYPE(NAME=INLINE,PROPERTIES("algorithm-expression"="t_order_${order_id % 2}"))
+ TYPE(NAME='INLINE',PROPERTIES("algorithm-expression"="t_order_${order_id % 2}"))
)
</create-order-sharding-algorithm>
<create-order-item-sharding-algorithm>
CREATE SHARDING ALGORITHM t_order_item_inline (
- TYPE(NAME=INLINE,PROPERTIES("algorithm-expression"="t_order_item_${order_id % 2}"))
+ TYPE(NAME='INLINE',PROPERTIES("algorithm-expression"="t_order_item_${order_id % 2}"))
)
</create-order-item-sharding-algorithm>
<create-account-sharding-algorithm>
CREATE SHARDING ALGORITHM account_inline (
- TYPE(NAME=INLINE,PROPERTIES("algorithm-expression"="account_${Math.floorMod(Math.floorDiv(id.longValue(), 2L), 2L)}"))
+ TYPE(NAME='INLINE',PROPERTIES("algorithm-expression"="account_${Math.floorMod(Math.floorDiv(id.longValue(), 2L), 2L)}"))
)
</create-account-sharding-algorithm>
<create-order-table-rule>
CREATE SHARDING TABLE RULE t_order (
DATANODES("ds_${0..1}.t_order_${0..1}"),
- DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=user_id,SHARDING_ALGORITHM=database_inline),
- TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=order_id,SHARDING_ALGORITHM=t_order_inline),
- KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake))
+ DATABASE_STRATEGY(TYPE='STANDARD',SHARDING_COLUMN=`user_id`,SHARDING_ALGORITHM=database_inline),
+ TABLE_STRATEGY(TYPE='STANDARD',SHARDING_COLUMN=`order_id`,SHARDING_ALGORITHM=t_order_inline),
+ KEY_GENERATE_STRATEGY(COLUMN=`order_id`,TYPE(NAME='snowflake'))
)
</create-order-table-rule>
<create-order-item-table-rule>
CREATE SHARDING TABLE RULE t_order_item (
DATANODES("ds_${0..1}.t_order_item_${0..1}"),
- DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=user_id,SHARDING_ALGORITHM=database_inline),
- TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=order_id,SHARDING_ALGORITHM=t_order_item_inline),
- KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake))
+ DATABASE_STRATEGY(TYPE='STANDARD',SHARDING_COLUMN=`user_id`,SHARDING_ALGORITHM=database_inline),
+ TABLE_STRATEGY(TYPE='STANDARD',SHARDING_COLUMN=`order_id`,SHARDING_ALGORITHM=t_order_item_inline),
+ KEY_GENERATE_STRATEGY(COLUMN=`order_id`,TYPE(NAME='snowflake'))
)
</create-order-item-table-rule>
<create-account-table-rule>
CREATE SHARDING TABLE RULE account (
DATANODES("ds_${0..1}.account_${0..1}"),
- DATABASE_STRATEGY(TYPE=standard, SHARDING_COLUMN=id, SHARDING_ALGORITHM=database_id_inline),
- TABLE_STRATEGY(TYPE=standard, SHARDING_COLUMN=id, SHARDING_ALGORITHM=account_inline),
- KEY_GENERATE_STRATEGY(COLUMN=id,TYPE(NAME=snowflake))
+ DATABASE_STRATEGY(TYPE='STANDARD', SHARDING_COLUMN=`id`, SHARDING_ALGORITHM=database_id_inline),
+ TABLE_STRATEGY(TYPE='STANDARD', SHARDING_COLUMN=`id`, SHARDING_ALGORITHM=account_inline),
+ KEY_GENERATE_STRATEGY(COLUMN=`id`,TYPE(NAME='snowflake'))
)
</create-account-table-rule>
<create-one-data-source-account-table-rule>
CREATE SHARDING TABLE RULE account (
DATANODES("ds_0.account_${0..1}"),
- DATABASE_STRATEGY(TYPE=standard, SHARDING_COLUMN=id, SHARDING_ALGORITHM(TYPE(NAME=inline, PROPERTIES("algorithm-expression"="ds_${id % 1}")))),
- TABLE_STRATEGY(TYPE=standard, SHARDING_COLUMN=id, SHARDING_ALGORITHM(TYPE(NAME=inline, PROPERTIES("algorithm-expression"="account_${Math.floorMod(Math.floorDiv(id.longValue(), 1L), 2L)}"))))
+ DATABASE_STRATEGY(TYPE='STANDARD', SHARDING_COLUMN=`id`, SHARDING_ALGORITHM(TYPE(NAME='INLINE', PROPERTIES("algorithm-expression"="ds_${id % 1}")))),
+ TABLE_STRATEGY(TYPE='STANDARD', SHARDING_COLUMN=`id`, SHARDING_ALGORITHM(TYPE(NAME='INLINE', PROPERTIES("algorithm-expression"="account_${Math.floorMod(Math.floorDiv(id.longValue(), 1L), 2L)}"))))
)
</create-one-data-source-account-table-rule>
<create-three-data-source-account-table-rule>
CREATE SHARDING TABLE RULE account (
DATANODES("ds_${0..2}.account_${0..1}"),
- DATABASE_STRATEGY(TYPE=standard, SHARDING_COLUMN=id, SHARDING_ALGORITHM(TYPE(NAME=inline, PROPERTIES("algorithm-expression"="ds_${id % 3}")))),
- TABLE_STRATEGY(TYPE=standard, SHARDING_COLUMN=id, SHARDING_ALGORITHM(TYPE(NAME=inline, PROPERTIES("algorithm-expression"="account_${Math.floorMod(Math.floorDiv(id.longValue(), 3L), 2L)}"))))
+ DATABASE_STRATEGY(TYPE='STANDARD', SHARDING_COLUMN=`id`, SHARDING_ALGORITHM(TYPE(NAME='INLINE', PROPERTIES("algorithm-expression"="ds_${id % 3}")))),
+ TABLE_STRATEGY(TYPE='STANDARD', SHARDING_COLUMN=`id`, SHARDING_ALGORITHM(TYPE(NAME='INLINE', PROPERTIES("algorithm-expression"="account_${Math.floorMod(Math.floorDiv(id.longValue(), 3L), 2L)}"))))
)
</create-three-data-source-account-table-rule>