Search in sources :

Example 16 with HsqlArrayList

use of org.hsqldb_voltpatches.lib.HsqlArrayList in project voltdb by VoltDB.

the class ParserBase method startRecording.

//
void startRecording() {
    recordedStatement = new HsqlArrayList();
    recordedStatement.add(token.duplicate());
    isRecording = true;
}
Also used : HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList)

Example 17 with HsqlArrayList

use of org.hsqldb_voltpatches.lib.HsqlArrayList in project voltdb by VoltDB.

the class ParserCommand method compileStatements.

HsqlArrayList compileStatements(String sql, int returnType) {
    HsqlArrayList list = new HsqlArrayList();
    Statement cs = null;
    reset(sql);
    while (true) {
        if (token.tokenType == Tokens.X_ENDPARSE) {
            break;
        }
        compileContext.reset();
        cs = compilePart();
        if (cs == null) {
            list.add(cs);
        } else {
            list.add(cs);
        }
    }
    if (returnType != StatementTypes.RETURN_ANY) {
        int group = cs.getGroup();
        if (group == StatementTypes.X_SQL_DATA) {
            if (returnType == StatementTypes.RETURN_COUNT) {
                throw Error.error(ErrorCode.X_07503);
            }
        } else if (returnType == StatementTypes.RETURN_RESULT) {
            throw Error.error(ErrorCode.X_07504);
        }
    }
    return list;
}
Also used : HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList)

Example 18 with HsqlArrayList

use of org.hsqldb_voltpatches.lib.HsqlArrayList in project voltdb by VoltDB.

the class ParserDDL method getBaseColumnNames.

/// Collect the names of the unique columns underlying a list of indexed expressions.
private OrderedHashSet getBaseColumnNames(java.util.List<Expression> indexExprs) {
    OrderedHashSet set = new OrderedHashSet();
    HsqlList col_list = new HsqlArrayList();
    for (Expression expression : indexExprs) {
        expression.collectAllColumnExpressions(col_list);
    }
    for (int i = 0; i < col_list.size(); i++) {
        String colName = ((ExpressionColumn) col_list.get(i)).columnName;
        set.add(colName);
    }
    return set;
}
Also used : HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList) OrderedHashSet(org.hsqldb_voltpatches.lib.OrderedHashSet) HsqlList(org.hsqldb_voltpatches.lib.HsqlList)

Example 19 with HsqlArrayList

use of org.hsqldb_voltpatches.lib.HsqlArrayList in project voltdb by VoltDB.

the class Session method executeDirectStatement.

public Result executeDirectStatement(Result cmd) {
    String sql = cmd.getMainString();
    HsqlArrayList list;
    try {
        list = parser.compileStatements(sql, cmd.getStatementType());
    } catch (HsqlException e) {
        return Result.newErrorResult(e);
    }
    Result result = null;
    for (int i = 0; i < list.size(); i++) {
        Statement cs = (Statement) list.get(i);
        result = executeCompiledStatement(cs, ValuePool.emptyObjectArray);
        if (result.isError()) {
            break;
        }
    }
    return result;
}
Also used : HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList) Result(org.hsqldb_voltpatches.result.Result)

Example 20 with HsqlArrayList

use of org.hsqldb_voltpatches.lib.HsqlArrayList in project voltdb by VoltDB.

the class Schema method getSequenceRestartSQL.

public String[] getSequenceRestartSQL() {
    HsqlArrayList list = new HsqlArrayList();
    Iterator it = sequenceLookup.map.values().iterator();
    while (it.hasNext()) {
        NumberSequence sequence = (NumberSequence) it.next();
        String ddl = sequence.getRestartSQL();
        list.add(ddl);
    }
    String[] array = new String[list.size()];
    list.toArray(array);
    return array;
}
Also used : HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList) Iterator(org.hsqldb_voltpatches.lib.Iterator) WrapperIterator(org.hsqldb_voltpatches.lib.WrapperIterator)

Aggregations

HsqlArrayList (org.hsqldb_voltpatches.lib.HsqlArrayList)69 HsqlName (org.hsqldb_voltpatches.HsqlNameManager.HsqlName)21 Iterator (org.hsqldb_voltpatches.lib.Iterator)14 HsqlList (org.hsqldb_voltpatches.lib.HsqlList)11 OrderedHashSet (org.hsqldb_voltpatches.lib.OrderedHashSet)10 WrapperIterator (org.hsqldb_voltpatches.lib.WrapperIterator)10 Table (org.hsqldb_voltpatches.Table)7 Type (org.hsqldb_voltpatches.types.Type)6 SchemaObject (org.hsqldb_voltpatches.SchemaObject)5 Method (java.lang.reflect.Method)4 Constraint (org.hsqldb_voltpatches.Constraint)3 HashMappedList (org.hsqldb_voltpatches.lib.HashMappedList)3 Grantee (org.hsqldb_voltpatches.rights.Grantee)3 PersistentStore (org.hsqldb_voltpatches.persist.PersistentStore)2 Result (org.hsqldb_voltpatches.result.Result)2 BufferedOutputStream (java.io.BufferedOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 HSQLParseException (org.hsqldb_voltpatches.HSQLInterface.HSQLParseException)1 NumberSequence (org.hsqldb_voltpatches.NumberSequence)1