Merge pull request #4229 from dataease/pr@dev@fixds

fix: 解析sql错误
This commit is contained in:
taojinlong 2022-12-29 10:14:41 +08:00 committed by GitHub
commit 90bb64aa07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -1338,7 +1338,6 @@ public class SqlserverQueryProvider extends QueryProvider {
public List<Dateformat> dateformat() {
return JSONArray.parseArray("[\n" +
"{\"dateformat\": \"102\", \"desc\": \"yyyy.mm.dd\"},\n" +
"{\"dateformat\": \"120\", \"desc\": \"yyyy-mm-dd\"},\n" +
"{\"dateformat\": \"111\", \"desc\": \"yyyy/mm/dd\"},\n" +
"{\"dateformat\": \"112\", \"desc\": \"yyyymmdd\"},\n" +
"{\"dateformat\": \"120\", \"desc\": \"yyyy-mm-dd hh:mi:ss\"}\n" +

View File

@ -2821,7 +2821,7 @@ public class DataSetTableService {
boolean hasSubBinaryExpression = false;
try {
BinaryExpression leftBinaryExpression = (BinaryExpression) expr.getLeftExpression();
hasSubBinaryExpression = leftBinaryExpression.getLeftExpression() instanceof Expression;
hasSubBinaryExpression = leftBinaryExpression instanceof AndExpression || leftBinaryExpression instanceof OrExpression;
} catch (Exception e) {
e.printStackTrace();
}
@ -2836,8 +2836,7 @@ public class DataSetTableService {
hasSubBinaryExpression = false;
try {
BinaryExpression rightBinaryExpression = (BinaryExpression) expr.getRightExpression();
hasSubBinaryExpression = rightBinaryExpression.getRightExpression() instanceof BinaryExpression;
hasSubBinaryExpression = rightBinaryExpression instanceof AndExpression || rightBinaryExpression instanceof OrExpression;;
} catch (Exception e) {
}
if (expr.getRightExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVariable(expr.getRightExpression().toString())) {