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

Side effect causes the execution of a code which was not indended to

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.2.8
    • 5.0.4
    • Code Generator
    • OSS Roxie.

    Description

      In certain cases WHEN doesn't prevent execution of a code.

      -----------------------------------
      m := DATASET(['Should not appear'],

      {STRING msg});
      mf := DATASET(['Should not appear either'], {STRING msg}

      );
      tf := DATASET(['Should appear'],

      {STRING msg}

      );

      w := OUTPUT(m, NAMED('MessageCodes'), extend);
      falsearm := WHEN(mf, w, SUCCESS);
      truearm := tf;

      OUTPUT(IF(nofold(true), truearm, falsearm));
      It is expected that output in w should not happen, since falsearm is not evaluated.
      -----------------------------------
      -----------------------------------
      It looks like the following code in Roxie:
      virtual void stop(bool aborting)
      {
      if (state != STATEstopped)

      { stopDependencies(savedExtractSize, savedExtract, aborting ? WhenSuccessId : WhenFailureId); // These ones don't get executed executeDependencies(savedExtractSize, savedExtract, aborting ? WhenFailureId : WhenSuccessId); // These ones do }

      CRoxieServerActivity::stop(aborting);
      }
      Is causing the dependencies to be executed – the code on the false branch is stopped (and aborting is false).
      -----------------------------------

      Attachments

        Activity

          People

            richardkchapman Richard Chapman
            vmyullyari Vladimir Myullyari
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: