This is an automated email from the ASF dual-hosted git repository.
jianbin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git
The following commit(s) were added to refs/heads/2.x by this push:
new 87b6e5fe34 bugfix: fix sql exception when checking for the existence
of the UNDO_LOG table on SQL server (#6380)
87b6e5fe34 is described below
commit 87b6e5fe34cac5c90e0415c133b41d7bee74251a
Author: gggyd123 <[email protected]>
AuthorDate: Wed Feb 28 16:26:51 2024 +0800
bugfix: fix sql exception when checking for the existence of the UNDO_LOG
table on SQL server (#6380)
---
changes/en-us/2.x.md | 3 ++-
changes/zh-cn/2.x.md | 2 ++
.../rm/datasource/undo/sqlserver/SqlServerUndoLogManager.java | 7 +++++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 98e9f23584..327e258809 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -27,7 +27,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6354](https://github.com/apache/incubator-seata/pull/6354)] fix dynamic
degradation does not work properly
- [[#6363](https://github.com/apache/incubator-seata/pull/6363)] fix known
problems of docker image
- [[#6372](https://github.com/apache/incubator-seata/pull/6372)] fix
initializing the sql file postgresql.sql index name conflict
-
+- [[#6380](https://github.com/apache/incubator-seata/pull/6380)] fix sql
exception when checking for the existence of the UNDO_LOG table on SQL server
### optimize:
- [[#6031](https://github.com/apache/incubator-seata/pull/6031)] add a check
for the existence of the undolog table
@@ -146,5 +146,6 @@ Thanks to these contributors for their code commits. Please
report an unintended
- [jsbxyyx](https://github.com/jsbxyyx)
- [liuqiufeng](https://github.com/liuqiufeng)
- [saberyjs](https://github.com/SABERYJS)
+- [gggyd123](https://github.com/gggyd123)
Also, we receive many valuable issues, questions and advices from our
community. Thanks for you all.
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index a432e30de9..5c60b573d6 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -27,6 +27,7 @@
- [[#6354](https://github.com/apache/incubator-seata/pull/6354)]
修复动态升降级不能正常工作问题
- [[#6363](https://github.com/apache/incubator-seata/pull/6363)]
修复docker镜像中的已知问题
- [[#6372](https://github.com/apache/incubator-seata/pull/6372)]
修复初始化sql文件postgresql.sql 索引名称冲突问题
+- [[#6380](https://github.com/apache/incubator-seata/pull/6380)] 修复针对sql
server检查UNDO_LOG表是否存在时的SQL异常
@@ -147,5 +148,6 @@
- [jsbxyyx](https://github.com/jsbxyyx)
- [liuqiufeng](https://github.com/liuqiufeng)
- [saberyjs](https://github.com/SABERYJS)
+- [gggyd123](https://github.com/gggyd123)
同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
diff --git
a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/undo/sqlserver/SqlServerUndoLogManager.java
b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/undo/sqlserver/SqlServerUndoLogManager.java
index ac98535d25..1fdc6838e6 100644
---
a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/undo/sqlserver/SqlServerUndoLogManager.java
+++
b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/undo/sqlserver/SqlServerUndoLogManager.java
@@ -51,6 +51,8 @@ public class SqlServerUndoLogManager extends
AbstractUndoLogManager {
" FROM " + UNDO_LOG_TABLE_NAME +
" WHERE " + ClientTableColumnsName.UNDO_LOG_LOG_CREATED + " <= ? " +
" ORDER BY " + ClientTableColumnsName.UNDO_LOG_LOG_CREATED + " ASC )";
+
+ private static final String CHECK_UNDO_LOG_TABLE_EXIST_SQL = "SELECT TOP 1
1 FROM " + UNDO_LOG_TABLE_NAME;
@Override
protected void insertUndoLogWithGlobalFinished(String xid, long branchId,
UndoLogParser undoLogParser, Connection conn) throws SQLException {
@@ -103,4 +105,9 @@ public class SqlServerUndoLogManager extends
AbstractUndoLogManager {
return "SELECT * FROM " + UNDO_LOG_TABLE_NAME + " WITH(UPDLOCK) WHERE "
+ ClientTableColumnsName.UNDO_LOG_BRANCH_XID + " = ? AND " +
ClientTableColumnsName.UNDO_LOG_XID + " = ?";
}
+
+ @Override
+ protected String getCheckUndoLogTableExistSql() {
+ return CHECK_UNDO_LOG_TABLE_EXIST_SQL;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]