if (select == null) {
querySQL = selectSQL;
} else {
querySQL = select.getSQL();
}
Session sysSession = db.getSystemSession();
TableView view;
try {
Schema schema = session.getDatabase().getSchema(session.getCurrentSchemaName());
sysSession.setCurrentSchema(schema);
view = new TableView(getSchema(), id, viewName, querySQL, null, columnNames, sysSession, recursive);
} finally {
sysSession.setCurrentSchema(db.getSchema(Constants.SCHEMA_MAIN));
}
view.setComment(comment);
try {
view.recompileQuery(session);
} catch (DbException e) {