Beispiel #1
0
 ResultTempTable(Session session, Expression[] expressions, boolean distinct, SortOrder sort) {
   this.session = session;
   this.distinct = distinct;
   this.sort = sort;
   this.columnCount = expressions.length;
   Schema schema = session.getDatabase().getSchema(Constants.SCHEMA_MAIN);
   CreateTableData data = new CreateTableData();
   for (int i = 0; i < expressions.length; i++) {
     int type = expressions[i].getType();
     Column col = new Column(COLUMN_NAME + i, type);
     if (type == Value.CLOB || type == Value.BLOB) {
       containsLob = true;
     }
     data.columns.add(col);
   }
   data.id = session.getDatabase().allocateObjectId();
   data.tableName = "TEMP_RESULT_SET_" + data.id;
   data.temporary = true;
   data.persistIndexes = false;
   data.persistData = true;
   data.create = true;
   data.session = session;
   table = schema.createTable(data);
   if (sort != null || distinct) {
     createIndex();
   }
   parent = null;
 }