Search in sources :

Example 6 with BindVariableServiceImpl

use of io.questdb.griffin.engine.functions.bind.BindVariableServiceImpl in project questdb by bluestreak01.

the class AbstractGriffinTest method setUpStatic.

@BeforeClass
public static void setUpStatic() {
    AbstractCairoTest.setUpStatic();
    compiler = new SqlCompiler(engine);
    bindVariableService = new BindVariableServiceImpl(configuration);
    sqlExecutionContext = new SqlExecutionContextImpl(engine, 1).with(AllowAllCairoSecurityContext.INSTANCE, bindVariableService, null, -1, null);
    bindVariableService.clear();
}
Also used : BindVariableServiceImpl(io.questdb.griffin.engine.functions.bind.BindVariableServiceImpl) BeforeClass(org.junit.BeforeClass)

Example 7 with BindVariableServiceImpl

use of io.questdb.griffin.engine.functions.bind.BindVariableServiceImpl in project questdb by bluestreak01.

the class ImportIODispatcherTest method setupSql.

private void setupSql(CairoEngine engine) {
    compiler = new SqlCompiler(engine);
    BindVariableServiceImpl bindVariableService = new BindVariableServiceImpl(engine.getConfiguration());
    sqlExecutionContext = new SqlExecutionContextImpl(engine, 1).with(AllowAllCairoSecurityContext.INSTANCE, bindVariableService, null, -1, null);
    bindVariableService.clear();
}
Also used : SqlExecutionContextImpl(io.questdb.griffin.SqlExecutionContextImpl) SqlCompiler(io.questdb.griffin.SqlCompiler) BindVariableServiceImpl(io.questdb.griffin.engine.functions.bind.BindVariableServiceImpl)

Example 8 with BindVariableServiceImpl

use of io.questdb.griffin.engine.functions.bind.BindVariableServiceImpl in project questdb by bluestreak01.

the class TableBackupTest method setup.

@Before
public void setup() throws IOException {
    path = new Path();
    finalBackupPath = new Path();
    mkdirsErrno = -1;
    renameErrno = -1;
    FilesFacade ff = new FilesFacadeImpl() {

        private int nextErrno = -1;

        @Override
        public int errno() {
            if (nextErrno != -1) {
                int errno = nextErrno;
                nextErrno = -1;
                return errno;
            }
            return super.errno();
        }

        @Override
        public int mkdirs(LPSZ path, int mode) {
            if (mkdirsErrno != -1 && --mkdirsErrnoCountDown < 1) {
                nextErrno = mkdirsErrno;
                mkdirsErrno = -1;
                mkdirsErrnoCountDown = 0;
                return -1;
            }
            return super.mkdirs(path, mode);
        }

        @Override
        public boolean rename(LPSZ from, LPSZ to) {
            if (renameErrno != -1) {
                nextErrno = renameErrno;
                renameErrno = -1;
                return false;
            }
            return super.rename(from, to);
        }
    };
    CharSequence root = temp.newFolder(String.format("dbRoot%c%s", Files.SEPARATOR, PropServerConfiguration.DB_DIRECTORY)).getAbsolutePath();
    backupRoot = temp.newFolder("dbBackupRoot").getAbsolutePath();
    mainConfiguration = new DefaultCairoConfiguration(root) {

        @Override
        public FilesFacade getFilesFacade() {
            return ff;
        }

        @Override
        public CharSequence getBackupRoot() {
            return backupRoot;
        }

        @Override
        public DateFormat getBackupDirTimestampFormat() {
            return new TimestampFormatCompiler().compile("ddMMMyyyy");
        }
    };
    mainEngine = new CairoEngine(mainConfiguration);
    mainCompiler = new SqlCompiler(mainEngine);
    mainSqlExecutionContext = new SqlExecutionContextImpl(mainEngine, 1).with(AllowAllCairoSecurityContext.INSTANCE, new BindVariableServiceImpl(mainConfiguration), null, -1, null);
    // dummy configuration
    File confRoot = new File(PropServerConfiguration.confRoot(root));
    Assert.assertTrue(confRoot.mkdirs());
    Assert.assertTrue(new File(confRoot, "server.conf").createNewFile());
    Assert.assertTrue(new File(confRoot, "mime.types").createNewFile());
    Assert.assertTrue(new File(confRoot, "log-file.conf").createNewFile());
    Assert.assertTrue(new File(confRoot, "date.formats").createNewFile());
}
Also used : FilesFacadeImpl(io.questdb.std.FilesFacadeImpl) FilesFacade(io.questdb.std.FilesFacade) TimestampFormatCompiler(io.questdb.std.datetime.microtime.TimestampFormatCompiler) DateFormat(io.questdb.std.datetime.DateFormat) BindVariableServiceImpl(io.questdb.griffin.engine.functions.bind.BindVariableServiceImpl) File(java.io.File)

Example 9 with BindVariableServiceImpl

use of io.questdb.griffin.engine.functions.bind.BindVariableServiceImpl in project questdb by bluestreak01.

the class TxSerializerTest method setUpStatic.

@BeforeClass
public static void setUpStatic() {
    setCairoStatic();
    compiler = new SqlCompiler(engine);
    BindVariableServiceImpl bindVariableService = new BindVariableServiceImpl(configuration);
    sqlExecutionContext = new SqlExecutionContextImpl(engine, 1).with(AllowAllCairoSecurityContext.INSTANCE, bindVariableService, null, -1, null);
    bindVariableService.clear();
}
Also used : SqlExecutionContextImpl(io.questdb.griffin.SqlExecutionContextImpl) SqlCompiler(io.questdb.griffin.SqlCompiler) BindVariableServiceImpl(io.questdb.griffin.engine.functions.bind.BindVariableServiceImpl)

Aggregations

BindVariableServiceImpl (io.questdb.griffin.engine.functions.bind.BindVariableServiceImpl)9 SqlCompiler (io.questdb.griffin.SqlCompiler)4 SqlExecutionContextImpl (io.questdb.griffin.SqlExecutionContextImpl)4 Test (org.junit.Test)3 RecordCursorFactory (io.questdb.cairo.sql.RecordCursorFactory)2 SqlExecutionContext (io.questdb.griffin.SqlExecutionContext)2 TableWriter (io.questdb.cairo.TableWriter)1 BindVariableService (io.questdb.cairo.sql.BindVariableService)1 ReaderOutOfDateException (io.questdb.cairo.sql.ReaderOutOfDateException)1 RecordCursor (io.questdb.cairo.sql.RecordCursor)1 CompiledQuery (io.questdb.griffin.CompiledQuery)1 FilesFacade (io.questdb.std.FilesFacade)1 FilesFacadeImpl (io.questdb.std.FilesFacadeImpl)1 DateFormat (io.questdb.std.datetime.DateFormat)1 TimestampFormatCompiler (io.questdb.std.datetime.microtime.TimestampFormatCompiler)1 StringSink (io.questdb.std.str.StringSink)1 File (java.io.File)1 BeforeClass (org.junit.BeforeClass)1