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

Subquery with Empty Set in result returns incorrect result

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.1.10, 5.5, 10.0, 10.1, 10.2
    • 10.2
    • None
    • None

    Description

      Description:
      Output:
      ===

      mysql> (select 1 limit 0);
      Empty set (0.00 sec)
       
      mysql> select (select 1 limit 0);
      +--------------------+
      | (select 1 limit 0) |
      +--------------------+
      |                  1 |
      +--------------------+
      1 row in set (0.00 sec)
       
      mysql> select exists(select 1 limit 0);
      +--------------------------+
      | exists(select 1 limit 0) |
      +--------------------------+
      |                        1 |
      +--------------------------+
      1 row in set (0.00 sec)
       
      mysql> select version();
      +--------------+
      | version()    |
      +--------------+
      | 5.7.8-rc-log |
      +--------------+
      1 row in set (0.00 sec)
      

      Problem:
      ===
      The last 2 queries is expected to return NULL.

      How to repeat:

       
      (select 1 limit 0);
      select (select 1 limit 0);
      select exists(select 1 limit 0);
      

      Suggested fix:
      The last 2 queries is expected to return NULL.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            dylan Dylan Su
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.