User tests: Successful: Unsuccessful:
Pull Request for Issue # .
Add parentheses to Order By
Create new Blog Menu with order by Published Up (Most Recent First ) DESC
Order by Published Up DESC
Order by Published Up ASC
No
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_content |
Title |
|
Labels |
Added:
?
|
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-09-29 22:27:00 |
Closed_By | ⇒ | Quy |
Hi Quy, The problem is ORDER BY on mysql > 5.6 is not working.
Status | Closed | ⇒ | Pending |
Closed_Date | 2019-09-29 22:27:00 | ⇒ | |
Closed_By | Quy | ⇒ |
@Quy Let's see if we can get some tester with MySQL 8. I don't have my new, additional testing environment ready yet. In MySQL 8, the default setup uses strict modes and so on, which on previous versions beginning with 5.7 could be set, too, but not were set with the default setup. So maybe @luredweb ran into an issue which I can't reproduce on 5.7 because I have the default setup, and he maybe uses a hosting provider's db where some settings are changed to more modern and safe ones, e.g. strict mode.
Regarding the SQL: Normally you include such an "CASE ... WHEN" into the columns to be selected and give it a column alias in the "SELECT", and in the "ORDER BY" you just use this column alias, but changing this in our PHP at this place would be a bigger change outside the skope of this PR, I think.
What could be a problem is that in strict mode, mysql might behave (haven't checked docs) like standard sql and only accepts columns or expressions in order by which are part of the selected columns. I.e. a "SELECT thiscolumn FROM thattable ORDER BY someothercolumn;" would result in an SQL error.
But then I would expect for this issue here an SQL error and not a wrong ordering direction, this is what confuses me a bit.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-18 18:35:28 |
Closed_By | ⇒ | Quy |
Can't reproduce using MySQL 5.7.23-cll-lve.
Hi. I reopened this because it's happen when you have multilingual
it's happen when you have multilingual
Test on English on a Multilangual site (mysql 5.7.30-cll-lve). If i understand you correct it works, but maybe i need more information.
Changes in this PR will not affect the sort order. If your articles do not have published dates, then they will fall back to sorting by created dates.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26171.