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(EOL)
    • 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 (Inactive)
            alice Alice Sherepa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1d
                1d

                Git Integration

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