Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-2458

Sybase15 subquery using HAVING clause failing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 7.7
    • JDBC Connector
    • None
    • Workaround Exists
    • Hide

      Use an custom translator to set supportsOnlyCorrelatedSubqueries to true, which will disable a non-correlated subquery pushdown such as this. However similar issues may still exist with other subqueries.

      Show
      Use an custom translator to set supportsOnlyCorrelatedSubqueries to true, which will disable a non-correlated subquery pushdown such as this. However similar issues may still exist with other subqueries.

      Example query is failing: SELECT INTKEY, STRINGKEY, FLOATNUM FROM BQT1.SMALLA GROUP BY INTKEY, STRINGKEY, FLOATNUM HAVING FLOATNUM = (SELECT FLOATNUM FROM BQT1.SMALLA WHERE STRINGKEY = 20)

      When this query is submitted through EDS using Squirrel or BQT as a client it returns:

      IntKey StringKey
      20 20 0

      When the resulting source-specific query generated from EDS is submitted direct to Sybase15 the same results are returned.

      SELECT g_0.IntKey, g_0.StringKey, cast(g_0.FloatNum AS real) FROM SmallA g_0 WHERE cast(g_0.FloatNum AS real) = (SELECT cast(g_1.FloatNum AS real) FROM SmallA g_1 WHERE g_1.StringKey = '20') GROUP BY g_0.IntKey, g_0.StringKey, cast(g_0.FloatNum AS real)is submitted direct to Sybase15

      RESULTS
      IntKey StringKey
      20 20 0

      However, when the GROUP BY is removed from the query it returns the expected results as shown below:

      IntKey StringKey
      20 20 -4

      The supporting VDB can be provided if needed.

            rhn-engineering-shawkins Steven Hawkins
            van.halbert Van Halbert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: