aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-03-16 08:27:14 +0000
committermkanat%kerio.com <>2005-03-16 08:27:14 +0000
commitb99cbd1d893ff0a730ab7187f409bcdf3c6f4aeb (patch)
treeb2769bdde9c44eefd7834dcbc18e67e66d6d1aa9 /editcomponents.cgi
parentBug 284811 : Remove %FORM from enter_bug.cgi classification code (diff)
downloadbugzilla-b99cbd1d893ff0a730ab7187f409bcdf3c6f4aeb.tar.gz
bugzilla-b99cbd1d893ff0a730ab7187f409bcdf3c6f4aeb.tar.bz2
bugzilla-b99cbd1d893ff0a730ab7187f409bcdf3c6f4aeb.zip
Bug 174295: ANSI SQL requires all columns in SELECT to be in GROUP BY, unless they are in "aggregate" functions
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=joel, a=myk
Diffstat (limited to 'editcomponents.cgi')
-rwxr-xr-xeditcomponents.cgi21
1 files changed, 12 insertions, 9 deletions
diff --git a/editcomponents.cgi b/editcomponents.cgi
index a8d1f1f90..9a1e7934e 100755
--- a/editcomponents.cgi
+++ b/editcomponents.cgi
@@ -139,8 +139,9 @@ unless ($product) {
if ($showbugcounts){
SendSQL("SELECT products.name, products.description, COUNT(bug_id)
- FROM products LEFT JOIN bugs ON products.id = bugs.product_id
- GROUP BY products.name
+ FROM products LEFT JOIN bugs
+ ON products.id = bugs.product_id " .
+ $dbh->sql_group_by('products.name', 'products.description') . "
ORDER BY products.name");
} else {
SendSQL("SELECT products.name, products.description
@@ -184,17 +185,19 @@ unless ($action) {
my @components = ();
if ($showbugcounts) {
- SendSQL("SELECT name,description, initialowner,
+ SendSQL("SELECT name, description, initialowner,
initialqacontact, COUNT(bug_id)
- FROM components LEFT JOIN bugs ON
- components.id = bugs.component_id
- WHERE components.product_id = $product_id
- GROUP BY name");
+ FROM components LEFT JOIN bugs
+ ON components.id = bugs.component_id
+ WHERE components.product_id = $product_id " .
+ $dbh->sql_group_by('name',
+ 'description, initialowner, initialqacontact'));
} else {
SendSQL("SELECT name, description, initialowner, initialqacontact
FROM components
- WHERE product_id = $product_id
- GROUP BY name");
+ WHERE product_id = $product_id " .
+ $dbh->sql_group_by('name',
+ 'description, initialowner, initialqacontact'));
}
while (MoreSQLData()) {