Search in sources :

Example 6 with HSQLInterface

use of org.hsqldb_voltpatches.HSQLInterface in project voltdb by VoltDB.

the class TestDDLCompiler method testENG_912.

//
// Before the fix for ENG-912, the following schema would work:
//  create table tmc (name varchar(32), user varchar(32));
// but this wouldn't:
//  create table tmc (name varchar(32), user varchar(32), primary key (name, user));
//
// Changes in HSQL's ParserDQL and ParserBase make this more consistent
//
public void testENG_912() throws HSQLParseException {
    String schema = "create table tmc (name varchar(32), user varchar(32), primary key (name, user));";
    HSQLInterface hsql = HSQLInterface.loadHsqldb();
    hsql.runDDLCommand(schema);
    VoltXMLElement xml = hsql.getXMLFromCatalog();
    System.out.println(xml);
    assertTrue(xml != null);
}
Also used : HSQLInterface(org.hsqldb_voltpatches.HSQLInterface) VoltXMLElement(org.hsqldb_voltpatches.VoltXMLElement)

Example 7 with HSQLInterface

use of org.hsqldb_voltpatches.HSQLInterface in project voltdb by VoltDB.

the class TestDDLCompiler method testENG_2345.

//
// Before fixing ENG-2345, the VIEW definition wouldn't compile if it were
// containing single quote characters.
//
public void testENG_2345() throws HSQLParseException {
    String table = "create table tmc (name varchar(32), user varchar(32), primary key (name, user));";
    HSQLInterface hsql = HSQLInterface.loadHsqldb();
    hsql.runDDLCommand(table);
    String view = "create view v (name , user ) as select name , user from tmc where name = 'name';";
    hsql.runDDLCommand(view);
    VoltXMLElement xml = hsql.getXMLFromCatalog();
    System.out.println(xml);
    assertTrue(xml != null);
}
Also used : HSQLInterface(org.hsqldb_voltpatches.HSQLInterface) VoltXMLElement(org.hsqldb_voltpatches.VoltXMLElement)

Aggregations

HSQLInterface (org.hsqldb_voltpatches.HSQLInterface)7 VoltXMLElement (org.hsqldb_voltpatches.VoltXMLElement)4 URL (java.net.URL)2 BufferedReader (java.io.BufferedReader)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 FileReader (java.io.FileReader)1 PrintStream (java.io.PrintStream)1 ArrayList (java.util.ArrayList)1 HSQLParseException (org.hsqldb_voltpatches.HSQLInterface.HSQLParseException)1 Database (org.voltdb.catalog.Database)1 VoltCompiler (org.voltdb.compiler.VoltCompiler)1 DdlProceduresToLoad (org.voltdb.compiler.VoltCompiler.DdlProceduresToLoad)1