SQL92 requires that all columns (except aggregates) in the select clause is part of the group by clause. SQL99 loosens this restriction a bit and states that all columns in the select clause must be functionally dependent of the group by clause. This commit fixes all partial GROUP BY queries to be compatible with SQL92. Previously, when MySQLs sql_mode included ONLY_FULL_GROUP_BY, aggregating queries failed, resulting in an empty domain listing.
This commit is contained in:
parent
0d1f5503ae
commit
dc8fab4d42
|
@ -35,7 +35,7 @@ if(isset($input->action) && $input->action == "getDomains") {
|
||||||
LEFT OUTER JOIN records R ON D.id = R.domain_id
|
LEFT OUTER JOIN records R ON D.id = R.domain_id
|
||||||
LEFT OUTER JOIN permissions P ON D.id = P.domain
|
LEFT OUTER JOIN permissions P ON D.id = P.domain
|
||||||
WHERE (P.user=? OR ?)
|
WHERE (P.user=? OR ?)
|
||||||
GROUP BY D.id
|
GROUP BY D.id, D.name, D.type
|
||||||
HAVING
|
HAVING
|
||||||
(D.name LIKE ? OR ?) AND
|
(D.name LIKE ? OR ?) AND
|
||||||
(D.type=? OR ?)
|
(D.type=? OR ?)
|
||||||
|
|
Loading…
Reference in a new issue