Skip to content

Commit

Permalink
bugfix: getQueryGlobalTransactionSQLByStatus method do not support or…
Browse files Browse the repository at this point in the history
…acle (apache#1615)
  • Loading branch information
tq02ksu committed Sep 10, 2019
1 parent 26b9875 commit 74eaf91
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions core/src/main/java/io/seata/core/store/db/LogStoreSqls.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,11 @@ public class LogStoreSqls {
+ " order by " + ServerTableColumnsName.GLOBAL_TABLE_GMT_MODIFIED + " limit ?";

public static final String QUERY_GLOBAL_TRANSACTION_BY_STATUS_ORACLE =
"select * from ("
+ " select tt.*, ROWNUM as rowno from ("
+ " select " + ALL_GLOBAL_COLUMNS + " from " + GLOBAL_TABLE_PLACEHOLD
+ " where " + ServerTableColumnsName.GLOBAL_TABLE_STATUS + " in (" + PRAMETER_PLACEHOLD + ")"
+ " order by " + ServerTableColumnsName.GLOBAL_TABLE_GMT_MODIFIED + ") tt"
+ " where ROWNUM <= ?) table_alias"
+ " where table_alias.rowno >= 0";
"select t.* from ("
+ " select " + ALL_GLOBAL_COLUMNS + " from " + GLOBAL_TABLE_PLACEHOLD
+ " where " + ServerTableColumnsName.GLOBAL_TABLE_STATUS + " in (" + PRAMETER_PLACEHOLD + ")"
+ " order by " + ServerTableColumnsName.GLOBAL_TABLE_GMT_MODIFIED + ") t"
+ "where ROWNUM <= ?)";
/**
* The constant QUERY_GLOBAL_TRANSACTION_FOR_RECOVERY_MYSQL.
*/
Expand Down Expand Up @@ -267,7 +265,9 @@ public static String getQueryGlobalTransactionSQLByTransactionId(String globalTa
*/
public static String getQueryGlobalTransactionSQLByStatus(String globalTable, String dbType,
String paramsPlaceHolder) {
if (DBType.MYSQL.name().equalsIgnoreCase(dbType)) {
if (DBType.MYSQL.name().equalsIgnoreCase(dbType)
|| DBType.OCEANBASE.name().equalsIgnoreCase(dbType)
|| DBType.H2.name().equalsIgnoreCase(dbType)) {
return QUERY_GLOBAL_TRANSACTION_BY_STATUS_MYSQL.replace(GLOBAL_TABLE_PLACEHOLD, globalTable).replace(
PRAMETER_PLACEHOLD, paramsPlaceHolder);
} else if (DBType.ORACLE.name().equalsIgnoreCase(dbType)) {
Expand Down

0 comments on commit 74eaf91

Please sign in to comment.