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

Wrong results from query, using brackets with ORDER BY ..LIMIT

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.4
    • 10.4.5
    • Parser
    • None

    Description

      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (10),(20),(30);
      SELECT a FROM t1 order by a desc limit 1;
      (SELECT a FROM t1 order by a desc) limit 1;
      

      MariaDB [test]> SELECT a FROM t1 order by a desc limit 1;
      +------+
      | a    |
      +------+
      |   30 |
      +------+
      1 row in set (0.002 sec)
       
      MariaDB [test]> (SELECT a FROM t1 order by a desc) limit 1;
      +------+
      | a    |
      +------+
      |   10 |
      +------+
      1 row in set (0.001 sec)
      

      Attachments

        Activity

          People

            igor Igor Babaev
            alice Alice Sherepa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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