Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-2805

ASSERT failure with sane build if DISTINCT and ORDER BY are present in a query that selects from a diagnostic table function.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.3.1.4
    • 10.3.1.4
    • SQL
    • None

    Description

      Attempts to execute the following query will lead to an ASSERT failure with sane jars:

      ij> select distinct * from table(syscs_diag.space_table('T1')) X order by 3;

      ERROR XJ001: Java exception: 'ASSERT FAILED markOrderingDependent() not expected to be called for org.apache.derby.impl.sql.compile.FromVTI: org.apache.derby.shared.common.sanity.AssertFailure'.

      Stack trace is:

      at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
      at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
      at ResultSetNode.markOrderingDependent(ResultSetNode.java:1881)
      at SingleChildResultSetNode.markOrderingDependent(SingleChildResultSetNode.java:578)
      at SingleChildResultSetNode.markOrderingDependent(SingleChildResultSetNode.java:578)
      at SingleChildResultSetNode.markOrderingDependent(SingleChildResultSetNode.java:578)
      at SelectNode.genProjectRestrict(SelectNode.java:1409)
      at SelectNode.modifyAccessPaths(SelectNode.java:1816)
      at SingleChildResultSetNode.modifyAccessPaths(SingleChildResultSetNode.java:439)
      at DMLStatementNode.optimizeStatement(DMLStatementNode.java:307)
      at CursorNode.optimizeStatement(CursorNode.java:515)

      I was able to avoid this by adding an empty implementation of "markOrderingDependent" to the FromVTI class, so that's probably the fix that I will post (after looking a bit more closely at the code to see if this makes sense).

      Attachments

        1. d2805_v1.patch
          13 kB
          A B
        2. d2805_v1.stat
          0.7 kB
          A B

        Issue Links

          Activity

            People

              army A B
              army A B
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: