Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Not a Bug
    • 5.5.25-galera
    • None
    • None
    • None
    • linux

    Description

      hi, i'm running two queries but they return diferent order by results when they should be the same i will attach files to create tables

      Attachments

        Issue Links

          Activity

            and it returned with order by b? or by a? if it returned from by b, the parser didn't ignored the implicity order by of group by... in other words why a order by is ignored and a order by with group by isn't?

            rspadim roberto spadim added a comment - and it returned with order by b? or by a? if it returned from by b, the parser didn't ignored the implicity order by of group by... in other words why a order by is ignored and a order by with group by isn't?

            SELECT * FROM
            ( SELECT a, b FROM t1 GROUP BY a, b DESC ORDER BY b ASC
            ) t
            LIMIT 0, 10

            Result is ordered by "b ASC". So ORDER BY is not ignored.

            phatum@mail.ru Dmitriy Pavlichenko added a comment - SELECT * FROM ( SELECT a, b FROM t1 GROUP BY a, b DESC ORDER BY b ASC ) t LIMIT 0, 10 Result is ordered by "b ASC". So ORDER BY is not ignored.

            now try this
            alter table t1 order by a,b desc;
            SELECT * FROM
            ( SELECT a, b FROM t1 ORDER BY b ASC
            ) t
            LIMIT 0, 10

            and test if it's ordered by a,b desc or b asc

            rspadim roberto spadim added a comment - now try this alter table t1 order by a,b desc; SELECT * FROM ( SELECT a, b FROM t1 ORDER BY b ASC ) t LIMIT 0, 10 and test if it's ordered by a,b desc or b asc

            It's ordered by a,b desc.
            ORDER BY b ASC is ignored

            phatum@mail.ru Dmitriy Pavlichenko added a comment - It's ordered by a,b desc. ORDER BY b ASC is ignored

            that's the point
            why it's ignored, if it's explicit? ok it's not explicit for the out select, but it's explicit for one select...
            i think it's as undocumented, or a bug... i prefer think as a undocumented, and show a workaround to make it work... but for some guy that changed from mysql to mariadb, will consider it as a bug...

            rspadim roberto spadim added a comment - that's the point why it's ignored, if it's explicit? ok it's not explicit for the out select, but it's explicit for one select... i think it's as undocumented, or a bug... i prefer think as a undocumented, and show a workaround to make it work... but for some guy that changed from mysql to mariadb, will consider it as a bug...

            People

              Unassigned Unassigned
              rspadim roberto spadim
              Votes:
              1 Vote for this issue
              Watchers:
              4 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.