Uploaded image for project: 'WsSQL'
  1. WsSQL
  2. WSSQL-72

Only use keyed fields in Index fetch

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Not specified
    • Resolution: Fixed
    • None
    • None
    • ECLEngine
    • None

    Description

      when filter clause includes a keyed and a non-keyed field, and an index fetch is performed, the non-keyed field is being used in the fetch condition causing an error.

      for example:
      select * from tutorial::rp::tutorialperson where zip = '54530' and middlename = 'N'

      Index file '~tutorial::rp::peoplebyzipindex' is keyed by zip, but not by middlename.

      Resulting ECL:

      import std;
      Tbl1RecDef := RECORD string15 firstname; string25 lastname; string15 middlename; string5 zip; string42 street; string20 city; string2 state; unsigned8 fpos

      {virtual(fileposition)}

      ; END;
      Tbl1DS := DATASET('~tutorial::rp::tutorialperson', Tbl1RecDef,FLAT);

      Idx := INDEX(Tbl1DS,

      {zip}

      ,

      { fpos }

      ,'~tutorial::rp::peoplebyzipindex');
      IdxDS := FETCH(Tbl1DS, Idx( ( zip = '54530' )), RIGHT.fpos);

      SelectStruct := RECORD
      string15 middlename := IdxDS.middlename;
      string5 zip := IdxDS.zip;
      string20 city := IdxDS.city;
      string2 state := IdxDS.state;
      string15 firstname := IdxDS.firstname;
      string42 street := IdxDS.street;
      string25 lastname := IdxDS.lastname;
      END;
      IdxDSTable := TABLE(IdxDS, SelectStruct );
      OUTPUT(CHOOSEN(IdxDSTable,ALL),NAMED('JDBCSelectQueryResult'));

      Total elapsed http request/response time in milliseconds: 189
      Parsing results...
      java.sql.SQLException: java.lang.Exception: HPCCJDBC: Error in response: ' Unknown identifier "middlename"'

      Attachments

        Activity

          People

            rpastrana Rodrigo Pastrana
            rpastrana Rodrigo Pastrana
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: