Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1595

Intersect and Except query components breaking on successful comparisons

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.8.3.Final
    • 2.8.2.Final
    • Graph (2.x), Query
    • None

      (See #MODE-1594 for prerequisite fix to get to this issue – without applying that fix the parser will break before the query executes and triggers this issue)

      The INTERSECT and EXCEPT operations (and variants with the ALL flag set) are breaking.

      INTERSECT enters an infinite loop upon the first successful compare since it never advances either iterator and the comparison always executes again on the first identical tuples.

      EXCEPT throws an InvalidStateException on the second successful compare in a row, since in that state it will call Iterator.remove() a second time without having advanced.

      None of the three classes extending SetOperationComponent (ExceptComponent, IntersectComponent, UnionComponent) have any test coverage that I noticed. I'm attaching a patch file with fixes to ExceptComponent and IntersectComponent, as well as a (very) basic testcase in a new file SetOperationComponentsTest.java.

            Unassigned Unassigned
            dmfay Dian Fay (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: