Skip to content

Commit

Permalink
avoid error when sql_mode=only_full_group_by
Browse files Browse the repository at this point in the history
DBD::mysql::db selectall_arrayref failed: In aggregated query without GROUP BY,
expression #2 of SELECT list contains nonaggregated column 'thruk_logs.l.time';
this is incompatible with sql_mode=only_full_group_by
  • Loading branch information
pvdputte authored and sni committed Apr 15, 2024
1 parent 48da5c2 commit 089a3e2
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions lib/Thruk/Backend/Provider/Mysql.pm
Original file line number Diff line number Diff line change
Expand Up @@ -561,18 +561,7 @@ sub get_logs {
# fetch real number of entries here
my $sql = '
SELECT
count(*),
l.time as time,
l.class as class,
l.type as type,
l.state as state,
l.state_type as state_type,
IFNULL(h.host_name, "") as host_name,
IFNULL(s.service_description, "") as service_description,
IFNULL(c.name, "") as contact_name,
l.message as message,
"'.$prefix.'" as peer_key
'.$extra_columns.'
count(*)
FROM
`'.$prefix.'_log` l
LEFT JOIN `'.$prefix.'_host` h ON l.host_id = h.host_id
Expand Down

0 comments on commit 089a3e2

Please sign in to comment.