Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-2169

Ignite-import-schema tool generates incorrect null schema for JDBC

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.0.final
    • 1.5.0.final
    • wizards
    • 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

          Activity

            People

              Unassigned Unassigned
              endian675@gmail.com Michael Griggs
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m