Hello,
Yesterday, I have updated my forum from 2.1.4 to 2.1.5
After update, when I'm using Quick Search bar, Search "In this topic", with every search query I get a database error message:
'bulataka_bnf.t.id_topic' isn't in GROUP BY
File: /home/bulataka/public_html/BNF/Sources/Search.php
Line: 1725
Click => (https://i.postimg.cc/jwJM2x3b/DBsearch.jpg) (https://postimg.cc/jwJM2x3b)
Sources/Search.php, Line 1725
$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ('
Forum details:
Forum version: SMF 2.1.5 (more detailed)
Current SMF version: SMF 2.1.5
GD version: bundled (2.1.0 compatible)
MySQL engine: MariaDB
MySQL version: 10.6.22-MariaDB-log
SMF file based caching: 2.1.5
Memcache:
Memcached:
SQLite3 database based caching: 3.26.0
PHP: 8.4.8 (more detailed)
Server version: Apache
With all previous SMF 2.1.* versions, search function worked fine.
Pretty sure this is a bug...
I'll take a peek later today.
MariaDB strikes again... ::)
Issue logged: https://github.com/SimpleMachines/SMF/issues/8688
You can address by making the following change in Search.php, ~line 1336-1337, adding the t.id_topic:
Search:
if (!empty($search_params['show_complete']))
$main_query['group_by'][] = 'm.id_msg, t.id_first_msg, t.id_last_msg';
Replace:
if (!empty($search_params['show_complete']))
$main_query['group_by'][] = 't.id_topic, m.id_msg, t.id_first_msg, t.id_last_msg';
As ever, if you make a tweak like this in your code, you will need to revert it before applying the next patch.
This issue only affects MariaDB users.
Thanks, problem solved :)