Skip to main content
Topic: MySQL strict mode (Read 2608 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

MySQL strict mode

Hi,

I encountered this error while trying to open Sent Items
Code: [Select]
Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'databasename.pm.id_pm' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
File: /srv/users/serverpilot/apps/appname/public/sources/subs/PersonalMessage.subs.php
Line: 1034

Note: Your database version is 1.0.10.

after a litte search I found that I must disable MySQL strict mode on my serverpilot's VPS

AFAIK MySQL strict mode was enabled by default since MySQL 5.7, should Elkarte aware of this?

Regards,
Lukas

Re: MySQL strict mode

Reply #1

Try replacing the:
Code: [Select]
'sort' => $pm_options['sort_by_query'],
of the query, with:
Code: [Select]
'sort' => $pm_options['sort_by_query'] === 'pm.id_pm' ? 'MAX(pm.id_pm)' : $pm_options['sort_by_query'],
Bugs creator.
Features destroyer.
Template killer.

Re: MySQL strict mode

Reply #2

Done
Nice to know, reenabled MySQL strict mode now...
Thanks

Re: MySQL strict mode

Reply #3

Let me know if it works! :)
Bugs creator.
Features destroyer.
Template killer.


 

Re: MySQL strict mode

Reply #5

it works :)


you're right it's similar, I wonder why I did not see your thread at first search...  :-*