? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
31 Oct 2015

Steps to reproduce the issue

administration->content->categories

Actual result

j35 administration

wrong SQL group by for postgresql & mssql in administration->content->categories

After patch

j35 administration articles categories

avatar alikon alikon - open - 31 Oct 2015
avatar alikon alikon - change - 31 Oct 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Oct 2015
Labels Added: ?
avatar waader
waader - comment - 1 Nov 2015

Works with postgres and mysql, not with mssql. I didnĀ“t work with mssql before.

Error

[Microsoft][SQL Server Native Client 11.0][SQL Server]Column '#__categories.title' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. SQL=SELECT a.id, a.title, a.alias, a.note, a.published, a.access, a.checked_out, a.checked_out_time, a.created_user_id, a.path, a.parent_id, a.level, a.lft, a.rgt, a.language,l.title AS language_title,uc.name AS editor,ag.title AS access_level,ua.name AS author_name,COUNT(DISTINCT cp.id) AS count_published,COUNT(DISTINCT cu.id) AS count_unpublished,COUNT(DISTINCT ca.id) AS count_archived,COUNT(DISTINCT ct.id) AS count_trashed FROM #__categories AS a LEFT JOIN [#__languages] AS l ON l.lang_code = a.language LEFT JOIN #__users AS uc ON uc.id=a.checked_out LEFT JOIN #__viewlevels AS ag ON ag.id = a.access LEFT JOIN #__users AS ua ON ua.id = a.created_user_id LEFT JOIN #__content AS cp ON cp.catid = a.id AND cp.state = 1 LEFT JOIN #__content AS cu ON cu.catid = a.id AND cu.state = 0 LEFT JOIN #__content AS ca ON ca.catid = a.id AND ca.state = 2 LEFT JOIN #__content AS ct ON ct.catid = a.id AND ct.state = -2 WHERE a.extension = 'com_content' AND (a.published IN (0, 1)) GROUP BY a.id, l.title, uc.name, ag.title, ua.name ORDER BY a.lft asc [Microsoft][SQL Server Native Client 11.0][SQL Server]Column '#__categories.title' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. SQL=SELECT * FROM ( SELECT a.id, a.title, a.alias, a.note, a.published, a.access, a.checked_out, a.checked_out_time, a.created_user_id, a.path, a.parent_id, a.level, a.lft, a.rgt, a.language,l.title AS language_title,uc.name AS editor,ag.title AS access_level,ua.name AS author_name,COUNT(DISTINCT cp.id) AS count_published,COUNT(DISTINCT cu.id) AS count_unpublished,COUNT(DISTINCT ca.id) AS count_archived,COUNT(DISTINCT ct.id) AS count_trashed , ROW_NUMBER() OVER (ORDER BY a.lft asc) AS RowNumber FROM #__categories AS a LEFT JOIN [#__languages] AS l ON l.lang_code = a.language LEFT JOIN #__users AS uc ON uc.id=a.checked_out LEFT JOIN #__viewlevels AS ag ON ag.id = a.access LEFT JOIN #__users AS ua ON ua.id = a.created_user_id LEFT JOIN #__content AS cp ON cp.catid = a.id AND cp.state = 1 LEFT JOIN #__content AS cu ON cu.catid = a.id AND cu.state = 0 LEFT JOIN #__content AS ca ON ca.catid = a.id AND ca.state = 2 LEFT JOIN #__content AS ct ON ct.catid = a.id AND ct.state = -2 WHERE a.extension = 'com_content' AND (a.published IN (0, 1)) GROUP BY a.id, l.title, uc.name, ag.title, ua.name ) A WHERE A.RowNumber BETWEEN 1 AND 20 [Microsoft][SQL Server Native Client 11.0][SQL Server]Column '#__categories.title' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. SQL=SELECT a.id, a.title, a.alias, a.note, a.published, a.access, a.checked_out, a.checked_out_time, a.created_user_id, a.path, a.parent_id, a.level, a.lft, a.rgt, a.language,l.title AS language_title,uc.name AS editor,ag.title AS access_level,ua.name AS author_name,COUNT(DISTINCT cp.id) AS count_published,COUNT(DISTINCT cu.id) AS count_unpublished,COUNT(DISTINCT ca.id) AS count_archived,COUNT(DISTINCT ct.id) AS count_trashed FROM #__categories AS a LEFT JOIN [#__languages] AS l ON l.lang_code = a.language LEFT JOIN #__users AS uc ON uc.id=a.checked_out LEFT JOIN #__viewlevels AS ag ON ag.id = a.access LEFT JOIN #__users AS ua ON ua.id = a.created_user_id LEFT JOIN #__content AS cp ON cp.catid = a.id AND cp.state = 1 LEFT JOIN #__content AS cu ON cu.catid = a.id AND cu.state = 0 LEFT JOIN #__content AS ca ON ca.catid = a.id AND ca.state = 2 LEFT JOIN #__content AS ct ON ct.catid = a.id AND ct.state = -2 WHERE a.extension = 'com_content' AND (a.published IN (0, 1)) GROUP BY a.id, l.title, uc.name, ag.title, ua.name ORDER BY a.lft asc


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8221.

avatar alikon
alikon - comment - 1 Nov 2015

should work on mssql too

avatar alikon alikon - change - 1 Nov 2015
Title
PostgreSQL - wrong group by on categories
PostgreSQL - MSSQL wrong group by on categories
avatar alikon alikon - change - 1 Nov 2015
The description was changed
avatar waader waader - test_item - 1 Nov 2015 - Tested successfully
avatar waader
waader - comment - 1 Nov 2015

I have tested this item :white_check_mark: successfully on 4a1b982

Thanks alikon!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8221.

avatar zero-24 zero-24 - test_item - 1 Nov 2015 - Tested successfully
avatar zero-24
zero-24 - comment - 1 Nov 2015

I have tested this item :white_check_mark: successfully on 4a1b982

Works great here on mysql too. Thanks.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8221.

avatar zero-24 zero-24 - change - 1 Nov 2015
Category MS SQL Postgresql
avatar zero-24 zero-24 - change - 1 Nov 2015
Milestone Added:
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 1 Nov 2015

RTC @roland-d makre sure this gets merged into staging as well :smiley:


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8221.

avatar joomla-cms-bot joomla-cms-bot - change - 1 Nov 2015
Labels Added: ?
avatar roland-d roland-d - change - 2 Nov 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-11-02 15:53:10
Closed_By roland-d
avatar roland-d roland-d - close - 2 Nov 2015
avatar joomla-cms-bot joomla-cms-bot - close - 2 Nov 2015
avatar joomla-cms-bot joomla-cms-bot - change - 2 Nov 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment