From 10e2fa515cd0a5e1e2184e507dd2a4330a49cf47 Mon Sep 17 00:00:00 2001 From: "ccooper%deadsquid.com" Date: Fri, 8 Jun 2007 16:52:30 +0000 Subject: [PATCH] b=383749 - fix table aliases --- webtools/litmus/Litmus/DB/Subgroup.pm | 5 +++-- webtools/litmus/Litmus/DB/TestRun.pm | 6 +++--- webtools/litmus/Litmus/DB/Testcase.pm | 2 +- webtools/litmus/Litmus/DB/Testresult.pm | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/webtools/litmus/Litmus/DB/Subgroup.pm b/webtools/litmus/Litmus/DB/Subgroup.pm index b70d203586c..141d6aca6b0 100755 --- a/webtools/litmus/Litmus/DB/Subgroup.pm +++ b/webtools/litmus/Litmus/DB/Subgroup.pm @@ -149,8 +149,9 @@ sub coverage() { $sql .= " AND tr.user_id=" . $user->{'user_id'}; } if ($trusted) { - $sql .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND ugm.group_id=sd.group_id "; - $sql .= " AND (sd.grouptype=1 OR sd.grouptype=3)"; + + $sql .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND ugm.group_id=sg.group_id "; + $sql .= " AND (sg.grouptype=1 OR sg.grouptype=3)"; } $sql .= " GROUP BY tr.testcase_id"; diff --git a/webtools/litmus/Litmus/DB/TestRun.pm b/webtools/litmus/Litmus/DB/TestRun.pm index 13dc735e295..be9f916325a 100755 --- a/webtools/litmus/Litmus/DB/TestRun.pm +++ b/webtools/litmus/Litmus/DB/TestRun.pm @@ -355,7 +355,7 @@ $sql .= " WHERE if ($trusted) { $sql .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND - ugm.group_id=sd.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)"; + ugm.group_id=secgrps.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)"; } $sql .= $self->getCriteriaSql(); @@ -420,7 +420,7 @@ $sql .= " WHERE if ($trusted) { $sql .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND - ugm.group_id=sd.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)"; + ugm.group_id=secgrps.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)"; } $sql .= $self->getCriteriaSql(); @@ -477,7 +477,7 @@ $sql .= " WHERE if ($trusted) { $sql .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND - ugm.group_id=sd.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)"; + ugm.group_id=secgrps.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)"; } $sql .= $self->getCriteriaSql(); diff --git a/webtools/litmus/Litmus/DB/Testcase.pm b/webtools/litmus/Litmus/DB/Testcase.pm index cf475fe499a..a483703bdac 100755 --- a/webtools/litmus/Litmus/DB/Testcase.pm +++ b/webtools/litmus/Litmus/DB/Testcase.pm @@ -233,7 +233,7 @@ sub coverage() { } if ($trusted) { $from .= ", user_group_map ugm, security_groups sg"; - $where .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND ugm.group_id=sd.group_id AND (sg.grouptype=1 OR sg.grouptype=3)"; + $where .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND ugm.group_id=sg.group_id AND (sg.grouptype=1 OR sg.grouptype=3)"; } my $sql = $select . $from . $where . $order_by; #print $sql,"
\n"; diff --git a/webtools/litmus/Litmus/DB/Testresult.pm b/webtools/litmus/Litmus/DB/Testresult.pm index c234e88f56e..c675f280a74 100755 --- a/webtools/litmus/Litmus/DB/Testresult.pm +++ b/webtools/litmus/Litmus/DB/Testresult.pm @@ -133,8 +133,8 @@ Litmus::DB::Testresult->set_sql(CompletedByTrusted => qq{ tr.opsys_id=? AND tr.user_id=u.user_id AND AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND - ugm.group_id=sd.group_id AND - (sd.grouptype=1 OR sd.grouptype=3) + ugm.group_id=sg.group_id AND + (sg.grouptype=1 OR sg.grouptype=3) ORDER BY tr.submission_time DESC });