h2/src/test/org/h2/test/db/TestSpatial.java
/**
     * Check that geometry column type is kept with a table function
     */
Check that geometry column type is kept with a table function
Check that geometry column type is kept with a table function
private void testTableFunctionGeometry() throws SQLException {
        deleteDb("spatial");
        Connection conn = getConnection(url);
        try {
            Statement stat = conn.createStatement();
            stat.execute("CREATE ALIAS POINT_TABLE FOR \"" +
                    TestSpatial.class.getName() + ".pointTable\"");
            stat.execute("create table test as select * from point_table(1, 1)");
            ResultSet columnMeta = conn.getMetaData().getColumns(null, null, "TEST", "THE_GEOM");
            assertTrue(columnMeta.next());
            assertEquals("geometry", columnMeta.getString("TYPE_NAME").toLowerCase());
            assertFalse(columnMeta.next());
        } finally {
            conn.close();
        }
        deleteDb("spatial");
    }
private void testTableFunctionGeometry ( ) throws SQLException { deleteDb ( "spatial" ) ; Connection conn = getConnection ( url ) ; try { Statement stat = conn . createStatement ( ) ; stat . execute ( "CREATE ALIAS POINT_TABLE FOR \"" + TestSpatial . class . getName ( ) + ".pointTable\"" ) ; stat . execute ( "create table test as select * from point_table(1, 1)" ) ; ResultSet columnMeta = conn . getMetaData ( ) . getColumns ( null , null , "TEST" , "THE_GEOM" ) ; assertTrue ( columnMeta . next ( ) ) ; assertEquals ( "geometry" , columnMeta . getString ( "TYPE_NAME" ) . toLowerCase ( ) ) ; assertFalse ( columnMeta . next ( ) ) ; } finally { conn . close ( ) ; } deleteDb ( "spatial" ) ; }
Check that geometry column type is kept with a table function
Check that geometry column type is kept with a table function
// Read column type