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

Table-less scalar subquery with LIMIT 0 returns 1 instead of NULL

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.6, 10.11, 11.4, 11.8, 12.2(EOL), 12.3.1
    • 10.11, 11.4, 11.8, 12.3
    • Optimizer
    • None
    • ubuntu22.04

    Description

      MariaDB [logic_bug_focus]> SELECT (SELECT 1 LIMIT 0);
      +--------------------+
      | (SELECT 1 LIMIT 0) |
      +--------------------+
      |                  1 |
      +--------------------+
      1 row in set (0.001 sec)
      

      however in mysql:

      mysql> SELECT (SELECT 1 LIMIT 0);
      +--------------------+
      | (SELECT 1 LIMIT 0) |
      +--------------------+
      |               NULL |
      +--------------------+
      1 row in set (0.000 sec)
      

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            mu mu
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.