You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Michael Griggs (JIRA)" <ji...@apache.org> on 2015/12/15 17:31:46 UTC
[jira] [Assigned] (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:all-tabpanel ]
Michael Griggs reassigned IGNITE-2169:
--------------------------------------
Assignee: Michael Griggs
> 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.6
>
>
> 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)