if (!isInsertable && !isUpdatable) {
return;
}
IntValueHashMap columns = new IntValueHashMap();
boolean[] checkList;
int[] baseColumnMap = table.getBaseTableColumnMap();
int[] columnMap = new int[indexLimitVisible];
if (queryCondition != null) {
tempSet.clear();
collectSubQueriesAndReferences(tempSet, queryCondition);
if (tempSet.contains(table.getName())
|| tempSet.contains(baseTable.getName())) {
isUpdatable = false;
isInsertable = false;
return;
}
}
for (int i = 0; i < indexLimitVisible; i++) {
Expression expression = exprColumns[i];
if (expression.getType() == OpTypes.COLUMN) {
String name = expression.getColumn().getName().name;
if (columns.containsKey(name)) {
columns.put(name, 1);
continue;
}
columns.put(name, 0);
} else {
tempSet.clear();
collectSubQueriesAndReferences(tempSet, expression);
if (tempSet.contains(table.getName())) {
isUpdatable = false;
isInsertable = false;
return;
}
}
}
isUpdatable = false;
for (int i = 0; i < indexLimitVisible; i++) {
if (accessibleColumns[i]) {
Expression expression = exprColumns[i];
if (expression.getType() == OpTypes.COLUMN) {
String name = expression.getColumn().getName().name;
if (columns.get(name) == 0) {
int index = table.findColumn(name);
columnMap[i] = baseColumnMap[index];
if (columnMap[i] != -1) {