Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Ravey76 on June 23, 2022, 10:13:41 AM

Title: Database error when sorting PM by sender
Post by: Ravey76 on June 23, 2022, 10:13:41 AM
Hello everyone,

my users have brought to my attention that when trying to sort the "Personal Messages" by sender, a database error occurs. Important: This error occurs only with the "sent messages". The received messages can be sorted as desired.

I see the following error message in the error log:

http://xxxxxxx/forum/index.php?action=pm;f=sent;start=0;sort=name
/xxxxxxxxxx/htdocs/forum/Sources/PersonalMessage.php%20(Line 932)


Database error: Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'XXXXXXXXXXX.mem.real_name' which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by

Does anyone have any idea what is causing this?

And: i don't have any mods installed that access the PN functionality.
My forum version: SMF 2.1.2

Thank you and best regards

Karl
Title: Re: Database error when sorting PN by sender
Post by: Diego Andrés on June 24, 2022, 01:04:04 AM
Seems this happens on this site too.
I'll move this to the bugs board.
Title: Re: Database error when sorting PN by sender
Post by: Oldiesmann on June 25, 2022, 01:23:17 AM
What version of MySQL or MariaDB are you running? It works fine on my forum with MariaDB 10.3.34
Title: Re: Database error when sorting PN by sender
Post by: Ravey76 on June 25, 2022, 06:57:58 AM
The database version is: MySQL 5.7

I also have a second forum running, different database (also MySQL 5.7).

There I get the same error message, but slightly modified:

Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'XXXXXX.mem.real_name' which is not
functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
File: /XXXXXXXXXX/forum/Sources/PersonalMessage.php
Row: 932


Addition:

The error message is the same; only the one above appears directly when I click on "Sort" and the one from post #1 is from the error log
Title: Re: Database error when sorting PM by sender
Post by: shawnb61 on November 25, 2022, 03:35:04 PM
Fixed in 2.1.3.