Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5.0.final
-
None
Description
Given a SQLite database file that contains tables that are not inside a schema, i.e.:
sqlite> .schema CREATE TABLE INFO_LIST(aType varchar(64), aCode varchar(128), aInt INTEGER, aDate datetime, PRIMARY KEY(aType, aCode));
The ignite-import-schema.sh tool generates a CacheConfig.java with the following schema:
type.setDatabaseSchema("null");
When the CacheAbstractJdbcStore#EntryMapping class is instantiated, it performs the following check:
fullTblName = F.isEmpty(schema) ? tblName : schema + "." + tblName;
and generates the following insQuery and updQuery
INSERT INTO null.INFO_LIST(aType,aCode,aInt,aDate) VALUES(?,?,?,?) UPDATE null.INFO_LIST SET aInt=?,aDate=? WHERE (aType=? AND aCode=?)
This is incorrect, and the code generated in CacheConfig.java should be:
type.setDatabaseSchema(null);
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.
Attachments
Issue Links
- links to