Skip to content

Commit

Permalink
Server:解决全局默认的 @Explain 或 @cache 放到子查询内导致 SQL 语法报错
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLemon committed Dec 22, 2019
1 parent 9747549 commit 6b62775
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,13 @@ else if (method == PUT && value instanceof JSONArray
if (sqlRequest.get(JSONRequest.KEY_SCHEMA) == null && parser.getGlobleSchema() != null) {
sqlRequest.put(JSONRequest.KEY_SCHEMA, parser.getGlobleSchema());
}
if (sqlRequest.get(JSONRequest.KEY_EXPLAIN) == null && parser.getGlobleExplain() != null) {
sqlRequest.put(JSONRequest.KEY_EXPLAIN, parser.getGlobleExplain());
}
if (sqlRequest.get(JSONRequest.KEY_CACHE) == null && parser.getGlobleCache() != null) {
sqlRequest.put(JSONRequest.KEY_CACHE, parser.getGlobleCache());
if (isSubquery == false) { //解决 SQL 语法报错,子查询不能 EXPLAIN
if (sqlRequest.get(JSONRequest.KEY_EXPLAIN) == null && parser.getGlobleExplain() != null) {
sqlRequest.put(JSONRequest.KEY_EXPLAIN, parser.getGlobleExplain());
}
if (sqlRequest.get(JSONRequest.KEY_CACHE) == null && parser.getGlobleCache() != null) {
sqlRequest.put(JSONRequest.KEY_CACHE, parser.getGlobleCache());
}
}
}
}
Expand Down

0 comments on commit 6b62775

Please sign in to comment.