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

--no commit message

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