@Test public void testEmptyQuery() { try { compiler.compile(" ", sqlExecutionContext); } catch (SqlException e) { Assert.assertEquals(0, e.getPosition()); TestUtils.assertContains(e.getFlyweightMessage(), "empty query"); } }
@NotNull public CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext) throws SqlException { clear(); lexer.of(query); final CharSequence tok = SqlUtil.fetchNext(lexer); if (tok == null) { throw SqlException.$(0, "empty query"); } final KeywordBasedExecutor executor = keywordBasedExecutors.get(tok); if (executor == null) { return compileUsingModel(executionContext); } return executor.execute(executionContext); }
SqlCompiler implements Closeable { @NotNull public CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext) throws SqlException { clear(); lexer.of(query); final CharSequence tok = SqlUtil.fetchNext(lexer); if (tok == null) { throw SqlException.$(0, "empty query"); } final KeywordBasedExecutor executor = keywordBasedExecutors.get(tok); if (executor == null) { return compileUsingModel(executionContext); } return executor.execute(executionContext); } }
SqlCompiler implements Closeable { @NotNull public CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext) throws SqlException { clear(); lexer.of(query); final CharSequence tok = SqlUtil.fetchNext(lexer); if (tok == null) { throw SqlException.$(0, "empty query"); } final KeywordBasedExecutor executor = keywordBasedExecutors.get(tok); if (executor == null) { return compileUsingModel(executionContext); } return executor.execute(executionContext); } SqlCompiler(CairoEngine engine);  SqlCompiler(CairoEngine engine, @Nullable MessageBus messageBus, @Nullable FunctionFactoryCache functionFactoryCache); }
SqlCompiler implements Closeable { @NotNull public CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext) throws SqlException { clear(); lexer.of(query); final CharSequence tok = SqlUtil.fetchNext(lexer); if (tok == null) { throw SqlException.$(0, "empty query"); } final KeywordBasedExecutor executor = keywordBasedExecutors.get(tok); if (executor == null) { return compileUsingModel(executionContext); } return executor.execute(executionContext); } SqlCompiler(CairoEngine engine);  SqlCompiler(CairoEngine engine, @Nullable MessageBus messageBus, @Nullable FunctionFactoryCache functionFactoryCache); static void configureLexer(GenericLexer lexer); static boolean isAssignableFrom(int to, int from); @Override void close(); @NotNull CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext); CairoEngine getEngine(); }
SqlCompiler implements Closeable { @NotNull public CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext) throws SqlException { clear(); lexer.of(query); final CharSequence tok = SqlUtil.fetchNext(lexer); if (tok == null) { throw SqlException.$(0, "empty query"); } final KeywordBasedExecutor executor = keywordBasedExecutors.get(tok); if (executor == null) { return compileUsingModel(executionContext); } return executor.execute(executionContext); } SqlCompiler(CairoEngine engine);  SqlCompiler(CairoEngine engine, @Nullable MessageBus messageBus, @Nullable FunctionFactoryCache functionFactoryCache); static void configureLexer(GenericLexer lexer); static boolean isAssignableFrom(int to, int from); @Override void close(); @NotNull CompiledQuery compile(@NotNull CharSequence query, @NotNull SqlExecutionContext executionContext); CairoEngine getEngine(); static final ObjList<String> sqlControlSymbols; }