@Override public ResultInterface query(int maxrows) { ResultInterface result = command.query(maxrows); executeRemaining(); return result; }
@Override public boolean canReuse() { return super.canReuse() && prepared.getCteCleanups() == null; }
/** * Parse the statement and prepare it for execution. * * @param sql the SQL statement to parse * @return the prepared object */ public Prepared prepare(String sql) { Prepared p = parse(sql); p.prepare(); if (currentTokenType != END) { throw getSyntaxError(); } return p; }
@Override public int update() { recompileIfRequired(); setProgress(DatabaseEventListener.STATE_STATEMENT_START); start(); session.setLastScopeIdentity(ValueNull.INSTANCE); prepared.checkParameters(); int updateCount = prepared.update(); prepared.trace(startTimeNanos, updateCount); setProgress(DatabaseEventListener.STATE_STATEMENT_END); return updateCount; }
@Override public ResultInterface query(int maxrows) { recompileIfRequired(); setProgress(DatabaseEventListener.STATE_STATEMENT_START); start(); prepared.checkParameters(); ResultInterface result = prepared.query(maxrows); prepared.trace(startTimeNanos, result.isLazy() ? 0 : result.getRowCount()); setProgress(DatabaseEventListener.STATE_STATEMENT_END); return result; }
private void read(String expected) { if (currentTokenQuoted || !equalsToken(expected, currentToken)) { addExpected(expected); throw getSyntaxError(); } read(); }
private String readFromAlias(String alias, List<String> excludeIdentifiers) { if (readIf("AS")) { alias = readAliasIdentifier(); } else if (currentTokenType == IDENTIFIER && !isTokenInList(excludeIdentifiers)) { alias = readAliasIdentifier(); } return alias; }
private Query parseSelectUnion() { int start = lastParseIndex; Query command = parseSelectSub(); return parseSelectUnionExtension(command, start, false); }
private String readCommentIf() { if (readIf("COMMENT")) { readIf("IS"); return readString(); } return null; }
@Override public int update() { int updateCount = command.executeUpdate(false).getUpdateCount(); executeRemaining(); return updateCount; }
/** * Set the current row number. * * @param rowNumber the row number */ protected void setCurrentRowNumber(int rowNumber) { if ((++rowScanCount & 127) == 0) { checkCanceled(); } this.currentRowNumber = rowNumber; setProgress(); }
private static CommandInterface closeAndSetNull(CommandInterface command) { if (command != null) { command.close(); } return null; }
private void updateWithSkipCheck(Prepared prep) { // TODO constraints: maybe delay the update or support delayed checks // (until commit) try { // TODO multithreaded kernel: this works only if nobody else updates // this or the ref table at the same time skipOwnTable = true; prep.update(); } finally { skipOwnTable = false; } }
@Override public boolean isReadOnly() { if (!readOnlyKnown) { readOnly = prepared.isReadOnly(); readOnlyKnown = true; } return readOnly; }
private void checkRunOver(int i, int len, int startLoop) { if (i >= len) { parseIndex = startLoop; throw getSyntaxError(); } }
@Override public int compare(TableFilter o1, TableFilter o2) { return o1 == o2 ? 0 : compareTableFilters(o1, o2); } };