Database error in Search results after update to 2.1.5

Started by Speed King, Yesterday at 08:38:59 AM

Previous topic - Next topic

Speed King

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 =>


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.

shawnb61

Pretty sure this is a bug...

I'll take a peek later today.

MariaDB strikes again...   ::)
A question worth asking is born in experience & driven by necessity. - Fripp

shawnb61

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.
A question worth asking is born in experience & driven by necessity. - Fripp

Speed King


Advertisement: