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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations