Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2706

[GH-801] Update SqlWalker.php fixed wrong GROUP BY clause on SQL Server platform

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of flip111:

      Url: https://github.com/doctrine/doctrine2/pull/801

      Message:

      Without this patch a query would like like:
      ```
      SELECT c0_.Country AS sclr0
      FROM Continent c0_ WITH (NOLOCK)
      WHERE c0_.Country = 38
      GROUP BY sclr0
      ```
      Using the column alias in the GROUP BY clause. However this is not allowed on SQL Server. References:
      1. http://stackoverflow.com/a/3841804
      2. http://technet.microsoft.com/en-us/library/ms189499.aspx (Logical Processing Order of the SELECT statement)

      The correct query should be:
      ```
      SELECT c0_.Country AS sclr0
      FROM Continent c0_ WITH (NOLOCK)
      WHERE c0_.Country = 38
      GROUP BY c0_.Country
      ```

        Activity

        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-801] was closed:
        https://github.com/doctrine/doctrine2/pull/801

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-801] was closed: https://github.com/doctrine/doctrine2/pull/801
        Show
        Fabio B. Silva added a comment - Merged : https://github.com/doctrine/doctrine2/commit/2c4c26c5d66c4de85b552f3c9a9aedeb66a93351

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: