Search in sources :

Example 1 with DeallocateStatement

use of io.crate.sql.tree.DeallocateStatement in project crate by crate.

the class DeallocateAnalyzerTest method testAnalyzeDeallocateWithWrongExpression.

@Test
public void testAnalyzeDeallocateWithWrongExpression() {
    expectedException.expect(AssertionError.class);
    expectedException.expectMessage("Expression $1 not supported as preparedStmt expression for DEALLOCATE");
    DeallocateAnalyzer.analyze(new DeallocateStatement(new ParameterExpression(1)));
}
Also used : DeallocateStatement(io.crate.sql.tree.DeallocateStatement) ParameterExpression(io.crate.sql.tree.ParameterExpression) Test(org.junit.Test) CrateDummyClusterServiceUnitTest(io.crate.test.integration.CrateDummyClusterServiceUnitTest)

Example 2 with DeallocateStatement

use of io.crate.sql.tree.DeallocateStatement in project crate by crate.

the class TestStatementBuilder method testDeallocate.

@Test
public void testDeallocate() {
    DeallocateStatement stmt = (DeallocateStatement) SqlParser.createStatement("DEALLOCATE test_prep_stmt");
    assertThat(stmt.preparedStmt().toString(), is("'test_prep_stmt'"));
    stmt = (DeallocateStatement) SqlParser.createStatement("DEALLOCATE 'test_prep_stmt'");
    assertThat(stmt.preparedStmt().toString(), is("'test_prep_stmt'"));
}
Also used : DeallocateStatement(io.crate.sql.tree.DeallocateStatement) Test(org.junit.Test)

Example 3 with DeallocateStatement

use of io.crate.sql.tree.DeallocateStatement in project crate by crate.

the class TestStatementBuilder method testDeallocateAll.

@Test
public void testDeallocateAll() {
    Statement stmt = SqlParser.createStatement("DEALLOCATE ALL");
    assertTrue(stmt.equals(new DeallocateStatement()));
}
Also used : DeallocateStatement(io.crate.sql.tree.DeallocateStatement) SetStatement(io.crate.sql.tree.SetStatement) CommitStatement(io.crate.sql.tree.CommitStatement) DeallocateStatement(io.crate.sql.tree.DeallocateStatement) BeginStatement(io.crate.sql.tree.BeginStatement) Statement(io.crate.sql.tree.Statement) KillStatement(io.crate.sql.tree.KillStatement) SetSessionAuthorizationStatement(io.crate.sql.tree.SetSessionAuthorizationStatement) Test(org.junit.Test)

Aggregations

DeallocateStatement (io.crate.sql.tree.DeallocateStatement)3 Test (org.junit.Test)3 BeginStatement (io.crate.sql.tree.BeginStatement)1 CommitStatement (io.crate.sql.tree.CommitStatement)1 KillStatement (io.crate.sql.tree.KillStatement)1 ParameterExpression (io.crate.sql.tree.ParameterExpression)1 SetSessionAuthorizationStatement (io.crate.sql.tree.SetSessionAuthorizationStatement)1 SetStatement (io.crate.sql.tree.SetStatement)1 Statement (io.crate.sql.tree.Statement)1 CrateDummyClusterServiceUnitTest (io.crate.test.integration.CrateDummyClusterServiceUnitTest)1