提交 eb0ce326 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 f2b7015f
......@@ -21,6 +21,7 @@
private String selectSQL;
private String[] columnNames;
private String comment;
private boolean recursive;
public CreateView(Session session, Schema schema) {
super(session, schema);
......@@ -30,6 +31,10 @@
viewName = name;
}
public void setRecursive(boolean recursive) {
this.recursive = recursive;
}
public void setSelect(Query select) {
this.select = select;
}
......@@ -52,7 +57,7 @@
} else {
querySQL = select.getSQL();
}
TableView view = new TableView(getSchema(), id, viewName, querySQL, null, columnNames, session);
TableView view = new TableView(getSchema(), id, viewName, querySQL, null, columnNames, session, recursive);
view.setComment(comment);
db.addSchemaObject(session, view);
return 0;
......
......@@ -71,6 +71,7 @@ public class DropDatabase extends DefineCommand {
// maybe constraints and triggers on system tables will be allowed in the future
list.addAll(db.getAllSchemaObjects(DbObject.CONSTRAINT));
list.addAll(db.getAllSchemaObjects(DbObject.TRIGGER));
list.addAll(db.getAllSchemaObjects(DbObject.CONSTANT));
for(int i=0; i<list.size(); i++) {
SchemaObject obj = (SchemaObject) list.get(i);
db.removeSchemaObject(session, obj);
......@@ -87,9 +88,13 @@ public class DropDatabase extends DefineCommand {
list.addAll(db.getAllFunctionAliases());
for(int i=0; i<list.size(); i++) {
DbObject obj = (DbObject) list.get(i);
String sql = obj.getCreateSQL();
// the role PUBLIC must not be dropped
if(sql != null) {
db.removeDatabaseObject(session, obj);
}
}
}
public void setDropAllObjects(boolean b) {
this.dropAllObjects = b;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论