Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Not a Bug
    • Affects Version/s: 5.5.25-galera
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              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?

              Show
              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?
              Hide
              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.

              Show
              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.
              Hide
              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

              Show
              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
              Hide
              phatum@mail.ru Dmitriy Pavlichenko added a comment -

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

              Show
              phatum@mail.ru Dmitriy Pavlichenko added a comment - It's ordered by a,b desc. ORDER BY b ASC is ignored
              Hide
              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...

              Show
              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

                • Assignee:
                  Unassigned
                  Reporter:
                  rspadim roberto spadim
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: