[
https://issues.apache.org/jira/browse/IGNITE-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064738#comment-15064738
]
ASF GitHub Bot commented on IGNITE-2169:
----------------------------------------
GitHub user endian675 opened a pull request:
https://github.com/apache/ignite/pull/356
IGNITE-2169 Ignite-import-schema tool generates incorrect null schema for
JDBC
Ignite-import-schema tool generates incorrect null schema for JDBC
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/endian675/ignite ignite-2169
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ignite/pull/356.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #356
----
commit b074c4daf16d2ffd4fa381f28f5de959987e2f35
Author: M Griggs <[email protected]>
Date: 2015-12-18T20:29:15Z
IGNITE-2169: Ignite-import-schema tool generates incorrect null schema for
JDBC
Fixed.
commit 7295a46e195995b9f5e33d55b094c9f22962efc3
Author: M Griggs <[email protected]>
Date: 2015-12-18T20:46:31Z
IGNITE-2169: fix formatting
----
> 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)