Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-25539

Misleading error messages when using unsupported quantified comparison predicates of degree > 1

    XMLWordPrintable

Details

    Description

      Run any of these queries:

      select (1, 1) = all (select 1 as `a`, 1 as `b`) as a;
      select (1, 1) < any (select 1 as `a`, 1 as `b`) as a;
      

      To get this error:

      SQL Error [1241] [21000]: Operand should contain 1 column(s)

      This query works just fine:

      select (1, 1) = any (select 1 as `a`, 1 as `b`) as a;
      select (1, 1) != all (select 1 as `a`, 1 as `b`) as a;
      

      It seems like the operands that map to IN or NOT IN are implemented, but not the others. If the correct implementation of the feature is not a high priority, I would at least suggest a fix in the error message, to hint at a missing implementation, rather than a syntax error.

      For example this query here:

      select 1 in (select 1 limit 1)
      

      Offers a much more helpful error message:

      SQL Error [1235] [42000]: (conn=5) This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.