forked from github/dataease
Merge pull request #8109 from dataease/pr@dev@feat_permissions
fix(数据集): oracle 数据源的sql数据集使用 in 语法和参数时,执行异常 #8053
This commit is contained in:
commit
6e6d4d469d
@ -1118,7 +1118,7 @@ public class DataSetTableService {
|
||||
private void handleFromItems(PlainSelect plainSelect, String dsType) throws Exception {
|
||||
FromItem fromItem = plainSelect.getFromItem();
|
||||
if (fromItem instanceof ParenthesedSelect) {
|
||||
if(((ParenthesedSelect) fromItem).getSelect() instanceof SetOperationList){
|
||||
if (((ParenthesedSelect) fromItem).getSelect() instanceof SetOperationList) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
SetOperationList setOperationList = (SetOperationList) ((ParenthesedSelect) fromItem).getSelect().getSelectBody();
|
||||
for (int i = 0; i < setOperationList.getSelects().size(); i++) {
|
||||
@ -1127,7 +1127,7 @@ public class DataSetTableService {
|
||||
result.append(" ").append(setOperationList.getOperations().get(i).toString()).append(" ");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
PlainSelect selectBody = ((ParenthesedSelect) fromItem).getSelect().getPlainSelect();
|
||||
Select subSelectTmp = (Select) CCJSqlParserUtil.parse(removeVariables(selectBody.toString(), dsType));
|
||||
((ParenthesedSelect) fromItem).setSelect(subSelectTmp.getSelectBody());
|
||||
@ -2808,6 +2808,9 @@ public class DataSetTableService {
|
||||
}
|
||||
inExpression.getRightExpression().accept(this);
|
||||
}
|
||||
if (inExpression.getRightExpression() instanceof ParenthesedExpressionList) {
|
||||
buffer.append(inExpression.getRightExpression());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user