Skip to content

Commit f3e7ed1

Browse files
committed
fix:解决数据源为Oracle时,@Explain 报错问题
解决数据源为Oracle时,使用性能分析关键字 @Explain,查询报 "ORA-00922: 选项缺失或无效"问题 issue Tencent#432 closes Tencent#432
1 parent 98f2826 commit f3e7ed1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3979,7 +3979,7 @@ public static String getSQL(AbstractSQLConfig config) throws Exception {
39793979
}
39803980
return "DELETE FROM " + tablePath + config.getWhereString(true) + (config.isMySQL() ? config.getLimitString() : ""); // PostgreSQL 不允许 LIMIT
39813981
default:
3982-
String explain = (config.isExplain() ? (config.isSQLServer() || config.isOracle() ? "SET STATISTICS PROFILE ON " : "EXPLAIN ") : "");
3982+
String explain = config.isExplain() ? (config.isSQLServer() ? "SET STATISTICS PROFILE ON " : (config.isOracle() ? "EXPLAIN PLAN FOR " : "EXPLAIN ")) : "";
39833983
if (config.isTest() && RequestMethod.isGetMethod(config.getMethod(), true)) { // FIXME 为啥是 code 而不是 count ?
39843984
String q = config.getQuote(); // 生成 SELECT ( (24 >=0 AND 24 <3) ) AS `code` LIMIT 1 OFFSET 0
39853985
return explain + "SELECT " + config.getWhereString(false) + " AS " + q + JSONResponse.KEY_COUNT + q + config.getLimitString();

0 commit comments

Comments
 (0)