Derby
  1. Derby
  2. DERBY-5369

Restricted Table Function support should pass NOT EQUAL restrictions to initScan

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.5.3.0
    • Fix Version/s: 10.7.1.4, 10.8.3.0
    • Component/s: SQL
    • Labels:
    • Urgency:
      Urgent
    • Bug behavior facts:
      Performance

      Description

      Restricted Table Function support should pass NOT EQUAL restrictions to initScan. Currently any "!=" or "<>" constraints on the SQL used in the WHERE clause of a SELECT on a Restricted Table Funtion are not passed to the initScan method. These can be useful depending on how the Restricted Table Function is implemented.

      1. derby-5369.diff
        2 kB
        Brett Bergquist
      2. derby-5369-01-aa-inequalityOperator.diff
        7 kB
        Rick Hillegas

        Issue Links

          Activity

          Hide
          Knut Anders Hatlen added a comment -

          [bulk update: close all resolved issues that haven't had any activity the last year]

          Show
          Knut Anders Hatlen added a comment - [bulk update: close all resolved issues that haven't had any activity the last year]
          Hide
          Mamta A. Satoor added a comment -

          I have backported 1160858 to 10.7 but since this is more of an improvement jira rather than a bug fix, I do not plan to backport it any further at this moment.

          Show
          Mamta A. Satoor added a comment - I have backported 1160858 to 10.7 but since this is more of an improvement jira rather than a bug fix, I do not plan to backport it any further at this moment.
          Hide
          Rick Hillegas added a comment -

          As I see it, this is an improvement to a feature which makes the feature more usable. The crucial documentation change is in the public api javadoc and that is part of the patch. Thanks.

          Show
          Rick Hillegas added a comment - As I see it, this is an improvement to a feature which makes the feature more usable. The crucial documentation change is in the public api javadoc and that is part of the patch. Thanks.
          Hide
          Mike Matrigali added a comment -

          this looks like a feature to me, I would lean toward it not being suitable for backport.

          Show
          Mike Matrigali added a comment - this looks like a feature to me, I would lean toward it not being suitable for backport.
          Hide
          Mamta A. Satoor added a comment -

          Thanks Kathey, I will continue backporting the code changes to 10.6 and 10.5 codelines in the meantime

          Show
          Mamta A. Satoor added a comment - Thanks Kathey, I will continue backporting the code changes to 10.6 and 10.5 codelines in the meantime
          Hide
          Kathey Marsden added a comment -

          Regarding the doc change, was their a behavior change in this issue? If so, it probably isn't good for backport. If not, it would be fine I think to backport just the code changes and not worry about the doc. Users can consult the 10.8 doc if they need further clarification and typically people picking up fixes on the branches don't rebuild the doc anyway so wouldn't benefit.

          Show
          Kathey Marsden added a comment - Regarding the doc change, was their a behavior change in this issue? If so, it probably isn't good for backport. If not, it would be fine I think to backport just the code changes and not worry about the doc. Users can consult the 10.8 doc if they need further clarification and typically people picking up fixes on the branches don't rebuild the doc anyway so wouldn't benefit.
          Hide
          Mamta A. Satoor added a comment -

          orted code changes 1160858 from trunk to 10.7 branch at subversion revision 1303451.

          Show
          Mamta A. Satoor added a comment - orted code changes 1160858 from trunk to 10.7 branch at subversion revision 1303451.
          Hide
          Mamta A. Satoor added a comment -

          The checkin for this jira touches RestrictedVTITest.java. The method changed in that test was added as part of DERBY-5370 which has not been backported to 10.7. I will go ahead and do the m(test_11_5370)(erge without the change to RestrictedVTITest.java I didn't see DERBY-5370 as one of the candidates for backport.

          Show
          Mamta A. Satoor added a comment - The checkin for this jira touches RestrictedVTITest.java. The method changed in that test was added as part of DERBY-5370 which has not been backported to 10.7. I will go ahead and do the m(test_11_5370)(erge without the change to RestrictedVTITest.java I didn't see DERBY-5370 as one of the candidates for backport.
          Hide
          Mamta A. Satoor added a comment -

          Assigning to myself to do the backport.

          Show
          Mamta A. Satoor added a comment - Assigning to myself to do the backport.
          Hide
          Kathey Marsden added a comment -

          Reopen for 10.5 backport consideration. If working on the backport for this issue. Temporarily assign yourself and add a comment that you are working on it. When finished, reresolve with the new fix versions or label backport_reject_10_x as appropriate.

          Show
          Kathey Marsden added a comment - Reopen for 10.5 backport consideration. If working on the backport for this issue. Temporarily assign yourself and add a comment that you are working on it. When finished, reresolve with the new fix versions or label backport_reject_10_x as appropriate.
          Hide
          Rick Hillegas added a comment -

          Backporting this work to earlier branches should be ok. Note that you will want to backport the corresponding docs change too: derby-5372.

          Show
          Rick Hillegas added a comment - Backporting this work to earlier branches should be ok. Note that you will want to backport the corresponding docs change too: derby-5372.
          Hide
          Rick Hillegas added a comment -

          Ported 1160858 from trunk to 10.8 branch at subversion revision 1160861.

          Show
          Rick Hillegas added a comment - Ported 1160858 from trunk to 10.8 branch at subversion revision 1160861.
          Hide
          Rick Hillegas added a comment -

          Attaching derby-5369-01-aa-inequalityOperator.diff. This adds a test case to Brett's patch and touches up the javadoc for RestrictedVTI. Committed at subversion revision 1160858.

          Touches the following file:

          ---------------

          M java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
          M java/engine/org/apache/derby/vti/Restriction.java

          Brett's original patch.

          ---------------

          M java/engine/org/apache/derby/vti/RestrictedVTI.java

          Touched up the javadoc to say that != is a supported operator.

          ---------------

          M java/testing/org/apache/derbyTesting/functionTests/tests/lang/RestrictedVTITest.java

          Test case for the != operator.

          Show
          Rick Hillegas added a comment - Attaching derby-5369-01-aa-inequalityOperator.diff. This adds a test case to Brett's patch and touches up the javadoc for RestrictedVTI. Committed at subversion revision 1160858. Touches the following file: --------------- M java/engine/org/apache/derby/impl/sql/compile/FromVTI.java M java/engine/org/apache/derby/vti/Restriction.java Brett's original patch. --------------- M java/engine/org/apache/derby/vti/RestrictedVTI.java Touched up the javadoc to say that != is a supported operator. --------------- M java/testing/org/apache/derbyTesting/functionTests/tests/lang/RestrictedVTITest.java Test case for the != operator.
          Hide
          Rick Hillegas added a comment -

          Thanks for the patch, Brett. Looks good to me. Would be good to have a test case for this one too. In addition, the following documentation work needs to be done:

          1) The header comment in RestrictedVTI should list != and <> as affected operators.

          2) Those operators should also appear in the list of operators in the Developer's Guide section titled "Writing restricted table functions".

          I will log a doc issue for (2) and link it to this issue. Someone else will probably tackle (2) so you don't need to worry about that one unless you want to learn how to evolve Derby documentation. Thanks.

          Show
          Rick Hillegas added a comment - Thanks for the patch, Brett. Looks good to me. Would be good to have a test case for this one too. In addition, the following documentation work needs to be done: 1) The header comment in RestrictedVTI should list != and <> as affected operators. 2) Those operators should also appear in the list of operators in the Developer's Guide section titled "Writing restricted table functions". I will log a doc issue for (2) and link it to this issue. Someone else will probably tackle (2) so you don't need to worry about that one unless you want to learn how to evolve Derby documentation. Thanks.
          Hide
          Brett Bergquist added a comment -

          Patch to add in support for passing NOT EQUALS restriction to initScan

          Show
          Brett Bergquist added a comment - Patch to add in support for passing NOT EQUALS restriction to initScan

            People

            • Assignee:
              Rick Hillegas
              Reporter:
              Brett Bergquist
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development