removed TODOs

This commit is contained in:
Ralf Wisser
2021-10-15 08:46:22 +02:00
parent 4c3bff4f1c
commit 4e5a11b985
5 changed files with 36 additions and 16 deletions
+9
View File
@@ -1,4 +1,13 @@
11.1.4
- Fixed NPE in data browser.
11.1.3
- Minor bug fixes.
11.1.2
- Minor bug fixes.
11.1.1
- Database-side filtering of ad hoc queries in SQL Console.
10.6.1
@@ -2451,7 +2451,6 @@ public abstract class ExportDialog extends javax.swing.JDialog {
}//GEN-LAST:event_rowidPKActionPerformed
private void resetTargetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetTargetButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_resetTargetButtonActionPerformed
public boolean isOk() {
@@ -475,7 +475,6 @@ public abstract class NonModalConditionEditor extends EscapableDialog {
}//GEN-LAST:event_toSubQueryButtonActionPerformed
private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_clearButtonActionPerformed
private Table table1, table2;
@@ -868,10 +868,14 @@ public abstract class SQLConsole extends javax.swing.JPanel {
List<Table> nfResultTypes = explain || sqlPlusResultSet != null? null : QueryTypeAnalyser.getType(sqlStatement, true, sqlColumnExpression, metaDataSource);
List<Table> nfResultTypesWOCheck = explain || sqlPlusResultSet != null? null : QueryTypeAnalyser.getType(sqlStatement, false, sqlColumnExpression, metaDataSource);
Result wcBaseTable = WCTypeAnalyser.getType(sqlStatement, metaDataSource);
Result wcbt = WCTypeAnalyser.getType(sqlStatement, metaDataSource);
int columnCount = metaData.getColumnCount();
if (wcbt != null && wcbt.table != null && wcbt.table.getColumns().size() != columnCount) {
wcbt = null;
}
Result wcBaseTable = wcbt;
Table resultType = null;
if (nfResultTypesWOCheck != null && !nfResultTypesWOCheck.isEmpty()) {
int columnCount = metaData.getColumnCount();
for (Table table: nfResultTypesWOCheck) {
while (table.getColumns().size() < columnCount) {
table.getColumns().add(new net.sf.jailer.datamodel.Column(null, "", 0, -1));
@@ -880,7 +884,6 @@ public abstract class SQLConsole extends javax.swing.JPanel {
}
if (nfResultTypes != null && !nfResultTypes.isEmpty()) {
int columnCount = metaData.getColumnCount();
List<Column> columnsT0 = nfResultTypes.get(0).getColumns();
boolean multiTabResult = false;
for (int ti = 1; ti < nfResultTypes.size() && !multiTabResult; ++ti) {
@@ -2188,7 +2191,7 @@ public abstract class SQLConsole extends javax.swing.JPanel {
rowsTableScrollPane.setWheelScrollingEnabled(true);
}
public void initSecondaryCondition() {
openConditionEditor(null, 0, null);
openConditionEditor(null, -1, null);
}
public Set<Integer> getPkColumnsConsole() {
HashSet<Integer> result = new HashSet<Integer>(pkColumns);
@@ -3377,6 +3380,9 @@ public abstract class SQLConsole extends javax.swing.JPanel {
// }
}
// TODO 1
// TODO kein auto-sync, overlay in console fuer benutzerentscheidung, ob jetzt synced wird oder nicht.
protected abstract void onContentStateChange(File file, boolean dirty);
protected abstract void setReloadLimit(int limit);
@@ -334,8 +334,6 @@ public class WCTypeAnalyser {
}
for (SelectItem si: plainSelect.getSelectItems()) {
final boolean stop[] = new boolean[] { false };
si.accept(new SelectItemVisitor() {
@Override
public void visit(SelectExpressionItem selectExpressionItem) {
@@ -377,7 +375,8 @@ public class WCTypeAnalyser {
col.isNullable = isNullable;
selectClause.add(col);
} catch (Exception e) {
selectClause.add(null);
LogUtil.warn(e);
throw new QueryTooComplexException();
}
}
@@ -393,7 +392,11 @@ public class WCTypeAnalyser {
}
MDTable mdTable = fromClause.get(tableAlias);
try {
for (String c: mdTable.getColumns(false)) {
List<String> columns = mdTable.getColumns(false);
if (columns.isEmpty()) {
LogUtil.warn(new RuntimeException("Table without columns: " + mdTable.getName() + "/" + ((mdTable.getSchema() == null? "null" : mdTable.getSchema().getName())) + " " + sqlSelect));
}
for (String c: columns) {
net.sf.jailer.datamodel.Column col = findColumn(tableAlias, c, fromClause, metaDataSource);
boolean isNullable = col == null || col.isNullable;
col = new net.sf.jailer.datamodel.Column((unknownTableCounter[0] != 0 || fromClause.size() != 1? tableAlias + "." : "") + c, null, -1, -1);
@@ -411,11 +414,14 @@ public class WCTypeAnalyser {
for (Entry<String, MDTable> e: fromClause.entrySet()) {
MDTable mdTable = e.getValue();
if (mdTable == null) {
stop[0] = true;
break;
throw new QueryTooComplexException();
}
try {
for (String c: mdTable.getColumns(false)) {
List<String> columns = mdTable.getColumns(false);
if (columns.isEmpty()) {
LogUtil.warn(new RuntimeException("Table without columns: " + mdTable.getName() + "/" + ((mdTable.getSchema() == null? "null" : mdTable.getSchema().getName())) + " " + sqlSelect));
}
for (String c: columns) {
net.sf.jailer.datamodel.Column col = findColumn(e.getKey(), c, fromClause, metaDataSource);
boolean isNullable = col == null || col.isNullable;
col = new net.sf.jailer.datamodel.Column((unknownTableCounter[0] != 0 || fromClause.size() != 1? e.getKey() + "." : "") + c, null, -1, -1);
@@ -429,9 +435,6 @@ public class WCTypeAnalyser {
}
}
});
if (stop[0]) {
break;
}
}
}
@@ -463,6 +466,10 @@ public class WCTypeAnalyser {
result.table = table;
result.cte = cte.toString();
if (result.table.getColumns().isEmpty()) {
return null;
}
return result;
} catch (QueryTooComplexException e) {
// ignore