Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-19658

Packagemap validation incorrectly warns about empty superfiles

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Scheduled
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 6.4.18
    • Fix Version/s: 7.2.0
    • Component/s: Roxie
    • Labels:
      None
    • Compatibility:
      Minor

      Description

      Found during code review. Excerpt from an email conversation:

      In common/workunit/pkgimpl.hpp, gatherFileMappingForQuery() has this loop:

      ForEach(*refFiles)
      {
          IReferencedFile &rf = refFiles->query();
          if (!(rf.getFlags() & RefFileInPackage))
              fileInfo->addProp("File", rf.getLogicalName());
          else
          {
              Owned<ISimpleSuperFileEnquiry> ssfe = pkg->resolveSuperFile(rf.getLogicalName());
              if (ssfe && ssfe->numSubFiles()>0) //**************************************************
              {
                  IPropertyTree *superInfo = fileInfo->addPropTree("SuperFile");
                  superInfo->setProp("@name", rf.getLogicalName());
                  unsigned count = ssfe->numSubFiles();
                  while (count--)
                  {
                      StringBuffer subfile;
                      ssfe->getSubFileName(count, subfile);
                      superInfo->addProp("SubFile", subfile.str());
                  }
              }
          }
      }
      

      The line marked with ****** seems to require that referenced superkeys have subkeys before they are gathered. This is not always the case, as empty superkeys are valid if their referencing INDEX declarations have an OPT flag.

      The outcome of the above code is an incorrect warning.

        Attachments

          Activity

            People

            • Assignee:
              afishbeck Anthony Fishbeck
              Reporter:
              dcamper Dan S. Camper
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: