News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Database error on 2.0.14: ORDER BY clause is not in SELECT list

Started by Hurga, June 09, 2017, 05:40:21 AM

Previous topic - Next topic

Hurga

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

SpacePhoenix


vbgamer45

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

Hurga

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

piotao

Quote from: vbgamer45 on June 09, 2017, 03:57:52 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!

Wittsend

Quote from: vbgamer45 on June 09, 2017, 03:57:52 PM
To disable  then restart mysql
Add this:

[mysqld]
sql-mode=""

To:
/etc/mysql/my.cnf


Many thanks, this patch worked for me with my 2.0.15 forum running with php 5.6.40
What we see depends mainly on what we look for.

Advertisement: