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

Support SELECT * for IN predicate subqueries when it is "obvious" that the asterisk expands to exactly one column

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.14.1.0
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      None
    • Urgency:
      Normal
    • Issue & fix info:
      Workaround attached
    • Bug behavior facts:
      Deviation from standard, Seen in production

      Description

      The following query is not allowed in Derby:

      SELECT *
      FROM sys.systables
      WHERE tablename IN (
        SELECT *
        FROM (
          SELECT 'SYSTABLES' t
          FROM sysibm.sysdummy1
        ) t
      )

      The error I'm getting is:

      'SELECT *' only allowed in EXISTS and NOT EXISTS subqueries.

      In this case, it is "obvious" that the asterisk (also a qualified asterisk: t.*) expands to exactly one column and the query should be perfectly fine. I'm not aware of any other databases with such a restriction.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              lukas.eder Lukas Eder
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: