Bug #82664

Workspaces: MSSQL cannot GROUP BY aliased column

Added by Susanne Moog over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Workspaces
Target version:
-
Start date:
2017-10-04
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Related issues

Related to TYPO3 Core - Task #82811: Extend WorkspaceServiceTests for fetchPagesWithVersionsInTable Closed 2017-10-19

Associated revisions

Revision 6b13e12b (diff)
Added by Susanne Moog over 2 years ago

[BUGFIX] Do not GROUP BY alias in WorkspaceService

GROUP BY statements are in general evaluated before
SELECT statements. If a DBMS does not implement additional
logic to resolve aliases defined in SELECTS before grouping
the statement will fail. Currently both MSSQL as well as ORACLE
lack these additional implementations. To be safe we should
group by the non-aliased columns.

Change-Id: I04698b2c31fbe2b0907fd345fbbf5e84dcebf164
Resolves: #82664
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54281
Reviewed-by: Wouter Wolters <>
Tested-by: TYPO3com <>
Reviewed-by: Oliver Hader <>
Reviewed-by: Andreas Fernandez <>
Reviewed-by: Joerg Boesche <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 3ecc19c0 (diff)
Added by Susanne Moog over 2 years ago

[BUGFIX] Do not GROUP BY alias in WorkspaceService

GROUP BY statements are in general evaluated before
SELECT statements. If a DBMS does not implement additional
logic to resolve aliases defined in SELECTS before grouping
the statement will fail. Currently both MSSQL as well as ORACLE
lack these additional implementations. To be safe we should
group by the non-aliased columns.

Change-Id: I04698b2c31fbe2b0907fd345fbbf5e84dcebf164
Resolves: #82664
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54308
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54281

#2 Updated by Oliver Hader over 2 years ago

Sidenote: On MSSQL SELECT is processed after GROUP BY - that's the reason alias names cannot be used here.

#3 Updated by Susanne Moog over 2 years ago

To be complete ;)

DBMS evaluate statements in the following order:
FROM
WHERE
GROUP BY
HAVING
SELECT
ORDER BY

DBMS with additional logic may be able to resolve aliases set in SELECT in other parts already, but to be safe we should write statements as though there is no additional logic.

#4 Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54308

#5 Updated by Anonymous over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#6 Updated by Oliver Hader over 2 years ago

  • Related to Task #82811: Extend WorkspaceServiceTests for fetchPagesWithVersionsInTable added

#7 Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF