You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Alexey Kuznetsov (JIRA)" <ji...@apache.org> on 2015/12/15 18:45:46 UTC

[jira] [Comment Edited] (IGNITE-2169) Ignite-import-schema tool generates incorrect null schema for JDBC

    [ https://issues.apache.org/jira/browse/IGNITE-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15058401#comment-15058401 ] 

Alexey Kuznetsov edited comment on IGNITE-2169 at 12/15/15 5:45 PM:
--------------------------------------------------------------------

Michael, it seems that fix will be quite simple.
I could review and merge your pull request.
But please, do not delay with your fix - we are going to release soon.


was (Author: kuaw26):
Michael, it seems that fix will be quite simple.
I could review you pull request.
But please, do not delay with your fix - we are going to release soon.

> Ignite-import-schema tool generates incorrect null schema for JDBC
> ------------------------------------------------------------------
>
>                 Key: IGNITE-2169
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2169
>             Project: Ignite
>          Issue Type: Bug
>          Components: wizards
>    Affects Versions: 1.5
>            Reporter: Michael Griggs
>            Assignee: Michael Griggs
>             Fix For: 1.5
>
>
> Given a SQLite database file that contains tables that are not inside a schema, i.e.:
> {code}
> sqlite> .schema
> CREATE TABLE INFO_LIST(aType varchar(64), aCode varchar(128), aInt INTEGER, aDate datetime, PRIMARY KEY(aType, aCode));
> {code}
> The ignite-import-schema.sh tool generates a {{CacheConfig.java}} with the following schema:
> {code}
> type.setDatabaseSchema("null");
> {code}
> When the {{CacheAbstractJdbcStore#EntryMapping}} class is instantiated, it performs the following check:
> {code}
> fullTblName = F.isEmpty(schema) ? tblName : schema + "." + tblName;
> {code}
> and generates the following {{insQuery}} and {{updQuery}}
> {code}
> INSERT INTO null.INFO_LIST(aType,aCode,aInt,aDate) VALUES(?,?,?,?)
> UPDATE null.INFO_LIST SET aInt=?,aDate=? WHERE (aType=? AND aCode=?)
> {code}
> This is incorrect, and the code generated in CacheConfig.java should be:
> {code}
> type.setDatabaseSchema(null);
> {code}
> i.e., *without* quotes.  Then the {{F#isEmpty(schema)}} call returns the correct value.
> *Right now, the code generated by ignite-import-schema.sh is not usable without finding this problem one's self, and fixing it.*  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)