You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladimir Steshin (Jira)" <ji...@apache.org> on 2020/02/19 15:18:00 UTC

[jira] [Updated] (IGNITE-12704) Fail of recognition of default scheme in SQL queries.

     [ https://issues.apache.org/jira/browse/IGNITE-12704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Steshin updated IGNITE-12704:
--------------------------------------
    Description: 


{code:java}
// Got a connection
Connection conn = ...;

// Get all the tables. execute() - is just a helper function. Creates prepared statement, pass params...
List<List<?>> lst = execute(conn, "select SCHEMA_NAME, TABLE_NAME from SYS.TABLES");

for( List<?> row : lst ){
        String schemaName = (String)row.get(0);
        String tableName = (String)row.get(1);

        // Shows: "schema: default, table: PERSON"
        System.out.println("schema: " +  schemName + ", table: " + tableName));

        // Fails with with: java.sql.SQLException: Failed to parse query. Схема "DEFAULT" не найдена
        execute( conn, "drop table "+schemaName + "."+tableName+"'" );
}
</code>

I think this case should fail with error like "only cache created tables
can be removed with drop table. ", not with "scheme not found."
SQL-engine is supposed to accept and understand values it returns itself.

  was:
Got a connectionConnection conn = ...;

// execute() - is just a helper function. Creates prepared statement, pass params...

// Get all the tables.
List<List<?>> lst = execute(conn, "select SCHEMA_NAME, TABLE_NAME from
SYS.TABLES");

for( List<?> row : lst ){
        String schemaName = (String)row.get(0);
        String tableName = (String)row.get(1);

        // Shows: "schema: default, table: PERSON"
        System.out.println("schema: " +  schemName + ", table: " +
tableName));

        // Fails with with: java.sql.SQLException: Failed to parse query.
Схема "DEFAULT" не найдена
        execute( conn, "drop table "+schemaName + "."+tableName+"'" );
}

I think this case should fail with error like "only cache created tables
can be removed with drop table. ", not with "scheme not found."
SQL-engine is supposed to accept and understand values it returns itself.


> Fail of recognition of default scheme in SQL queries.
> -----------------------------------------------------
>
>                 Key: IGNITE-12704
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12704
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Vladimir Steshin
>            Priority: Minor
>
> {code:java}
> // Got a connection
> Connection conn = ...;
> // Get all the tables. execute() - is just a helper function. Creates prepared statement, pass params...
> List<List<?>> lst = execute(conn, "select SCHEMA_NAME, TABLE_NAME from SYS.TABLES");
> for( List<?> row : lst ){
>         String schemaName = (String)row.get(0);
>         String tableName = (String)row.get(1);
>         // Shows: "schema: default, table: PERSON"
>         System.out.println("schema: " +  schemName + ", table: " + tableName));
>         // Fails with with: java.sql.SQLException: Failed to parse query. Схема "DEFAULT" не найдена
>         execute( conn, "drop table "+schemaName + "."+tableName+"'" );
> }
> </code>
> I think this case should fail with error like "only cache created tables
> can be removed with drop table. ", not with "scheme not found."
> SQL-engine is supposed to accept and understand values it returns itself.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)