Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12889 closed Bug Report - General (Duplicate)

mysql error

Reported by: jbeck2@… Owned by: Stuart Auchterlonie
Priority: minor Milestone: unknown
Component: Plugin - MythWeb Version: Unspecified
Severity: medium Keywords: mysql ONLY_FULL_GROUP_BY
Cc: Ticket locked: no

Description

[0] => SQL Error: Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'mythconverg.program.endtime' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by #1055

see: http://stackoverflow.com/questions/34115174/i-am-getting-an-error-in-mysql-related-to-only-full-group-by-when-executing-a-qu

where it says: (#18)

you can turn of the warning as explained in the other answers or you can understand what's happening and fix it.

As of MySQL 5.7.5, the default SQL mode includes ONLY_FULL_GROUP_BY which means when you are grouping rows and then selecting something out of that groups, you need to explicitly say which row should that selection be made from. Mysql needs to know which row in the group you're looking for, which gives you two options

Mysql needs to know which row in the group you're looking for, which gives you two options

You can also add the column you want to the group statement group by rect.color, rect.value which can be what you want in some cases otherwise would return duplicate results with the same color which you may not want you could also use aggregate functions of mysql to indicate which row you are looking for inside the groups like AVG() MIN() MAX() complete list

Change History (2)

comment:1 Changed 8 years ago by sphery

Resolution: Duplicate
Status: newclosed

Duplicate of #12811. Please try the patch called "MythWeb-SQL_mode_patch.diff​" attached to that ticket. We need some feedback on if it works or not. Please report any feedback to that ticket.

comment:2 Changed 8 years ago by sphery

Priority: blockerminor
Severity: highmedium
Note: See TracTickets for help on using tickets.