提交 465c51a1 authored 作者: Thomas Mueller's avatar Thomas Mueller

remove old TODOs

上级 013a17a8
......@@ -261,11 +261,9 @@ public class AlterTableAddConstraint extends SchemaCommand {
int indexId = getObjectId(true, false);
IndexType indexType;
if (unique) {
// TODO default index (hash or not; memory or not or same as table)
// for unique constraints
indexType = IndexType.createUnique(t.getPersistent(), false);
} else {
// TODO default index (memory or not or same as table) for unique
// constraints
indexType = IndexType.createNonUnique(t.getPersistent());
}
......
......@@ -45,7 +45,6 @@ public class AlterTableRename extends SchemaCommand {
}
session.getUser().checkRight(oldTable, Right.ALL);
if (oldTable.getTemporary()) {
// TODO renaming a temporary table is not supported
throw Message.getUnsupportedException();
}
db.renameSchemaObject(session, oldTable, newTableName);
......
......@@ -32,7 +32,6 @@ public class CreateConstant extends SchemaCommand {
}
public void setIfNotExists(boolean ifNotExists) {
// TODO constant: if exists - probably better use 'or replace'
this.ifNotExists = ifNotExists;
}
......
......@@ -53,7 +53,6 @@ public class CreateIndex extends SchemaCommand {
}
public int update() throws SQLException {
// TODO cancel: may support for index creation
session.commit(true);
Database db = session.getDatabase();
boolean persistent = db.isPersistent();
......
......@@ -100,7 +100,6 @@ public class CreateTable extends SchemaCommand {
}
public int update() throws SQLException {
// TODO rights: what rights are required to create a table?
session.commit(true);
Database db = session.getDatabase();
if (!db.isPersistent()) {
......
......@@ -71,12 +71,10 @@ public class CreateTrigger extends SchemaCommand {
}
public void setIfNotExists(boolean ifNotExists) {
// TODO trigger: if exists - probably better use 'or replace'
this.ifNotExists = ifNotExists;
}
public int update() throws SQLException {
// TODO rights: what rights are required to create a trigger?
session.commit(true);
Database db = session.getDatabase();
if (getSchema().findTrigger(triggerName) != null) {
......
......@@ -48,7 +48,6 @@ public class CreateView extends SchemaCommand {
}
public int update() throws SQLException {
// TODO rights: what rights are required to create a view?
session.commit(true);
Database db = session.getDatabase();
if (getSchema().findTableOrView(session, viewName) != null) {
......
......@@ -37,7 +37,6 @@ public class DropSequence extends SchemaCommand {
}
public int update() throws SQLException {
// TODO rights: what are the rights required for a sequence?
session.getUser().checkAdmin();
session.commit(true);
Database db = session.getDatabase();
......
......@@ -57,7 +57,6 @@ public class DropTable extends SchemaCommand {
private void prepareDrop() throws SQLException {
table = getSchema().findTableOrView(session, tableName);
// TODO drop table: drops views as well (is this ok?)
if (table == null) {
if (!ifExists) {
throw Message.getSQLException(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, tableName);
......
......@@ -37,7 +37,6 @@ public class DropView extends SchemaCommand {
}
public int update() throws SQLException {
// TODO rights: what rights are required to drop a view?
session.commit(true);
Table view = getSchema().findTableOrView(session, viewName);
if (view == null) {
......
......@@ -137,7 +137,7 @@ public class GrantRevoke extends DefineCommand {
if (grantee instanceof Role) {
Role granteeRole = (Role) grantee;
if (grantedRole.isRoleGranted(granteeRole)) {
// TODO role: should be 'cyclic role grants are not allowed'
// cyclic role grants are not allowed
throw Message.getSQLException(ErrorCode.ROLE_ALREADY_GRANTED_1, grantedRole.getSQL());
}
}
......
......@@ -60,7 +60,6 @@ public class AlterSequence extends SchemaCommand {
}
public int update() throws SQLException {
// TODO rights: what are the rights required for a sequence?
Database db = session.getDatabase();
if (table != null) {
session.getUser().checkRight(table, Right.ALL);
......
......@@ -43,7 +43,6 @@ public class ExplainPlan extends Prepared {
}
public LocalResult query(int maxrows) throws SQLException {
// TODO rights: are rights required for explain?
Column column = new Column("PLAN", Value.STRING);
ExpressionColumn expr = new ExpressionColumn(session.getDatabase(), column);
Expression[] expressions = new Expression[] {
......
......@@ -88,7 +88,6 @@ public class Optimizer {
calculateBruteForceSome();
random = new Random(0);
calculateGenetic();
// TODO optimizer: how to use rule based optimizer?
}
}
......
......@@ -91,8 +91,7 @@ public class Select extends Query {
* @param isTop if the table can be the first table in the query plan
*/
public void addTableFilter(TableFilter filter, boolean isTop) {
// TODO compatibility: it seems oracle doesn't check on
// duplicate aliases; do other databases check it?
// Oracle doesn't check on duplicate aliases
// String alias = filter.getAlias();
// if(filterNames.contains(alias)) {
// throw Message.getSQLException(
......@@ -431,7 +430,7 @@ public class Select extends Query {
break;
}
if (idxCol.sortType != sortTypes[j]) {
// TODO NULL FIRST for ascending and NULLS LAST
// NULL FIRST for ascending and NULLS LAST
// for descending would actually match the default
ok = false;
break;
......@@ -570,8 +569,6 @@ public class Select extends Query {
}
private void expandColumnList() throws SQLException {
// TODO this works: select distinct count(*)
// from system_columns group by table
for (int i = 0; i < expressions.size(); i++) {
Expression expr = (Expression) expressions.get(i);
if (!expr.isWildcard()) {
......
......@@ -323,8 +323,6 @@ public class SelectUnion extends Query {
buff.append(" ORDER BY ");
buff.append(sort.getSQL(exprList, exprList.length));
}
// TODO refactoring: limit and order by could be in Query (now in
// SelectUnion and in Select)
if (limit != null) {
buff.append(" LIMIT ");
buff.append(StringUtils.unEnclose(limit.getSQL()));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论