Advertisement:

Author Topic: Database error on 2.0.14: ORDER BY clause is not in SELECT list  (Read 1382 times)

Offline Hurga

  • Newbie
  • *
  • Posts: 4
When clicking "Show new replies to your posts" I get:

Database Error
Expression #1 of ORDER BY clause is not in SELECT list, references column 'ef_forum.t.id_last_msg' which is not in SELECT list; this is incompatible with DISTINCT
File: /home/forum/smf/Sources/Recent.php
Line: 1103

SMF 2.0.14, Ubuntu 16.04.2 LTS, MySQL 5.7.18-0ubuntu0.16.04.1, PHP 7.0.18-0ubuntu0.16.04.1

Rest of the forum seems to be fine. Didn't happen before upgrade to SMF 2.0.14

- Hurga

Offline SpacePhoenix

  • Jr. Member
  • **
  • Posts: 100
Re: Database error on 2.0.14: ORDER BY clause is not in SELECT list
« Reply #1 on: June 09, 2017, 02:49:53 PM »
It's probably fallen foul of MySQL's strict mode

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,628
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Database error on 2.0.14: ORDER BY clause is not in SELECT list
« Reply #2 on: June 09, 2017, 03:57:52 PM »
To disable  then restart mysql
Add this:

[mysqld]
sql-mode=""

To:
/etc/mysql/my.cnf
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Hurga

  • Newbie
  • *
  • Posts: 4
Re: Database error on 2.0.14: ORDER BY clause is not in SELECT list
« Reply #3 on: June 09, 2017, 08:15:44 PM »
Didn't know this was necessary. It's been only necessary to remove the ONLY_FULL_GROUP_BY part from sql_mode - works fine now. Thanks a lot :)

- Hurga

Offline piotao

  • Newbie
  • *
  • Posts: 6
Re: Database error on 2.0.14: ORDER BY clause is not in SELECT list
« Reply #4 on: April 18, 2019, 12:46:16 PM »
[mysqld]
sql-mode=""
To:
/etc/mysql/my.cnf

HOLY MOLY, this error I had also on 2.0.15 forum under MariaDB on both php 7.0 and 7.2. It gave me quite a lot sleepless nights; now I disabled this and ... everything seems to be working! Thank you!