improve sqlwall

This commit is contained in:
Yako
2014-10-17 22:32:13 +08:00
parent 5527d97ae2
commit 8364dcc49f
@@ -2182,16 +2182,25 @@ public class WallVisitorUtils {
if (query instanceof SQLSelectQueryBlock) {
SQLSelectQueryBlock queryBlock = (SQLSelectQueryBlock) query;
SQLTableSource from = queryBlock.getFrom();
if (queryBlock.getSelectList().size() < 1) {
return false;
}
if (from == null) {
boolean itemIsConst = true;
boolean itemHasAlias = false;
for (SQLSelectItem item : queryBlock.getSelectList()) {
if (item.getExpr() instanceof SQLIdentifierExpr || item.getExpr() instanceof SQLPropertyExpr) {
itemIsConst = false;
break;
}
if(item.getAlias() != null ) {
itemHasAlias = true;
break;
}
}
if (itemIsConst) {
if (itemIsConst && !itemHasAlias) {
return true;
} else {
return false;