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

ORDER BY / GROUP BY @var_name produces no error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      SELECT * FROM ... LIMIT @x
      produces an error, for any @x.

      SELECT * FROM ... ORDER BY @x
      doesn't produce any error, and ORDER BY seems to do nothing.

      SELLECT * FROM ... GROUP BY @x
      doesn't produce any error, and it seems that there is a grouping, thought it seems to ignore the value of @x.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            This is the expected behavior. See http://dev.mysql.com/doc/refman/5.1/en/select.html for the syntax and semantics of LIMIT, ORDER BY, GROUP BY

            Show
            serg Sergei Golubchik added a comment - This is the expected behavior. See http://dev.mysql.com/doc/refman/5.1/en/select.html for the syntax and semantics of LIMIT, ORDER BY, GROUP BY
            Hide
            f_razzoli Federico Razzoli added a comment -

            I thought that a syntax error was expected, like in the "limit" case... sorry.

            Show
            f_razzoli Federico Razzoli added a comment - I thought that a syntax error was expected, like in the "limit" case... sorry.

              People

              • Assignee:
                Unassigned
                Reporter:
                f_razzoli Federico Razzoli
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: